11-07-2008 03:48 AM
11-07-2008 05:06 AM
protected NodeRef getNodeRef(WebScriptRequest req)
{
// NOTE: This web script must be executed in a HTTP Servlet environment
if (!(req instanceof WebScriptServletRequest))
{
throw new WebScriptException("Content retrieval must be executed in HTTP Servlet environment");
}
HttpServletRequest httpReq = ((WebScriptServletRequest)req).getHttpServletRequest();
// locate the root path
String path = (String) httpReq.getParameter("path");
if(path == null)
{
path = "/images";
}
if(path.startsWith("/"))
{
path = path.substring(1, path.length());
}
// build a path elements list
List<String> pathElements = new ArrayList<String>();
StringTokenizer tokenizer = new StringTokenizer(path, "/");
while(tokenizer.hasMoreTokens())
{
String childName = (String) tokenizer.nextToken();
pathElements.add(childName);
}
// look up the child
NodeRef nodeRef = null;
try
{
NodeRef companyHomeRef = this.repository.getCompanyHome();
nodeRef = getFileFolderService().resolveNamePath(companyHomeRef, pathElements).getNodeRef();
}
catch(FileNotFoundException fnfe)
{
throw new WebScriptException(HttpServletResponse.SC_NOT_FOUND, "Unable to locate path");
}
if (nodeRef == null)
{
throw new WebScriptException(HttpServletResponse.SC_NOT_FOUND, "Unable to locate path");
}
return nodeRef;
}
11-09-2008 12:47 PM
java.util.Set findNodesByAssignedPermission(java.lang.String authority, java.lang.String permission, boolean allow, boolean includeContainingAuthorities, boolean exactPermissionMatch)La cuestión es que he revisado el PermissionService (http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/security/PermissionSe...) y esos métodos se encuentran Deprecated (desaprobados, pasados de moda
Find all the nodes where the current user has explicitly been assigned the specified permission.
java.util.Set findNodesByAssignedPermissionForCurrentUser(java.lang.String permission, boolean allow, boolean includeContainingAuthorities, boolean includeContainingPermissions)
Find all the nodes where the current user has explicitly been assigned the specified permission.
11-12-2008 03:22 AM
<#list node.permissions as p>
<tr><td> ${p} </td></tr>
</#list>
pero yo no quiero mostrarlos todos, sino dentro del list comprobar si la cadena "GROUP_XXXXX" se encuentra en lo que me devuelve p, y si está pues lo imprimo y sino pues nada, y así solo me mostrará los de ese grupo que yo quiero, pero me estoy volviendo loca buscando pero lucene no tiene ninguna función con esa funcionalidad, no? Bueno se me olvidaba comentar que esto lo tengo ahora en una template, lo estoy probando ahí poniéndole a mano un grupo, para una vez que lo consiga pues pasarlo al webscript, desde el cual cogeremos el grupo que nos pasen.11-12-2008 03:27 AM
11-12-2008 07:53 AM
11-12-2008 08:15 AM
11-14-2008 03:07 AM
<!– webscript que partiendo de el space CCC, nos da los spaces a los que tiene permiso (y nos indica qué permiso) un grupo determinado, pasado por parámetro –>
<#macro dir node depth>
<#if node.isContainer>
<#if node.permissions?exists>
<#list node.permissions as p>
<#if p?contains(g)>
<tr> <td align='left'>${p?split(";")[2]}</td>
<td align='leftr'>${node.name}</td>
<td>${node.displayPath?substring(25)}/${node.name}</td>
</tr>
</#if>
</#list>
<#else>
<td> no tiene permisos</td>
</#if>
</tr>
<#else>
<b>El space <i>${folderName}</i> NO existe …</b>
</#if>
<#list node.children as child>
<#if child.isContainer && node.children?size != 0>
<@dir node=child depth=depth+1/>
</#if>
</#list>
</#macro>
<!– create a table and start traversing the space structure –>
<html>
<body>
<#assign folderName="User Homes/CCC" />
<#assign node=folderName>
<img src="${url.context}/images/logo/AlfrescoLogo32.png" alt="Alfresco" />
<#if args.group?exists>
<#if grupo?exists>
<#if companyhome.childByNamePath[folderName]?exists>
<#assign folderObj=companyhome.childByNamePath[folderName]>
<#assign g=grupo.properties["usr:authorityName"] +";">
<b>Spaces a los que puede acceder el grupo: </b> ${grupo.properties["usr:authorityName"]}<br>
<br><br>
<table border="1">
<tr><th>Permiso</th><th>Space</th><th>Ruta</th></tr>
<@dir node=folderObj depth=0/>
</table>
</#if>
<#else>
<b>Spaces a los que puede acceder el grupo: </b> El grupo "${args.group}" no existe<br>
</#if>
</#if>
</body>
</html>11-14-2008 03:10 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.