mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged up to HEAD.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3129 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.service.cmr.repository;
|
||||
|
||||
import org.alfresco.repo.content.transform.ContentTransformer;
|
||||
import org.alfresco.service.cmr.dictionary.InvalidTypeException;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
@@ -107,6 +108,18 @@ public interface ContentService
|
||||
public void transform(ContentReader reader, ContentWriter writer)
|
||||
throws NoTransformerException, ContentIOException;
|
||||
|
||||
/**
|
||||
* Fetch the transformer that is capable of transforming the content in the
|
||||
* given source mimetype to the given target mimetype.
|
||||
*
|
||||
* @param the source mimetype
|
||||
* @param the target mimetype
|
||||
* @return Returns a transformer that can be used, or null if one was not available
|
||||
*
|
||||
* @see ContentAccessor#getMimetype()
|
||||
*/
|
||||
public ContentTransformer getTransformer(String sourceMimetype, String targetMimetype);
|
||||
|
||||
/**
|
||||
* Returns whether a transformer exists that can read the content from
|
||||
* the reader and write the content back out to the writer.
|
||||
|
@@ -35,6 +35,7 @@ import org.alfresco.repo.template.XPathResultsMap;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.lock.LockStatus;
|
||||
import org.alfresco.service.cmr.security.AccessPermission;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.QNameMap;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
@@ -82,6 +83,7 @@ public final class TemplateNode implements Serializable
|
||||
private String id;
|
||||
private Set<QName> aspects = null;
|
||||
private QNameMap<String, Object> properties;
|
||||
private List<String> permissions = null;
|
||||
private boolean propsRetrieved = false;
|
||||
private ServiceRegistry services = null;
|
||||
private Boolean isDocument = null;
|
||||
@@ -474,6 +476,32 @@ public final class TemplateNode implements Serializable
|
||||
return locked;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return List of permissions applied to this Node.
|
||||
* Strings returned are of the format [ALLOWED|DENIED];[USERNAME|GROUPNAME];PERMISSION for example
|
||||
* ALLOWED;kevinr;Consumer so can be easily tokenized on the ';' character.
|
||||
*/
|
||||
public List<String> getPermissions()
|
||||
{
|
||||
if (this.permissions == null)
|
||||
{
|
||||
String userName = this.services.getAuthenticationService().getCurrentUserName();
|
||||
this.permissions = new ArrayList<String>(4);
|
||||
Set<AccessPermission> acls = this.services.getPermissionService().getAllSetPermissions(this.nodeRef);
|
||||
for (AccessPermission permission : acls)
|
||||
{
|
||||
StringBuilder buf = new StringBuilder(64);
|
||||
buf.append(permission.getAccessStatus())
|
||||
.append(';')
|
||||
.append(permission.getAuthority())
|
||||
.append(';')
|
||||
.append(permission.getPermission());
|
||||
this.permissions.add(buf.toString());
|
||||
}
|
||||
}
|
||||
return this.permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the parent node
|
||||
*/
|
||||
|
Reference in New Issue
Block a user