Merge from SEAMIST3

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10730 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2008-09-04 11:08:13 +00:00
parent d894798ee4
commit ae909e7413
45 changed files with 4443 additions and 2171 deletions

View File

@@ -28,20 +28,37 @@ import java.io.Serializable;
import org.alfresco.cmis.dictionary.CMISMapping;
import org.alfresco.cmis.dictionary.CMISScope;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
/**
* Get the CMIS object id property.
*
* @author andyh
*
*/
public class ObjectIdPropertyAccessor extends AbstractNamedPropertyAccessor
{
public Serializable getProperty(NodeRef nodeRef)
{
return nodeRef;
if (getServiceRegistry().getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE))
{
Serializable value = getServiceRegistry().getNodeService().getProperty(nodeRef, ContentModel.PROP_VERSION_LABEL);
if (value != null)
{
String versionLabel = DefaultTypeConverter.INSTANCE.convert(String.class, value);
StringBuilder builder = new StringBuilder(128);
builder.append(nodeRef.toString());
builder.append("/");
builder.append(versionLabel);
return builder.toString();
}
}
return nodeRef.toString();
}
@Override
@@ -53,9 +70,7 @@ public class ObjectIdPropertyAccessor extends AbstractNamedPropertyAccessor
@Override
public CMISScope getScope()
{
return CMISScope.OBJECT;
return CMISScope.OBJECT;
}
}