diff --git a/config/alfresco/application-context-highlevel.xml b/config/alfresco/application-context-highlevel.xml
index 5c949bcd04..751f7ec5d1 100644
--- a/config/alfresco/application-context-highlevel.xml
+++ b/config/alfresco/application-context-highlevel.xml
@@ -28,7 +28,6 @@
-
diff --git a/config/alfresco/cmis-api-context.xml b/config/alfresco/cmis-api-context.xml
deleted file mode 100644
index 6758257f5d..0000000000
--- a/config/alfresco/cmis-api-context.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.0
- Version 1.0 OASIS Standard
- ${spaces.store}
- /${spaces.company_home.childname}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- alfresco/model/cmisModel.xml
- alfresco/model/cmisTestModel.xml
-
-
-
-
-
-
-
-
-
- search.CMISQueryService
-
-
-
- org.alfresco.cmis.CMISQueryService
-
-
-
-
-
-
-
-
-
-
-
- alf:icon16
- image/gif
- alf:icon16
- 16
- 16
-
-
- alf:icon32
- image/gif
- alf:icon32
- 32
- 32
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FOLDER
- DOCUMENT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/alfresco/minimal-context.xml b/config/alfresco/minimal-context.xml
index 46010fcb4e..0cca4aca3c 100644
--- a/config/alfresco/minimal-context.xml
+++ b/config/alfresco/minimal-context.xml
@@ -13,7 +13,6 @@
-
diff --git a/config/alfresco/opencmis-context.xml b/config/alfresco/opencmis-context.xml
index 8561513ca9..60eacd1421 100644
--- a/config/alfresco/opencmis-context.xml
+++ b/config/alfresco/opencmis-context.xml
@@ -4,6 +4,15 @@
+
+
+
+ alfresco/model/cmisModel.xml
+ alfresco/model/cmisTestModel.xml
+
+
+
+
diff --git a/config/alfresco/subsystems/Search/lucene/cmis-api-context.xml b/config/alfresco/subsystems/Search/lucene/cmis-api-context.xml
deleted file mode 100644
index 38706a98dc..0000000000
--- a/config/alfresco/subsystems/Search/lucene/cmis-api-context.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.repo.search.impl.querymodel.QueryEngine
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.alfresco.repo.search.impl.querymodel.QueryEngine.executeQuery=ACL_ALLOW,AFTER_ACL_NODE.sys:base.Read
- org.alfresco.repo.search.impl.querymodel.QueryEngine.getQueryModelFactory=ACL_ALLOW
-
-
-
-
-
diff --git a/config/alfresco/subsystems/Search/noindex/cmis-api-context.xml b/config/alfresco/subsystems/Search/noindex/cmis-api-context.xml
deleted file mode 100644
index 5242455356..0000000000
--- a/config/alfresco/subsystems/Search/noindex/cmis-api-context.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/alfresco/subsystems/Search/solr/cmis-api-context.xml b/config/alfresco/subsystems/Search/solr/cmis-api-context.xml
deleted file mode 100644
index 1199197860..0000000000
--- a/config/alfresco/subsystems/Search/solr/cmis-api-context.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/java/org/alfresco/cmis/CMISAccessControlEntriesGroupedByPrincipalId.java b/source/java/org/alfresco/cmis/CMISAccessControlEntriesGroupedByPrincipalId.java
deleted file mode 100644
index fdf4656eb7..0000000000
--- a/source/java/org/alfresco/cmis/CMISAccessControlEntriesGroupedByPrincipalId.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.List;
-
-/**
- * @author andyh
- *
- */
-public interface CMISAccessControlEntriesGroupedByPrincipalId
-{
- /**
- * Get the principal id.
- * @return principal id
- */
- public String getPrincipalId();
-
- /**
- * Get the direct permissions
- * @return the direct permissions
- */
- public List getDirectPermissions();
-
- /**
- * Get the indirect permissions
- * @return the indirect permissions
- */
- public List getIndirectPermissions();
-
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISAccessControlEntry.java b/source/java/org/alfresco/cmis/CMISAccessControlEntry.java
deleted file mode 100644
index d75fb0b7de..0000000000
--- a/source/java/org/alfresco/cmis/CMISAccessControlEntry.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-/**
- * An Access control entry
- *
- * Note: we report one permission at a time rather than group them
- *
- * @author andyh
- *
- */
-public interface CMISAccessControlEntry
-{
- /**
- * Get the principal id.
- * @return principal id
- */
- public String getPrincipalId();
-
- /**
- * Get the unique permission id
- * @return the unique permission id
- */
- public String getPermission();
-
- /**
- * Is the assignment direct on the object
- * @return true
if directly assigned, false
otherwise.
- */
- public boolean getDirect();
-}
diff --git a/source/java/org/alfresco/cmis/CMISAccessControlReport.java b/source/java/org/alfresco/cmis/CMISAccessControlReport.java
deleted file mode 100644
index ae4571826a..0000000000
--- a/source/java/org/alfresco/cmis/CMISAccessControlReport.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.List;
-
-
-/**
- * An Access control report.
- * This is an ACL.
- *
- * @author andyh
- *
- */
-public interface CMISAccessControlReport
-{
- /**
- * Get the list of ACEs.
- * @return the list of ACEs.
- */
- public List extends CMISAccessControlEntry> getAccessControlEntries();
-
- /**
- * Is this report exact?
- * If false
then there are other other security constraints that apply.
- * This will always be false as we have global permission and deny entries that are not reported.
- * We do not explicitly check these cases - and return false - as we have global permission defined by default.
- *
- * @return true
means the report fully describes security access, false
means other
- * security constraints may apply but are not reported.
- */
- public boolean isExact();
-
- /**
- * Get ACEs grouped by principal id
- * @return ACEs grouped by principal id
- * @throws CMISConstraintException
- */
- public List extends CMISAccessControlEntriesGroupedByPrincipalId> getAccessControlEntriesGroupedByPrincipalId() throws CMISConstraintException;
-
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISAccessControlService.java b/source/java/org/alfresco/cmis/CMISAccessControlService.java
deleted file mode 100644
index 0a7edf48a6..0000000000
--- a/source/java/org/alfresco/cmis/CMISAccessControlService.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.List;
-
-import org.alfresco.opencmis.CMISAccessControlFormatEnum;
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * Service for CMIS access control support.
- *
- * @author andyh
- */
-public interface CMISAccessControlService
-{
- /**
- * CMIS Read (properties and content)
- */
- public static final String CMIS_READ_PERMISSION = "cmis:read";
-
- /**
- * CMIS Write (properties and content)
- */
- public static final String CMIS_WRITE_PERMISSION = "cmis:write";
-
- /**
- * CMIS ALL permissions (includes all permissions defined within the repository)
- */
- public static final String CMIS_ALL_PERMISSION = "cmis:all";
-
- /**
- * Get the ACL capability enum.
- * @return the ACL capability enum.
- */
- public CMISAclCapabilityEnum getAclCapability();
-
- /**
- * Gets the supported permission types
- * @return the supported permission types
- */
- public CMISAclSupportedPermissionEnum getSupportedPermissions();
-
- /**
- * Get the ACL propagation enum.
- * @return the ACL propagation enum.
- */
- public CMISAclPropagationEnum getAclPropagation();
-
- /**
- * Get all the permissions defined by the repository.
- * @return a list of permissions
- */
- public List getRepositoryPermissions();
-
- /**
- * Get the list of permission mappings.
- * @return get the permission mapping as defined by the CMIS specification.
- */
- public List extends CMISPermissionMapping> getPermissionMappings();
-
- /**
- * Gets the name of the principal who is used for anonymous access. This principal can then be passed to the ACL
- * services to specify what permissions anonymous users should have.
- *
- * @return name of the principal who is used for anonymous access
- */
- public String getPrincipalAnonymous();
-
- /**
- * Gets the name of the principal who is used to indicate any authenticated user. This principal can then be passed
- * to the ACL services to specify what permissions any authenticated user should have.
- *
- * @return name of the principal who is used to indicate any authenticated user
- */
- public String getPrincipalAnyone();
-
- /**
- * Get the ACLs set on a node.
- * @param nodeRef
- * @param format
- * @return an access control report
- */
- public CMISAccessControlReport getAcl(NodeRef nodeRef, CMISAccessControlFormatEnum format);
-
- /**
- * Update the ACEs on a node.
- * Those already existing, are preserved, those new are added and those missing are removed.
- *
- * @param nodeRef
- * @param acesToApply
- * @return an access control report of the final state
- * @throws CMISConstraintException
- */
- public CMISAccessControlReport applyAcl(NodeRef nodeRef, List acesToApply) throws CMISConstraintException;
-
- /**
- * Update the ACEs on a node.
- * The deletions are applied before the additions.
- * Existing ACEs not deleted or added remain unchanged.
- *
- * @param nodeRef
- * @param acesToRemove
- * @param acesToAdd
- * @param propagation
- * @param format
- * @return an access control report of the final state
- * @throws CMISConstraintException
- */
- public CMISAccessControlReport applyAcl(NodeRef nodeRef, List acesToRemove, List acesToAdd, CMISAclPropagationEnum propagation, CMISAccessControlFormatEnum format) throws CMISConstraintException;
-}
diff --git a/source/java/org/alfresco/cmis/CMISAclCapabilityEnum.java b/source/java/org/alfresco/cmis/CMISAclCapabilityEnum.java
deleted file mode 100644
index ca3ef62dcb..0000000000
--- a/source/java/org/alfresco/cmis/CMISAclCapabilityEnum.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS ACL capability
- *
- * @author andyh
- */
-public enum CMISAclCapabilityEnum implements EnumLabel
-{
- /**
- * ACLs are not supported
- */
- NONE("none"),
- /**
- * ACLs can be read but not set
- */
- DISCOVER("discover"),
- /**
- * ACLs can be read and set
- */
- MANAGE("manage");
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISAclCapabilityEnum(String label)
- {
- this.label = label;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- /**
- * Factory for CMISAclCapabilityEnum
- */
- public static EnumFactory FACTORY = new EnumFactory(CMISAclCapabilityEnum.class, MANAGE, true);
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISAclPropagationEnum.java b/source/java/org/alfresco/cmis/CMISAclPropagationEnum.java
deleted file mode 100644
index 00cfa75d40..0000000000
--- a/source/java/org/alfresco/cmis/CMISAclPropagationEnum.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS ACL propagation
- *
- * Used to request a particular behaviour or report back behaviour.
- *
- * @author andyh
- *
- */
-public enum CMISAclPropagationEnum implements EnumLabel
-{
- /**
- * The ACL only applies to the object
- * (not yet supported in Alfresco)
- */
- OBJECT_ONLY("objectonly"),
- /**
- * ACLs are applied to all inheriting objects
- * (the default in Alfresco)
- */
- PROPAGATE("propagate"),
- /**
- * Some other mechanism by which ACL changes influence other ACL's non-direct ACEs.
- */
- REPOSITORY_DETERMINED("repositorydetermined");
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISAclPropagationEnum(String label)
- {
- this.label = label;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- /**
- * Factory for CMISAclPropagationEnum
- */
- public static EnumFactory FACTORY = new EnumFactory(CMISAclPropagationEnum.class, PROPAGATE, true);
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISAclSupportedPermissionEnum.java b/source/java/org/alfresco/cmis/CMISAclSupportedPermissionEnum.java
deleted file mode 100644
index d2869b4c01..0000000000
--- a/source/java/org/alfresco/cmis/CMISAclSupportedPermissionEnum.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-
-/**
- * Specifies which types of permissions are supported..
- *
- * @author dward
- */
-public enum CMISAclSupportedPermissionEnum
-{
- /**
- * CMIS Basic permissions are supported.
- */
- BASIC("basic"),
- /**
- * Repository specific permissions are supported.
- */
- REPOSITORY("repository"),
- /**
- * both CMIS basic permissions and repository specific permissions are supported. (the default in Alfresco)
- */
- BOTH("both");
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISAclSupportedPermissionEnum(String label)
- {
- this.label = label;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- /**
- * Factory for CMISAclSupportedPermissionEnum
- */
- public static EnumFactory FACTORY = new EnumFactory(
- CMISAclSupportedPermissionEnum.class, BOTH, true);
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISActionEvaluator.java b/source/java/org/alfresco/cmis/CMISActionEvaluator.java
deleted file mode 100644
index be2b264d69..0000000000
--- a/source/java/org/alfresco/cmis/CMISActionEvaluator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-
-public interface CMISActionEvaluator
-{
- /**
- * Gets the CMIS Allowed Action
- *
- * @return
- */
- public CMISAllowedActionEnum getAction();
-
- /**
- * Determines if an action is allowed on an object
- *
- * @param object
- * @return
- */
- public boolean isAllowed(T object);
-}
diff --git a/source/java/org/alfresco/cmis/CMISAllowedActionEnum.java b/source/java/org/alfresco/cmis/CMISAllowedActionEnum.java
deleted file mode 100644
index 86b8b58f8d..0000000000
--- a/source/java/org/alfresco/cmis/CMISAllowedActionEnum.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Allowed Action Enum
- *
- * @author davidc
- */
-public enum CMISAllowedActionEnum implements EnumLabel
-{
-
- // navigation services
- CAN_GET_DESCENDANTS("canGetDescendants", "canGetDescendents.Folder", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetDescendents.Folder", "{http://www.alfresco.org/model/system/1.0}base.ReadChildren"),
- CAN_GET_FOLDER_TREE("canGetFolderTree"/*, "canGetFolderTree.Folder", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetFolderTree.Folder", "{http://www.alfresco.org/model/system/1.0}base.ReadChildren"*/),
- CAN_GET_CHILDREN("canGetChildren", "canGetChildren.Folder", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetChildren.Folder", "{http://www.alfresco.org/model/system/1.0}base.ReadChildren"),
- CAN_GET_FOLDER_PARENT("canGetFolderParent", "canGetParents.Folder", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetParents.Folder", "{http://www.alfresco.org/model/system/1.0}base.ReadProperties"),
- CAN_GET_OBJECT_PARENTS("canGetObjectParents", "canGetFolderParent.Object", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetFolderParent.Object", "{http://www.alfresco.org/model/system/1.0}base.ReadProperties"),
-
- // object services
- CAN_CREATE_DOCUMENT("canCreateDocument", "canCreateDocument.Folder", CMISAccessControlService.CMIS_ALL_PERMISSION, "canCreateDocument.Folder", "{http://www.alfresco.org/model/system/1.0}base.CreateChildren"),
- CAN_CREATE_FOLDER("canCreateFolder", "canCreateFolder.Folder", CMISAccessControlService.CMIS_ALL_PERMISSION, "canCreateFolder.Folder", "{http://www.alfresco.org/model/system/1.0}base.CreateChildren"),
- CAN_CREATE_RELATIONSHIP("canCreateRelationship"),
- CAN_GET_PROPERTIES("canGetProperties", "canGetProperties.Object", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetProperties.Object", "{http://www.alfresco.org/model/system/1.0}base.ReadProperties"),
- CAN_GET_RENDITIONS("canGetRenditions"/*, "canGetRenditions.Object", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetRenditions.Object", "{http://www.alfresco.org/model/system/1.0}base.ReadProperties"*/),
- CAN_GET_CONTENT_STREAM("canGetContentStream", "canViewContent.Object", CMISAccessControlService.CMIS_READ_PERMISSION, "canViewContent.Object", "{http://www.alfresco.org/model/system/1.0}base.ReadContent"),
- CAN_UPDATE_PROPERTIES("canUpdateProperties", "canUpdateProperties.Object", CMISAccessControlService.CMIS_WRITE_PERMISSION, "canUpdateProperties.Object", "{http://www.alfresco.org/model/system/1.0}base.WriteProperties"),
- CAN_MOVE_OBJECT("canMoveObject", "canMove.Object", CMISAccessControlService.CMIS_ALL_PERMISSION, "canMove.Target", CMISAccessControlService.CMIS_ALL_PERMISSION, "canMove.Object", "{http://www.alfresco.org/model/system/1.0}base.DeleteNode", "canMove.Target", "{http://www.alfresco.org/model/system/1.0}base.CreateChildren"),
- CAN_DELETE_OBJECT("canDeleteObject", "canDelete.Object", CMISAccessControlService.CMIS_ALL_PERMISSION, "canDelete.Object", "{http://www.alfresco.org/model/system/1.0}base.DeleteNode"),
- CAN_SET_CONTENT_STREAM("canSetContentStream", "canSetContent.Document", CMISAccessControlService.CMIS_WRITE_PERMISSION, "canSetContent.Document", "{http://www.alfresco.org/model/system/1.0}base.WriteContent"),
- CAN_DELETE_CONTENT_STREAM("canDeleteContentStream", "canDeleteContent.Document", CMISAccessControlService.CMIS_WRITE_PERMISSION, "canDeleteContent.Document", "{http://www.alfresco.org/model/system/1.0}base.WriteContent"),
- CAN_DELETE_TREE("canDeleteTree", "canDeleteTree.Folder", CMISAccessControlService.CMIS_ALL_PERMISSION, "canDeleteTree.Folder", "{http://www.alfresco.org/model/system/1.0}base.DeleteNode"),
-
- // multi-filing services
- CAN_ADD_OBJECT_TO_FOLDER("canAddObjectToFolder", "canAddToFolder.Object", CMISAccessControlService.CMIS_READ_PERMISSION, "canAddToFolder.Folder", CMISAccessControlService.CMIS_ALL_PERMISSION, "canAddToFolder.Object", "{http://www.alfresco.org/model/system/1.0}base.ReadProperties", "canAddToFolder.Folder", "{http://www.alfresco.org/model/system/1.0}base.CreateChildren"),
- CAN_REMOVE_OBJECT_FROM_FOLDER("canRemoveObjectFromFolder", "canRemoveFromFolder.Object", CMISAccessControlService.CMIS_ALL_PERMISSION, "canRemoveFromFolder.Object", "{http://www.alfresco.org/model/system/1.0}base.DeleteNode"),
-
- // versioning services
- CAN_CHECKOUT("canCheckOut", "canCheckout.Document", CMISAccessControlService.CMIS_ALL_PERMISSION, "canCheckout.Document", "{http://www.alfresco.org/model/content/1.0}lockable.CheckOut"),
- CAN_CANCEL_CHECKOUT("canCancelCheckOut", "canCancelCheckout.Document", CMISAccessControlService.CMIS_ALL_PERMISSION, "canCancelCheckout.Document", "{http://www.alfresco.org/model/content/1.0}workingcopy.CancelCheckOut"),
- CAN_CHECKIN("canCheckIn", "canCheckin.Document", CMISAccessControlService.CMIS_ALL_PERMISSION, "canCheckin.Document", "{http://www.alfresco.org/model/content/1.0}workingcopy.CheckIn"),
- CAN_GET_ALL_VERSIONS("canGetAllVersions", "canGetAllVersions.VersionSeries", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetAllVersions.VersionSeries", "{http://www.alfresco.org/model/system/1.0}base.Read"),
-
- // relationship services
- CAN_GET_OBJECT_RELATIONSHIPS("canGetObjectRelationships"),
-
- // policy services
- CAN_APPLY_POLICY("canApplyPolicy", "canAddPolicy.Object", CMISAccessControlService.CMIS_WRITE_PERMISSION, "canAddPolicy.Policy", CMISAccessControlService.CMIS_READ_PERMISSION, "canAddPolicy.Object", "{http://www.alfresco.org/model/system/1.0}base.Write"),
- CAN_REMOVE_POLICY("canRemovePolicy", "canRemovePolicy.Object", CMISAccessControlService.CMIS_WRITE_PERMISSION, "canRemovePolicy.Policy", CMISAccessControlService.CMIS_READ_PERMISSION, "canRemovePolicy.Object", "{http://www.alfresco.org/model/system/1.0}base.Write"),
- CAN_GET_APPLIED_POLICIES("canGetAppliedPolicies", "canGetAppliedPolicies.Object", CMISAccessControlService.CMIS_READ_PERMISSION, "canGetAppliedPolicies.Object", "{http://www.alfresco.org/model/system/1.0}base.ReadProperties"),
-
- // acl services
- CAN_GET_ACL("canGetACL", "canGetACL.Object", CMISAccessControlService.CMIS_ALL_PERMISSION, "canGetACL.Object", "{http://www.alfresco.org/model/system/1.0}base.ReadPermissions"),
- CAN_APPLY_ACL("canApplyACL", "canApplyACL.Object", CMISAccessControlService.CMIS_ALL_PERMISSION, "canApplyACL.Object", "{http://www.alfresco.org/model/system/1.0}base.ChangePermissions");
-
-
- private String label;
-
- private Map> mapping = new HashMap>();
-
- /**
- * Construct
- *
- * @param label
- */
- CMISAllowedActionEnum(String label, String ... keysAndPermissions)
- {
- this.label = label;
- assert(keysAndPermissions.length % 2 == 0);
- for(int i = 0; i < keysAndPermissions.length; i++)
- {
- String key = keysAndPermissions[i];
- String permission = keysAndPermissions[++i];
- List permissions = mapping.get(key);
- if(permissions == null)
- {
- permissions = new ArrayList(1);
- mapping.put(key, permissions);
- }
- permissions.add(permission);
- }
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public Map> getPermissionMapping()
- {
- return mapping;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISAllowedActionEnum.class);
-}
diff --git a/source/java/org/alfresco/cmis/CMISBaseObjectTypeIds.java b/source/java/org/alfresco/cmis/CMISBaseObjectTypeIds.java
deleted file mode 100644
index 3ac8cf3c04..0000000000
--- a/source/java/org/alfresco/cmis/CMISBaseObjectTypeIds.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * Enumeration of base Alfresco Object type Ids. Possible values:
- * DOCUMENT,
- * FOLDER,
- * RELATIONSHIP,
- * POLICY
- *
- * @author Dmitry Velichkevich
- */
-public enum CMISBaseObjectTypeIds implements EnumLabel
-{
- DOCUMENT("cmis:document"), FOLDER("cmis:folder"), RELATIONSHIP("cmis:relationship"), POLICY("cmis:policy");
-
- private String label;
-
- CMISBaseObjectTypeIds(String label)
- {
- this.label = label;
- }
-
- public String getLabel()
- {
- return label;
- }
-
- public static final EnumFactory FACTORY = new EnumFactory(CMISBaseObjectTypeIds.class);
-}
diff --git a/source/java/org/alfresco/cmis/CMISCapabilityChanges.java b/source/java/org/alfresco/cmis/CMISCapabilityChanges.java
deleted file mode 100644
index 5ac4253cc4..0000000000
--- a/source/java/org/alfresco/cmis/CMISCapabilityChanges.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * Enumeration of the CMIS Changes Capability
- *
- * @author Dmitry Velichkevich
- */
-public enum CMISCapabilityChanges implements EnumLabel
-{
- NONE("none"), OBJECTIDSONLY("objectidsonly");
-
- private String label;
-
- CMISCapabilityChanges(String label)
- {
- this.label = label;
- }
-
- public String getLabel()
- {
- return label;
- }
-
- public static final EnumFactory FACTORY = new EnumFactory(CMISCapabilityChanges.class);
-}
diff --git a/source/java/org/alfresco/cmis/CMISCardinalityEnum.java b/source/java/org/alfresco/cmis/CMISCardinalityEnum.java
deleted file mode 100644
index a461abd0fb..0000000000
--- a/source/java/org/alfresco/cmis/CMISCardinalityEnum.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Property Cardinality Enum
- *
- * @author andyh
- */
-public enum CMISCardinalityEnum implements EnumLabel
-{
- SINGLE_VALUED("single"),
- MULTI_VALUED("multi");
-
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISCardinalityEnum(String label)
- {
- this.label = label;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISCardinalityEnum.class, null, true);
-}
diff --git a/source/java/org/alfresco/cmis/CMISChangeEvent.java b/source/java/org/alfresco/cmis/CMISChangeEvent.java
deleted file mode 100644
index 0567b803b9..0000000000
--- a/source/java/org/alfresco/cmis/CMISChangeEvent.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.Date;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * This class describes entry record for some Change Log descriptor.
- *
- * @author Dmitry Velichkevich
- */
-public interface CMISChangeEvent
-{
- /**
- * Gets the change type.
- *
- * @return {@link CMISChangeType} enum value that determines the type of current Change Event
- */
- public CMISChangeType getChangeType();
-
- /**
- * Gets the change time.
- *
- * @return {@link Date} value that represents time of current Change Event
- */
- public Date getChangeTime();
-
- /**
- * Gets the changed node (may no longer exist).
- *
- * @return the changed node
- */
- public NodeRef getChangedNode();
-
- /**
- * Gets the object id.
- *
- * @return the object id
- */
- public String getObjectId();
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISChangeLog.java b/source/java/org/alfresco/cmis/CMISChangeLog.java
deleted file mode 100644
index a33810c5df..0000000000
--- a/source/java/org/alfresco/cmis/CMISChangeLog.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.List;
-
-/**
- * This class represents descriptor for some Change Log Token
- *
- * @author Dmitry Velichkevich
- */
-public interface CMISChangeLog
-{
- /**
- * @return {@link List}<{@link CMISChangeEvent}> collection that contains all available for some Change Log Token Change Events descriptors
- */
- public List getChangeEvents();
-
- /**
- * @return {@link Boolean} value that determines whether repository contains any more Change Events after some {@link CMISChangeLogService}.{@link #getChangeEvents()}
- * invocation
- */
- public boolean hasMoreItems();
-
- /**
- * Note: this is optional operation and actual Change Events amount in collection may not be equal to result of this method invocation
- *
- * @return {@link Integer} value that determines amount of Change Events those were returned
- */
- public Integer getEventCount();
-
- /**
- * @return {@link String} value that represents the next generated Change Log Token
- */
- public String getNextChangeToken();
-}
diff --git a/source/java/org/alfresco/cmis/CMISChangeLogService.java b/source/java/org/alfresco/cmis/CMISChangeLogService.java
deleted file mode 100644
index 1c6eaa0252..0000000000
--- a/source/java/org/alfresco/cmis/CMISChangeLogService.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.List;
-
-/**
- * Service for manipulating with Change Log Events by Change Log Tokens. Also this service exposes some methods for describing Auditing features
- *
- * @author Dmitry Velichkevich
- */
-public interface CMISChangeLogService
-{
- /**
- * @param changeLogToken - {@link String} value that represents some Change Log Token
- * @param maxItems - {@link Integer} value that determines required amount of entries
- * @return {@link CMISChangeLog} instance that describes entry mapped to specified Change Log Token
- * @throws CMISInvalidArgumentException
- */
- public CMISChangeLog getChangeLogEvents(String changeLogToken, Integer maxItems) throws CMISInvalidArgumentException;
-
- /**
- * @return {@link String} value that represents Change Log Token which is currently actual
- */
- public String getLastChangeLogToken();
-
- /**
- * Gets the change log token maxItems entries before the given one
- *
- * @param currentPageToken
- * a change log token
- * @param maxItems
- * the number of entries to skip backwards
- * @return the change log token maxItems entries before currentPageToken
- */
- public String getPreviousPageChangeLogToken(String currentPageToken, Integer maxItems);
-
- /**
- * Assuming that currentPageToken begins a page of maxItems entries, gets the token at the start of the final page.
- *
- * @param currentPageToken
- * a change log token
- * @param maxItems
- * the number of entries per page
- * @return the change log token at the start of the final page
- */
- public String getLastPageChangeLogToken(String currentPageToken, Integer maxItems);
-
- /**
- * @return {@link CMISCapabilityChanges} enum value that specifies currently configured Auditing feature mode
- */
- public CMISCapabilityChanges getCapability();
-
- /**
- * @return {@link List}<{@link CMISBaseObjectTypeIds}> collection instance that contains configured value for Changes On Type capability
- * @see CMISBaseObjectTypeIds
- */
- public List getChangesOnTypeCapability();
-
- /**
- * @return always true
- */
- public boolean getChangesIncomplete();
-}
diff --git a/source/java/org/alfresco/cmis/CMISChangeType.java b/source/java/org/alfresco/cmis/CMISChangeType.java
deleted file mode 100644
index 928a4c1bd7..0000000000
--- a/source/java/org/alfresco/cmis/CMISChangeType.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * Enumeration of the CMIS Change Type. Possible values:
- * CREATED
- * UPDATED
- * DELETED
- * SECURITY
- *
- * @author Dmitry Velichkevich
- */
-public enum CMISChangeType implements EnumLabel
-{
- CREATED("created"), UPDATED("updated"), DELETED("deleted"), SECURITY("security");
-
- private String label;
-
- CMISChangeType(String label)
- {
- this.label = label;
- }
-
- public String getLabel()
- {
- return label;
- }
-
- public static final EnumFactory FACTORY = new EnumFactory(CMISChangeType.class);
-}
diff --git a/source/java/org/alfresco/cmis/CMISChoice.java b/source/java/org/alfresco/cmis/CMISChoice.java
deleted file mode 100644
index 1984c64b4f..0000000000
--- a/source/java/org/alfresco/cmis/CMISChoice.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashSet;
-
-/**
- * Choice for property definitions
- *
- * @author andyh
- *
- */
-public class CMISChoice
-{
- private String name;
-
- Serializable value;
-
- private int index;
-
- private Collection choices = new HashSet();
-
- public CMISChoice(String name, Serializable value, int index)
- {
- this.name = name;
- this.value = value;
- this.index = index;
- }
-
- /**
- * Get the name of the choice
- * @return
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Get the value when chosen
- * @return
- */
- public Serializable getValue()
- {
- return value;
- }
-
- /**
- * Get the index that determined the choices position amongst it siblings
- * @return
- */
- public int getIndex()
- {
- return index;
- }
-
- /**
- * Get sub-choices
- * @return
- */
- public Collection getChildren()
- {
- return choices;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + index;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final CMISChoice other = (CMISChoice) obj;
- if (index != other.index)
- return false;
- if (name == null)
- {
- if (other.name != null)
- return false;
- }
- else if (!name.equals(other.name))
- return false;
- return true;
- }
-
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("[Choice ");
- builder.append("name=").append(getName()).append(",");
- builder.append("index=").append(getIndex()).append(",");
- builder.append("value=").append(getValue()).append(",");
- builder.append("children=").append(getChildren());
- builder.append("]");
- return builder.toString();
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISConstraintException.java b/source/java/org/alfresco/cmis/CMISConstraintException.java
deleted file mode 100644
index 5e0ec61c9a..0000000000
--- a/source/java/org/alfresco/cmis/CMISConstraintException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISConstraintException extends CMISServiceException
-{
- private static final long serialVersionUID = -6416548401387587007L;
-
- public CMISConstraintException(String message)
- {
- super(message, "constraint", 409);
- }
-
- public CMISConstraintException(Throwable cause)
- {
- super(cause, "constraint", 409);
- }
-
- public CMISConstraintException(String message, Throwable cause)
- {
- super(message, cause, "constraint", 409);
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISContentAlreadyExistsException.java b/source/java/org/alfresco/cmis/CMISContentAlreadyExistsException.java
deleted file mode 100644
index 3eb2456227..0000000000
--- a/source/java/org/alfresco/cmis/CMISContentAlreadyExistsException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISContentAlreadyExistsException extends CMISServiceException
-{
- private static final long serialVersionUID = -3036139369370574358L;
-
- public CMISContentAlreadyExistsException()
- {
- super("Content already exists", "contentAlreadyExists", 409);
- }
-
- public CMISContentAlreadyExistsException(Throwable cause)
- {
- super("Content already exists", cause, "contentAlreadyExists", 409);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISContentStreamAllowedEnum.java b/source/java/org/alfresco/cmis/CMISContentStreamAllowedEnum.java
deleted file mode 100644
index 538a300b92..0000000000
--- a/source/java/org/alfresco/cmis/CMISContentStreamAllowedEnum.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Content Stream Allowed Enum
- *
- * @author andyh
- */
-public enum CMISContentStreamAllowedEnum implements EnumLabel
-{
- NOT_ALLOWED("notallowed"),
- ALLOWED("allowed"),
- REQUIRED("required");
-
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISContentStreamAllowedEnum(String label)
- {
- this.label = label;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISContentStreamAllowedEnum.class, null, true);
-}
diff --git a/source/java/org/alfresco/cmis/CMISDataTypeEnum.java b/source/java/org/alfresco/cmis/CMISDataTypeEnum.java
deleted file mode 100644
index 765e70a385..0000000000
--- a/source/java/org/alfresco/cmis/CMISDataTypeEnum.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
-import org.alfresco.service.namespace.QName;
-
-/**
- * CMIS Property Types Enum
- *
- * @author andyh
- */
-public enum CMISDataTypeEnum implements EnumLabel
-{
- STRING("string")
- {
- public QName getDefaultDataType()
- {
- return DataTypeDefinition.TEXT;
- }
- },
- DECIMAL("decimal")
- {
- public QName getDefaultDataType()
- {
- return DataTypeDefinition.DOUBLE;
- }
- },
- INTEGER("integer")
- {
- public QName getDefaultDataType()
- {
- return DataTypeDefinition.LONG;
- }
- },
- BOOLEAN("boolean")
- {
- public QName getDefaultDataType()
- {
- return DataTypeDefinition.BOOLEAN;
- }
- },
- DATETIME("datetime")
- {
- public QName getDefaultDataType()
- {
- return DataTypeDefinition.DATETIME;
- }
- },
- URI("uri")
- {
- public QName getDefaultDataType()
- {
- return DataTypeDefinition.TEXT;
- }
- },
- ID("id")
- {
- public QName getDefaultDataType()
- {
- return DataTypeDefinition.TEXT;
- }
- },
- HTML("html")
- {
- public QName getDefaultDataType()
- {
- return DataTypeDefinition.TEXT;
- }
- };
-
- public abstract QName getDefaultDataType();
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISDataTypeEnum(String label)
- {
- this.label = label;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISDataTypeEnum.class, null, true);
-}
diff --git a/source/java/org/alfresco/cmis/CMISDictionaryModel.java b/source/java/org/alfresco/cmis/CMISDictionaryModel.java
deleted file mode 100644
index 61fea4dc54..0000000000
--- a/source/java/org/alfresco/cmis/CMISDictionaryModel.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.model.ContentModel;
-
-/**
- * CMIS <-> Alfresco mappings
- *
- * @author andyh
- */
-public interface CMISDictionaryModel
-{
- // CMIS Type Ids
- public static CMISTypeId DOCUMENT_TYPE_ID = new CMISTypeId(CMISScope.DOCUMENT, CMISMapping.DOCUMENT_QNAME, CMISMapping.CMIS_MODEL_NS + ":" + CMISMapping.DOCUMENT_QNAME.getLocalName(), ContentModel.TYPE_CONTENT);
- public static CMISTypeId FOLDER_TYPE_ID = new CMISTypeId(CMISScope.FOLDER, CMISMapping.FOLDER_QNAME, CMISMapping.CMIS_MODEL_NS + ":" + CMISMapping.FOLDER_QNAME.getLocalName(), ContentModel.TYPE_FOLDER);
- public static CMISTypeId RELATIONSHIP_TYPE_ID = new CMISTypeId(CMISScope.RELATIONSHIP, CMISMapping.RELATIONSHIP_QNAME, CMISMapping.CMIS_MODEL_NS + ":" + CMISMapping.RELATIONSHIP_QNAME.getLocalName(), CMISMapping.RELATIONSHIP_QNAME);
- public static CMISTypeId POLICY_TYPE_ID = new CMISTypeId(CMISScope.POLICY, CMISMapping.POLICY_QNAME, CMISMapping.CMIS_MODEL_NS + ":" + CMISMapping.POLICY_QNAME.getLocalName(), CMISMapping.POLICY_QNAME);
-
- // CMIS properties
- public static String PROP_OBJECT_ID = "cmis:objectId";
- public static String PROP_BASE_TYPE_ID = "cmis:baseTypeId";
- public static String PROP_OBJECT_TYPE_ID = "cmis:objectTypeId";
- public static String PROP_CREATED_BY = "cmis:createdBy";
- public static String PROP_CREATION_DATE = "cmis:creationDate";
- public static String PROP_LAST_MODIFIED_BY = "cmis:lastModifiedBy";
- public static String PROP_LAST_MODIFICATION_DATE = "cmis:lastModificationDate";
- public static String PROP_CHANGE_TOKEN = "cmis:changeToken";
- public static String PROP_NAME = "cmis:name";
- public static String PROP_IS_IMMUTABLE = "cmis:isImmutable";
- public static String PROP_IS_LATEST_VERSION = "cmis:isLatestVersion";
- public static String PROP_IS_MAJOR_VERSION = "cmis:isMajorVersion";
- public static String PROP_IS_LATEST_MAJOR_VERSION = "cmis:isLatestMajorVersion";
- public static String PROP_VERSION_LABEL = "cmis:versionLabel";
- public static String PROP_VERSION_SERIES_ID = "cmis:versionSeriesId";
- public static String PROP_IS_VERSION_SERIES_CHECKED_OUT = "cmis:isVersionSeriesCheckedOut";
- public static String PROP_VERSION_SERIES_CHECKED_OUT_BY = "cmis:versionSeriesCheckedOutBy";
- public static String PROP_VERSION_SERIES_CHECKED_OUT_ID = "cmis:versionSeriesCheckedOutId";
- public static String PROP_CHECKIN_COMMENT = "cmis:checkinComment";
- public static String PROP_CONTENT_STREAM_LENGTH = "cmis:contentStreamLength";
- public static String PROP_CONTENT_STREAM_MIME_TYPE = "cmis:contentStreamMimeType";
- public static String PROP_CONTENT_STREAM_FILENAME = "cmis:contentStreamFileName";
- public static String PROP_CONTENT_STREAM_ID = "cmis:contentStreamId";
- public static String PROP_PARENT_ID = "cmis:parentId";
- public static String PROP_PATH = "cmis:path";
- public static String PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS = "cmis:allowedChildObjectTypeIds";
- public static String PROP_SOURCE_ID = "cmis:sourceId";
- public static String PROP_TARGET_ID = "cmis:targetId";
- public static String PROP_POLICY_TEXT = "cmis:policyText";
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISDictionaryService.java b/source/java/org/alfresco/cmis/CMISDictionaryService.java
deleted file mode 100644
index ca5f98948d..0000000000
--- a/source/java/org/alfresco/cmis/CMISDictionaryService.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.Collection;
-
-import org.alfresco.service.namespace.QName;
-
-/**
- * Service to query the CMIS meta model
- *
- * @author davidc
- */
-public interface CMISDictionaryService
-{
- /**
- * Find type for type id
- * @param typeId
- * @return
- */
- public CMISTypeDefinition findType(CMISTypeId typeId);
-
- /**
- * Find type for type id
- *
- * @param typeId
- * @return
- */
- public CMISTypeDefinition findType(String typeId);
-
- /**
- * Find type for Alfresco class name. Optionally, constrain match to one of specified CMIS scopes
- *
- * @param clazz
- * @param matchingScopes
- * @return
- */
- public CMISTypeDefinition findTypeForClass(QName clazz, CMISScope... matchingScopes);
-
- /**
- * Find a type by its query name
- *
- * @param queryName
- * @return
- */
- public CMISTypeDefinition findTypeByQueryName(String queryName);
-
- /**
- * Find a property by its query name
- *
- * @param queryName
- * @return
- */
- public CMISPropertyDefinition findPropertyByQueryName(String queryName);
-
- /**
- * Get Base Types
- */
- public Collection getBaseTypes();
-
- /**
- * Get all Types
- *
- * @return
- */
- public Collection getAllTypes();
-
- /**
- * Find property. Optionally constrain match to specified type.
- *
- * @param property
- * @param matchingType
- * @return
- */
- public CMISPropertyDefinition findProperty(QName property, CMISTypeDefinition matchingType);
-
- /**
- * Find property. Optionally constrain match to specified type.
- *
- * @param property
- * @param matchingType
- * @return
- */
- public CMISPropertyDefinition findProperty(String property, CMISTypeDefinition matchingType);
-
- /**
- * Find data type
- *
- * @param dataType
- * @return
- */
- public CMISDataTypeEnum findDataType(QName dataType);
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISFilterNotValidException.java b/source/java/org/alfresco/cmis/CMISFilterNotValidException.java
deleted file mode 100644
index f4f63d6d7c..0000000000
--- a/source/java/org/alfresco/cmis/CMISFilterNotValidException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISFilterNotValidException extends CMISServiceException
-{
- private static final long serialVersionUID = -1947056142715192667L;
-
- public CMISFilterNotValidException(String filter)
- {
- super("Filter not valid: " + filter, "filterNotValid", 400);
- }
-
- public CMISFilterNotValidException(String filter, Throwable cause)
- {
- super("Filter not valid: " + filter, cause, "filterNotValid", 400);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISInvalidArgumentException.java b/source/java/org/alfresco/cmis/CMISInvalidArgumentException.java
deleted file mode 100644
index a95ff20e48..0000000000
--- a/source/java/org/alfresco/cmis/CMISInvalidArgumentException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISInvalidArgumentException extends CMISServiceException
-{
- private static final long serialVersionUID = -3036139369370574358L;
-
- public CMISInvalidArgumentException(String message)
- {
- super(message, "invalidArgument", 400);
- }
-
- public CMISInvalidArgumentException(Throwable cause)
- {
- super(cause, "invalidArgument", 400);
- }
-
- public CMISInvalidArgumentException(String message, Throwable cause)
- {
- super(message, cause, "invalidArgument", 400);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISJoinEnum.java b/source/java/org/alfresco/cmis/CMISJoinEnum.java
deleted file mode 100644
index dff61415fe..0000000000
--- a/source/java/org/alfresco/cmis/CMISJoinEnum.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Join Enum
- *
- * @author andyh
- */
-public enum CMISJoinEnum implements EnumLabel
-{
- NO_JOIN_SUPPORT("none"),
- INNER_JOIN_SUPPORT("inneronly"),
- INNER_AND_OUTER_JOIN_SUPPORT("innerandouter");
-
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISJoinEnum(String label)
- {
- this.label = label;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISJoinEnum.class, null, true);
-}
diff --git a/source/java/org/alfresco/cmis/CMISNotSupportedException.java b/source/java/org/alfresco/cmis/CMISNotSupportedException.java
deleted file mode 100644
index bdf3b4393a..0000000000
--- a/source/java/org/alfresco/cmis/CMISNotSupportedException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISNotSupportedException extends CMISServiceException
-{
- private static final long serialVersionUID = 3550854898281486115L;
-
- public CMISNotSupportedException(String message)
- {
- super(message, "notSupported", 405);
- }
-
- public CMISNotSupportedException(Throwable cause)
- {
- super(cause, "notSupported", 405);
- }
-
- public CMISNotSupportedException(String message, Throwable cause)
- {
- super(message, cause, "notSupported", 405);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISObjectNotFoundException.java b/source/java/org/alfresco/cmis/CMISObjectNotFoundException.java
deleted file mode 100644
index f89a5ff04f..0000000000
--- a/source/java/org/alfresco/cmis/CMISObjectNotFoundException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISObjectNotFoundException extends CMISServiceException
-{
- private static final long serialVersionUID = 1726826685938651586L;
-
- public CMISObjectNotFoundException(String message)
- {
- super(message, "objectNotFound", 404);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISObjectReference.java b/source/java/org/alfresco/cmis/CMISObjectReference.java
deleted file mode 100644
index 8a165bb8d1..0000000000
--- a/source/java/org/alfresco/cmis/CMISObjectReference.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * CMIS Object Reference (mapping to Node Ref)
- *
- * @author davidc
- */
-public interface CMISObjectReference
-{
- /**
- * @return repository reference
- */
- public CMISRepositoryReference getRepositoryReference();
-
- /**
- * @return node reference
- */
- public NodeRef getNodeRef();
-}
diff --git a/source/java/org/alfresco/cmis/CMISPermissionDefinition.java b/source/java/org/alfresco/cmis/CMISPermissionDefinition.java
deleted file mode 100644
index 2cae6858ea..0000000000
--- a/source/java/org/alfresco/cmis/CMISPermissionDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-/**
- * A permission definition
- *
- * @author andyh
- *
- */
-public interface CMISPermissionDefinition
-{
- /**
- * The unique permission string (used for assignment)
- * @return the permission.
- */
- public String getPermission();
-
- /**
- * An optional permission description.
- * If not set, this defaults to the permission.
- *
- * @return the optional description.
- */
- public String getDescription();
-}
diff --git a/source/java/org/alfresco/cmis/CMISPermissionDeniedException.java b/source/java/org/alfresco/cmis/CMISPermissionDeniedException.java
deleted file mode 100644
index 5a59a47eba..0000000000
--- a/source/java/org/alfresco/cmis/CMISPermissionDeniedException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISPermissionDeniedException extends CMISServiceException
-{
- private static final long serialVersionUID = 5483026490801996479L;
-
- public CMISPermissionDeniedException(String message)
- {
- super(message, "permissionDenied", 403);
- }
-
- public CMISPermissionDeniedException(Throwable cause)
- {
- super(cause, "permissionDenied", 403);
- }
-
- public CMISPermissionDeniedException(String message, Throwable cause)
- {
- super(message, cause, "permissionDenied", 403);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISPermissionMapping.java b/source/java/org/alfresco/cmis/CMISPermissionMapping.java
deleted file mode 100644
index 440f623474..0000000000
--- a/source/java/org/alfresco/cmis/CMISPermissionMapping.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.List;
-
-/**
- * A CMIS permission mapping.
- *
- * @author andyh
- *
- */
-public interface CMISPermissionMapping
-{
- /**
- * Get the allowed action key.
- * @return the key.
- */
- public String getKey();
-
- /**
- * Get the required permissions.
- * If the list is of zero length the action is unprotected and allowed.
- * (Disallowed actions never appear at all)
- * For one or more entries a match against any permission allws.
- *
- * @return the list of required permissions.
- */
- public List getPermissions();
-}
diff --git a/source/java/org/alfresco/cmis/CMISPropertyAccessor.java b/source/java/org/alfresco/cmis/CMISPropertyAccessor.java
deleted file mode 100644
index 9437fa1594..0000000000
--- a/source/java/org/alfresco/cmis/CMISPropertyAccessor.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.io.Serializable;
-
-import org.alfresco.service.cmr.repository.AssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.namespace.QName;
-
-/**
- * CMIS Property Accessor (get and set property values)
- *
- * @author davidc
- */
-public interface CMISPropertyAccessor
-{
- /**
- * Get the CMIS Property Name
- *
- * @return
- */
- String getName();
-
- /**
- * Get the (directly) mapped Alfresco property (if a direct mapping exists)
- *
- * @return
- */
- QName getMappedProperty();
-
- /**
- * Get the property value for a node or an association
- *
- * @param nodeRef
- * @return
- */
- public Serializable getValue(NodeRef nodeRef);
-
- /**
- * Set the property value for a node
- *
- * @param nodeRef
- * @Param value
- */
- void setValue(NodeRef nodeRef, Serializable value);
-
- /**
- * Get the property value for an association
- *
- * @param nodeRef
- * @return
- */
- public Serializable getValue(AssociationRef assocRef);
-}
diff --git a/source/java/org/alfresco/cmis/CMISPropertyDefinition.java b/source/java/org/alfresco/cmis/CMISPropertyDefinition.java
deleted file mode 100644
index 0b897aeec0..0000000000
--- a/source/java/org/alfresco/cmis/CMISPropertyDefinition.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.Collection;
-
-import org.alfresco.opencmis.dictionary.CMISPropertyLuceneBuilder;
-
-/**
- * CMIS Property Definition
- *
- * @author andyh
- */
-public interface CMISPropertyDefinition
-{
- /**
- * Get Property Id
- *
- * @return
- */
- public CMISPropertyId getPropertyId();
-
- /**
- * Get Owning Type
- *
- * @return
- */
- public CMISTypeDefinition getOwningType();
-
- /**
- * Get the query name
- *
- * @return
- */
- public String getQueryName();
-
- /**
- * Get the display name
- *
- * @return
- */
- public String getDisplayName();
-
- /**
- * Get the description
- *
- * @return
- */
- public String getDescription();
-
- /**
- * Get the property type
- *
- * @return
- */
- public CMISDataTypeEnum getDataType();
-
- /**
- * Get the cardinality
- *
- * @return
- */
- public CMISCardinalityEnum getCardinality();
-
- /**
- * Get the choices available as values for this property TODO: not
- * implemented yet
- *
- * @return
- */
- public Collection getChoices();
-
- /**
- * Is this a choice where a user can enter other values (ie a list with
- * common options)
- *
- * @return
- */
- public boolean isOpenChoice();
-
- /**
- * Is this property required?
- *
- * @return
- */
- public boolean isRequired();
-
- /**
- * get the default value as a String
- *
- * @return
- */
- public String getDefaultValue();
-
- /**
- * Is this property updatable?
- *
- * @return
- */
- public CMISUpdatabilityEnum getUpdatability();
-
- /**
- * Is this property queryable?
- *
- * @return
- */
- public boolean isQueryable();
-
- /**
- * Is this property orderable in queries?
- *
- * @return
- */
- public boolean isOrderable();
-
- /**
- * For variable length properties, get the maximum length allowed.
- *
- * @return
- */
- public int getMaximumLength();
-
- /**
- * For Integer and Decimal properties, get the minimum value allowed
- *
- * @return
- */
- public Double getMinValue();
-
- /**
- * For Integer and Decimal properties, get the maximum value allowed
- *
- * @return
- */
- public Double getMaxValue();
-
- /**
- * Gets the property accessor (for reading / writing values)
- *
- * @return
- */
- public CMISPropertyAccessor getPropertyAccessor();
-
- /**
- * Gets the property Lucene builder
- *
- * @return
- */
- public CMISPropertyLuceneBuilder getPropertyLuceneBuilder();
-}
diff --git a/source/java/org/alfresco/cmis/CMISPropertyId.java b/source/java/org/alfresco/cmis/CMISPropertyId.java
deleted file mode 100644
index ea83965b62..0000000000
--- a/source/java/org/alfresco/cmis/CMISPropertyId.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.io.Serializable;
-
-import org.alfresco.service.namespace.QName;
-
-
-/**
- * CMIS Property Id
- *
- * @author davidc
- */
-public class CMISPropertyId implements Serializable
-{
- private static final long serialVersionUID = 4094778633095367606L;
-
- // Id properties
- private QName propertyQName;
- private String propertyId;
-
-
- /**
- * Construct
- *
- * @param propertyName
- * @param propertyId
- * @param internalQName
- */
- public CMISPropertyId(QName propertyQName, String propertyId)
- {
- this.propertyQName = propertyQName;
- this.propertyId = propertyId;
- }
-
- /**
- * Get property id
- *
- * @return
- */
- public String getId()
- {
- return propertyId;
- }
-
- /**
- * Get property local name
- * @return
- */
- public String getLocalName()
- {
- return propertyQName.getLocalName();
- }
-
- /**
- * Get property local namespace
- * @return
- */
- public String getLocalNamespace()
- {
- return propertyQName.getNamespaceURI();
- }
-
- /**
- * Get the Alfresco model QName associated with the property
- *
- * @return alfresco QName
- */
- public QName getQName()
- {
- return propertyQName;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- return getId();
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((propertyQName == null) ? 0 : propertyQName.hashCode());
- return result;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final CMISPropertyId other = (CMISPropertyId) obj;
- if (propertyQName == null)
- {
- if (other.propertyQName != null)
- return false;
- }
- else if (!propertyQName.equals(other.propertyQName))
- return false;
- return true;
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISQueryEnum.java b/source/java/org/alfresco/cmis/CMISQueryEnum.java
deleted file mode 100644
index 4b5f423b26..0000000000
--- a/source/java/org/alfresco/cmis/CMISQueryEnum.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Join Enum
- *
- * @author andyh
- */
-public enum CMISQueryEnum implements EnumLabel
-{
- NONE("none"),
- METADATA_ONLY("metadataonly"),
- FULLTEXT_ONLY("fulltextonly"),
- BOTH_SEPERATE("bothseparate"),
- BOTH_COMBINED("bothcombined");
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISQueryEnum(String label)
- {
- this.label = label;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISQueryEnum.class, null, true);
-}
diff --git a/source/java/org/alfresco/cmis/CMISQueryException.java b/source/java/org/alfresco/cmis/CMISQueryException.java
deleted file mode 100644
index 6d6b969e00..0000000000
--- a/source/java/org/alfresco/cmis/CMISQueryException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.error.AlfrescoRuntimeException;
-
-
-/**
- * @author andyh
- *
- */
-public class CMISQueryException extends AlfrescoRuntimeException
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 8281715613061152219L;
-
- /**
- * @param msgId
- */
- public CMISQueryException(String msgId)
- {
- super(msgId);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param msgId
- * @param msgParams
- */
- public CMISQueryException(String msgId, Object[] msgParams)
- {
- super(msgId, msgParams);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param msgId
- * @param cause
- */
- public CMISQueryException(String msgId, Throwable cause)
- {
- super(msgId, cause);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param msgId
- * @param msgParams
- * @param cause
- */
- public CMISQueryException(String msgId, Object[] msgParams, Throwable cause)
- {
- super(msgId, msgParams, cause);
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISQueryOptions.java b/source/java/org/alfresco/cmis/CMISQueryOptions.java
deleted file mode 100644
index 3c409a0166..0000000000
--- a/source/java/org/alfresco/cmis/CMISQueryOptions.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.Locale;
-
-import org.alfresco.repo.search.impl.querymodel.QueryOptions;
-import org.alfresco.service.cmr.repository.StoreRef;
-import org.alfresco.service.cmr.search.LimitBy;
-import org.alfresco.service.cmr.search.QueryParameterDefinition;
-import org.alfresco.service.cmr.search.SearchParameters;
-import org.alfresco.service.cmr.search.SearchService;
-import org.springframework.extensions.surf.util.I18NUtil;
-
-/**
- * The options for a CMIS query
- *
- * @author andyh
- */
-public class CMISQueryOptions extends QueryOptions
-{
- public enum CMISQueryMode
- {
- CMS_STRICT, CMS_WITH_ALFRESCO_EXTENSIONS ;
- }
-
-
- private CMISQueryMode queryMode = CMISQueryMode.CMS_STRICT;
-
-
- public static CMISQueryOptions create(SearchParameters searchParameters)
- {
- String sql = searchParameters.getQuery();
-
- CMISQueryOptions options = new CMISQueryOptions(sql, searchParameters.getStores().get(0));
- options.setIncludeInTransactionData(!searchParameters.excludeDataInTheCurrentTransaction());
- options.setDefaultFTSConnective(searchParameters.getDefaultOperator() == SearchParameters.Operator.OR ? Connective.OR : Connective.AND);
- options.setDefaultFTSFieldConnective(searchParameters.getDefaultOperator() == SearchParameters.Operator.OR ? Connective.OR : Connective.AND);
- options.setSkipCount(searchParameters.getSkipCount());
- options.setMaxPermissionChecks(searchParameters.getMaxPermissionChecks());
- options.setMaxPermissionCheckTimeMillis(searchParameters.getMaxPermissionCheckTimeMillis());
- if (searchParameters.getLimitBy() == LimitBy.FINAL_SIZE)
- {
- options.setMaxItems(searchParameters.getLimit());
- }
- else
- {
- options.setMaxItems(searchParameters.getMaxItems());
- }
- options.setMlAnalaysisMode(searchParameters.getMlAnalaysisMode());
- options.setLocales(searchParameters.getLocales());
- options.setStores(searchParameters.getStores());
- options.setUseInMemorySort(searchParameters.getUseInMemorySort());
- options.setMaxRawResultSetSizeForInMemorySort(searchParameters.getMaxRawResultSetSizeForInMemorySort());
- //options.setQuery(); Done on conbstruction
- //options.setQueryMode(); Should set afterwards
- options.setQueryParameterDefinitions(searchParameters.getQueryParameterDefinitions());
- options.setDefaultFieldName(searchParameters.getDefaultFieldName());
- options.setBulkFetchEnabled(searchParameters.isBulkFetchEnabled());
- options.setExcludeTenantFilter(searchParameters.getExcludeTenantFilter());
- options.setSinceTxId(searchParameters.getSinceTxId());
- return options;
- }
- /**
- * Create a CMISQueryOptions instance with the default options other than the query and store ref.
- * The query will be run using the locale returned by I18NUtil.getLocale()
- *
- * @param query - the query to run
- * @param storeRef - the store against which to run the query
- */
- public CMISQueryOptions(String query, StoreRef storeRef)
- {
- this(query, storeRef, I18NUtil.getLocale());
- }
-
- /**
- * Create a CMISQueryOptions instance with the default options other than the query, store ref and locale.
- *
- * @param query - the query to run
- * @param storeRef - the store against which to run the query
- */
- public CMISQueryOptions(String query, StoreRef storeRef, Locale locale)
- {
- super(query, storeRef, locale);
- }
-
-
-
-
- /**
- * Get the query mode.
- *
- * @return the queryMode
- */
- public CMISQueryMode getQueryMode()
- {
- return queryMode;
- }
-
- /**
- * Set the query mode.
- *
- * @param queryMode the queryMode to set
- */
- public void setQueryMode(CMISQueryMode queryMode)
- {
- this.queryMode = queryMode;
- }
- /**
- * @return
- */
- public SearchParameters getAsSearchParmeters()
- {
- SearchParameters searchParameters = new SearchParameters();
- searchParameters.setDefaultFieldName(this.getDefaultFieldName());
- searchParameters.setDefaultFTSFieldConnective(this.getDefaultFTSFieldConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
- searchParameters.setDefaultFTSOperator(this.getDefaultFTSConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
- searchParameters.setDefaultOperator(this.getDefaultFTSConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
- searchParameters.setLanguage(SearchService.LANGUAGE_CMIS_ALFRESCO);
- if(this.getMaxItems() > 0)
- {
- searchParameters.setLimit(this.getMaxItems());
- searchParameters.setLimitBy(LimitBy.FINAL_SIZE);
- searchParameters.setMaxItems(this.getMaxItems());
- }
- searchParameters.setMaxPermissionChecks(this.getMaxPermissionChecks());
- searchParameters.setMaxPermissionCheckTimeMillis(this.getMaxPermissionCheckTimeMillis());
- searchParameters.setMlAnalaysisMode(this.getMlAnalaysisMode());
- //searchParameters.setNamespace() TODO: Fix
- //searchParameters.setPermissionEvaluation()
- searchParameters.setQuery(this.getQuery());
- searchParameters.setSkipCount(this.getSkipCount());
- //searchParameters.addAllAttribute()
- for(Locale locale : this.getLocales())
- {
- searchParameters.addLocale(locale);
- }
- for(QueryParameterDefinition queryParameterDefinition: this.getQueryParameterDefinitions())
- {
- searchParameters.addQueryParameterDefinition(queryParameterDefinition);
- }
- //searchParameters.addQueryTemplate(name, template)
- //searchParameters.addSort()
- for(StoreRef storeRef : this.getStores())
- {
- searchParameters.addStore(storeRef);
- }
- //searchParameters.addTextAttribute()
- searchParameters.setBulkFetchEnabled(isBulkFetchEnabled());
- searchParameters.setQueryConsistency(this.getQueryConsistency());
- return searchParameters;
- }
-}
-
-
diff --git a/source/java/org/alfresco/cmis/CMISQueryService.java b/source/java/org/alfresco/cmis/CMISQueryService.java
deleted file mode 100644
index 4cea3eb5f9..0000000000
--- a/source/java/org/alfresco/cmis/CMISQueryService.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-
-/**
- * Support to execute CMIS queries
- *
- * @author andyh
- *
- */
-public interface CMISQueryService
-{
- /**
- * Execute a CMIS query as defined by options
- *
- * @param options
- * @return a result set
- */
- public CMISResultSet query(CMISQueryOptions options);
-
- /**
- * Execute a CMIS query with all the default options;
- *
- * @param query
- * @return
- */
- public CMISResultSet query(String query);
-
-
- /**
- * Get the query support level
- */
- public CMISQueryEnum getQuerySupport();
-
- /**
- * Get the join support level in queries.
- */
- public CMISJoinEnum getJoinSupport();
-
- /**
- * Can you query Private Working Copies of a document.
- *
- * @return
- */
- public boolean getPwcSearchable();
-
- /**
- * Can you query non-latest versions of a document.
- * The current latest version is always searchable according to the type definition.
- *
- * @return
- */
- public boolean getAllVersionsSearchable();
-}
diff --git a/source/java/org/alfresco/cmis/CMISRelationshipDirectionEnum.java b/source/java/org/alfresco/cmis/CMISRelationshipDirectionEnum.java
deleted file mode 100644
index a6d09d331e..0000000000
--- a/source/java/org/alfresco/cmis/CMISRelationshipDirectionEnum.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Types Filter Enum
- *
- * @author davidc
- */
-public enum CMISRelationshipDirectionEnum implements EnumLabel
-{
- SOURCE("source"),
- TARGET("target"),
- EITHER("either");
-
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISRelationshipDirectionEnum(String label)
- {
- this.label = label;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISRelationshipDirectionEnum.class, SOURCE);
-}
\ No newline at end of file
diff --git a/source/java/org/alfresco/cmis/CMISRelationshipReference.java b/source/java/org/alfresco/cmis/CMISRelationshipReference.java
deleted file mode 100644
index 66e6e1042f..0000000000
--- a/source/java/org/alfresco/cmis/CMISRelationshipReference.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.repository.AssociationRef;
-
-
-/**
- * CMIS Relationship Reference (mapping to Association Ref)
- *
- * @author davidc
- */
-public interface CMISRelationshipReference
-{
- /**
- * @return repository reference
- */
- public CMISRepositoryReference getRepositoryReference();
-
- /**
- * @return association reference
- */
- public AssociationRef getAssocRef();
-}
diff --git a/source/java/org/alfresco/cmis/CMISRendition.java b/source/java/org/alfresco/cmis/CMISRendition.java
deleted file mode 100644
index f1565a0f08..0000000000
--- a/source/java/org/alfresco/cmis/CMISRendition.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * CMIS Document Rendition
- *
- * @author Stas Sokolovsky
- */
-public interface CMISRendition
-{
- /**
- * Gets the thumbnail node reference
- */
- public NodeRef getNodeRef();
-
- /**
- * Get the rendition stream id
- * @return
- */
- public String getStreamId();
-
- /**
- * Get the MIME type of the rendition stream.
- * @return
- */
- public String getMimeType();
-
- /**
- * Get rendition kind.
- * @return
- */
- public String getKind();
-
- /**
- * Get the height of image. Typically used for ‘image’ renditions (expressed as pixels).
- * @return
- */
- public Integer getHeight();
-
- /**
- * Get the width of image. Typically used for ‘image’ renditions (expressed as pixels).
- * @return
- */
- public Integer getWidth();
-
- /**
- * Get a human readable information about the rendition.
- * @return
- */
- public String getTitle();
-
- /**
- * Get the length of the rendition stream in bytes.
- * @return
- */
- public Integer getLength();
-
- /**
- * Get the rendition document id. If specified, then the rendition can also be accessed
- * as a document object in the CMIS services.
- * @return
- */
- public String getRenditionDocumentId();
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISRenditionService.java b/source/java/org/alfresco/cmis/CMISRenditionService.java
deleted file mode 100644
index 084f57848a..0000000000
--- a/source/java/org/alfresco/cmis/CMISRenditionService.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.List;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * Service to retrieving renditions of document
- *
- * @author Stas Sokolovsky
- */
-public interface CMISRenditionService
-{
- /**
- * Get renditions for a document.
- *
- * @param node node reference of document
- * @param renditionFilter renditions filter
- * @return list of renditions
- * @throws CMISFilterNotValidException
- */
- public List getRenditions(NodeRef node, String renditionFilter) throws CMISFilterNotValidException;
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISRepositoryReference.java b/source/java/org/alfresco/cmis/CMISRepositoryReference.java
deleted file mode 100644
index 33ab800479..0000000000
--- a/source/java/org/alfresco/cmis/CMISRepositoryReference.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.repository.StoreRef;
-
-
-/**
- * CMIS Repository Reference (mapping to Store Ref)
- *
- * @author davidc
- */
-public interface CMISRepositoryReference
-{
- /**
- * @return store reference
- */
- public abstract StoreRef getStoreRef();
-}
diff --git a/source/java/org/alfresco/cmis/CMISResultSet.java b/source/java/org/alfresco/cmis/CMISResultSet.java
deleted file mode 100644
index 71bf8c9b1e..0000000000
--- a/source/java/org/alfresco/cmis/CMISResultSet.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.search.ResultSetSPI;
-
-
-
-/**
- * A CMIS result set
- *
- * @author andyh
- */
-public interface CMISResultSet extends ResultSetSPI
-{
- /**
- * Get the result set meta-data.
- * @return the metadata
- */
- public CMISResultSetMetaData getMetaData();
-
-
- /**
- * Get the number of rows in this result set.
- *
- * This will be less than or equal to the maximum number of rows requested or
- * the full length if no restriction on length is specified.
- *
- * If a skip count is given, the length represents the number of results
- * after the skip count and does not include the items skipped.
- *
- * @return the length
- */
- public int getLength();
-
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISResultSetColumn.java b/source/java/org/alfresco/cmis/CMISResultSetColumn.java
deleted file mode 100644
index 512a881187..0000000000
--- a/source/java/org/alfresco/cmis/CMISResultSetColumn.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.search.ResultSetColumn;
-
-
-/**
- * The column meta data for a result set
- *
- * @author andyh
- *
- */
-public interface CMISResultSetColumn extends ResultSetColumn
-{
- /**
- * The property definition if there is one for the column
- * @return - the property definition or null if it does not make sense for the column
- */
- public CMISPropertyDefinition getCMISPropertyDefinition();
-
- /**
- * The type of the column
- * @return - the CMIS type for the column
- */
- public CMISDataTypeEnum getCMISDataType();
-}
diff --git a/source/java/org/alfresco/cmis/CMISResultSetMetaData.java b/source/java/org/alfresco/cmis/CMISResultSetMetaData.java
deleted file mode 100644
index 576be7363f..0000000000
--- a/source/java/org/alfresco/cmis/CMISResultSetMetaData.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.search.ResultSetMetaData;
-
-
-/**
- * The meta data associated with a result set
- *
- * @author andyh
- *
- */
-public interface CMISResultSetMetaData extends ResultSetMetaData
-{
- /**
- * The selector meta-data.
- * @return - the selector meta-data.
- */
- public CMISResultSetSelector[] getSelectors();
-
- /**
- * The column meta-data.
- * @return - the column meta-data.
- */
- public CMISResultSetColumn[] getColumns();
-
- /**
- * Get the query options used to create this result set
- * @return the query options
- */
- public CMISQueryOptions getQueryOptions();
-
- /**
- * Get the names of the selectors.
- * @return - the selector names.
- */
- public String[] getSelectorNames();
-
- /**
- * Get the column names.
- * @return - the names of the columns.
- */
- public String[] getColumnNames();
-
- /**
- * Get the selector meta-data by name.
- * @param name
- * @return - the selector meta-data.
- */
- public CMISResultSetSelector getSelector(String name);
-
- /**
- * Get the column meta-data by column name.
- * @param name
- * @return - the column meta-data.
- */
- public CMISResultSetColumn getColumn(String name);
-}
diff --git a/source/java/org/alfresco/cmis/CMISResultSetRow.java b/source/java/org/alfresco/cmis/CMISResultSetRow.java
deleted file mode 100644
index 76f1c99845..0000000000
--- a/source/java/org/alfresco/cmis/CMISResultSetRow.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.search.ResultSetRow;
-
-/**
- * A row in a CMISResultSet
- *
- * @author andyh
- *
- */
-public interface CMISResultSetRow extends ResultSetRow
-{
- /**
- * Get the result set for which this row is a member.
- * @return - the result set.
- */
- public CMISResultSet getCMISResultSet();
-}
diff --git a/source/java/org/alfresco/cmis/CMISResultSetSelector.java b/source/java/org/alfresco/cmis/CMISResultSetSelector.java
deleted file mode 100644
index ced0042d9c..0000000000
--- a/source/java/org/alfresco/cmis/CMISResultSetSelector.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.service.cmr.search.ResultSetSelector;
-
-
-/**
- * The meta-data for a result set selector.
- *
- * @author andyh
- *
- */
-public interface CMISResultSetSelector extends ResultSetSelector
-{
- /**
- * Get the type definition for the selector.
- * @return - the CMIS type definition.
- */
- public CMISTypeDefinition getTypeDefinition();
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISRuntimeException.java b/source/java/org/alfresco/cmis/CMISRuntimeException.java
deleted file mode 100644
index 37a502837b..0000000000
--- a/source/java/org/alfresco/cmis/CMISRuntimeException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISRuntimeException extends CMISServiceException
-{
- private static final long serialVersionUID = 18549812596930942L;
-
- public CMISRuntimeException(String message)
- {
- super(message, "runtime", 500);
- }
-
- public CMISRuntimeException(Throwable cause)
- {
- super(cause, "runtime", 500);
- }
-
- public CMISRuntimeException(String message, Throwable cause)
- {
- super(message, cause, "runtime", 500);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISScope.java b/source/java/org/alfresco/cmis/CMISScope.java
deleted file mode 100644
index c743f6870d..0000000000
--- a/source/java/org/alfresco/cmis/CMISScope.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-
-/**
- * The scope for a CMIS name
- *
- * Alfresco has different name spaces for relationships and objects.
- * This scope resolves any ambiguity.
- * This ambiguity is resolved in the CMIS type id mapping.
- *
- * @author andyh
- *
- */
-public enum CMISScope implements EnumLabel
-{
- OBJECT ("O"),
- RELATIONSHIP ("R"),
- DOCUMENT ("D"),
- FOLDER ("F"),
- POLICY ("P"),
- UNKNOWN ("U");
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISScope(String label)
- {
- this.label = label;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISScope.class);
-}
diff --git a/source/java/org/alfresco/cmis/CMISServiceException.java b/source/java/org/alfresco/cmis/CMISServiceException.java
deleted file mode 100644
index b37213ba66..0000000000
--- a/source/java/org/alfresco/cmis/CMISServiceException.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-/**
- * A base class for all exceptions that map to CMIS SOAP faults / HTTP error codes. Intentionally a checked
- * non-RuntimeException so that the faults codes are propagated and signalled correctly.
- *
- * @author dward
- */
-public abstract class CMISServiceException extends Exception
-{
- private static final long serialVersionUID = 8220732267294509499L;
-
- /** The fault name, as per the CMIS spec. */
- private final String faultName;
-
- /** The status code, as per the CMIS REST binding. */
- private final int statusCode;
-
- /**
- * Instantiates a new CMIS Service exception.
- *
- * @param message
- * the message
- * @param faultName
- * the fault name, as per the CMIS spec
- * @param statusCode
- * the status code, as per the CMIS REST binding
- */
- public CMISServiceException(String message, String faultName, int statusCode)
- {
- super(message);
- this.faultName = faultName;
- this.statusCode = statusCode;
- }
-
- /**
- * Instantiates a new CMIS Service exception.
- *
- * @param cause
- * the cause
- * @param faultName
- * the fault name, as per the CMIS spec
- * @param statusCode
- * the status code, as per the CMIS REST binding
- */
- public CMISServiceException(Throwable cause, String faultName, int errorCode)
- {
- this(cause.getMessage(), cause, faultName, errorCode);
- }
-
- /**
- * Instantiates a new CMIS Service exception.
- *
- * @param message
- * the message
- * @param cause
- * the cause
- * @param faultName
- * the fault name, as per the CMIS spec
- * @param statusCode
- * the status code, as per the CMIS REST binding
- */
- public CMISServiceException(String message, Throwable cause, String faultName, int errorCode)
- {
- super(message, cause);
- this.faultName = faultName;
- this.statusCode = errorCode;
- }
-
- /**
- * Gets the fault name.
- *
- * @return the fault name
- */
- public String getFaultName()
- {
- return faultName;
- }
-
- /**
- * Gets the status code.
- *
- * @return the status code
- */
- public int getStatusCode()
- {
- return this.statusCode;
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISServices.java b/source/java/org/alfresco/cmis/CMISServices.java
deleted file mode 100644
index 83a8c3947c..0000000000
--- a/source/java/org/alfresco/cmis/CMISServices.java
+++ /dev/null
@@ -1,893 +0,0 @@
-/*
- * Copyright (C) 2005-2011 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import java.math.BigInteger;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.alfresco.query.PagingResults;
-import org.alfresco.service.cmr.model.FileInfo;
-import org.alfresco.service.cmr.repository.AssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.StoreRef;
-import org.alfresco.service.namespace.QName;
-
-
-/**
- * CMIS Services.
- *
- * @author davidc
- * @author dward
- */
-public interface CMISServices
-{
- /**
- * The prefix we give to association object IDs.
- */
- public static final String ASSOC_ID_PREFIX = "assoc:";
-
- /**
- * Gets the supported CMIS Version
- *
- * @return version of CMIS specification supported
- */
- public String getCMISVersion();
-
- /**
- * Gets the supported CMIS Specification Title
- *
- * @return CMIS pecification Title
- */
- public String getCMISSpecTitle();
-
- /**
- * Gets the default root node path
- *
- * @return root node path
- */
- public String getDefaultRootPath();
-
- /**
- * Gets the default root node ref
- *
- * @return root node ref
- */
- public NodeRef getDefaultRootNodeRef();
-
- /**
- * Gets the default store ref
- *
- * @return store ref
- */
- public StoreRef getDefaultRootStoreRef();
-
- /**
- * Finds a NodeRef given a repository reference
- *
- * @param referenceType node, path
- * @param reference node => id, path => path
- * @return nodeRef (or null, if not found)
- */
- public NodeRef getNode(String referenceType, String[] reference);
-
- /**
- * Gets a map of node attributes relating to renditions.
- *
- * @param nodeRef
- * the node ref
- * @param renditionFilter
- * the rendition filter
- * @return the attribute map
- * @throws CMISFilterNotValidException
- * if the rendition filter is invalid
- */
- public Map getRenditions(NodeRef nodeRef, String renditionFilter)
- throws CMISFilterNotValidException;
-
- /**
- * Get node children
- *
- * @param parent
- * parent node
- * @param typesFilter
- * types filter
- * @param orderBy
- * comma-separated list of sort names and the ascending modifier "ASC" or the descending modifier "DESC"
- * for each sort name
- * @return children of node
- */
- public NodeRef[] getChildren(NodeRef parent, CMISTypesFilterEnum typesFilter, String orderBy)
- throws CMISInvalidArgumentException;
-
- /**
- * Get node children
- *
- * @param parent
- * parent node
- * @param typesFilter
- * types filter
- * @param maxItems
- * number of items (in page)
- * @param skipCount
- * number of items to skip (page starts at next item)
- * @param orderBy
- * comma-separated list of sort names and the ascending modifier "ASC" or the descending modifier "DESC"
- * for each sort name
- * @return children of node
- */
- public PagingResults getChildren(NodeRef parent, CMISTypesFilterEnum typesFilter, BigInteger maxItems, BigInteger skipCount, String orderBy)
- throws CMISInvalidArgumentException;
-
- /**
- * Query for checked out items
- *
- * @param username
- * for user
- * @param folder
- * (optional) within folder
- * @param includeDescendants
- * true => include descendants of folder, false => only children of folder
- * @param orderBy
- * comma-separated list of query names and the ascending modifier "ASC" or the descending modifier "DESC"
- * for each query name
- * @return checked out items
- */
- public NodeRef[] getCheckedOut(String username, NodeRef folder, boolean includeDescendants, String orderBy)
- throws CMISInvalidArgumentException;
-
- /**
- * Query for relationships.
- *
- * @param relDef
- * type of relationship to query (or null, for all relationships)
- * @param includeSubTypes
- * the include sub types
- * @param direction
- * limit direction of relationships to query (or null, for both directions)
- * @param node
- * the node
- * @return relationships
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public AssociationRef[] getRelationships(NodeRef node, CMISTypeDefinition relDef, boolean includeSubTypes, CMISRelationshipDirectionEnum direction) throws CMISInvalidArgumentException;
-
- /**
- * Get a single property belonging to the node's type.
- *
- * @param nodeRef
- * the node
- * @param propertyName
- * the property name
- * @return value
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public Serializable getProperty(NodeRef nodeRef, String propertyName) throws CMISInvalidArgumentException;
-
- /**
- * Get a single property, optionally constrained to a given node type or aspect
- *
- * @param nodeRef
- * the node
- * @param typeDef
- * the node type or aspect or null
if any property can be returned
- * @param propertyName
- * the property name
- * @return value
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public Serializable getProperty(NodeRef nodeRef, CMISTypeDefinition typeDef, String propertyName)
- throws CMISInvalidArgumentException;
-
- /**
- * Get a single property for an association.
- *
- * @param assocRef
- * the association
- * @param propertyName
- * the property name
- * @return value
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public Serializable getProperty(AssociationRef assocRef, String propertyName) throws CMISInvalidArgumentException;
-
- /**
- * Get all properties of a node's type.
- *
- * @param nodeRef
- * the node ref
- * @return the properties
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public Map getProperties(NodeRef nodeRef) throws CMISInvalidArgumentException;
-
- /**
- * Get all properties of an association's type.
- *
- * @param assocRef
- * the association
- * @return the properties
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public Map getProperties(AssociationRef assocRef) throws CMISInvalidArgumentException;
-
- /**
- * Get all of a node's values for the properties in the given type or aspect.
- *
- * @param nodeRef
- * the node ref
- * @param typeDef
- * the type or aspect definition
- * @return the properties
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public Map getProperties(NodeRef nodeRef, CMISTypeDefinition typeDef)
- throws CMISInvalidArgumentException;
-
- /**
- * Gets the aspects applied to a node.
- *
- * @param nodeRef
- * the node ref
- * @return the aspect definitions
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public Set getAspects(NodeRef nodeRef);
-
- /**
- * Set a single property belonging to the node's type.
- *
- * @param nodeRef
- * the node ref
- * @param propertyName
- * the property name
- * @param value
- * the value
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISConstraintException
- * if the property cannot be set
- */
- public void setProperty(NodeRef nodeRef, String propertyName, Serializable value)
- throws CMISInvalidArgumentException, CMISConstraintException;
-
- /**
- * Set a single property, optionally constrained to a given node type or aspect
- *
- * @param nodeRef
- * the node ref
- * @param typeDef
- * the node type or aspect or null
if any valid property should be set (corresponding aspect
- * added automatically).
- * @param propertyName
- * the property name
- * @param value
- * the value
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISConstraintException
- * if the property cannot be set
- */
- public void setProperty(NodeRef nodeRef, CMISTypeDefinition typeDef, String propertyName, Serializable value)
- throws CMISInvalidArgumentException, CMISConstraintException;
-
- /**
- * Sets the aspects on a node (Alfresco extension).
- *
- * @param node
- * the node
- * @param aspectsToRemove
- * the aspects to remove
- * @param aspectsToAdd
- * the aspects to add
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public void setAspects(NodeRef node, Iterable aspectsToRemove, Iterable aspectsToAdd)
- throws CMISInvalidArgumentException;
-
- /**
- * Applies a versioning state to a new node, potentially resulting in a new node.
- *
- * @param source
- * the node
- * @param versioningState
- * the versioning state
- * @return the node to write changes to
- * @throws CMISConstraintException
- * if it's not possible to apply the state
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public NodeRef applyVersioningState(NodeRef source, CMISVersioningStateEnum versioningState)
- throws CMISConstraintException, CMISInvalidArgumentException;
-
- /**
- * Gets a readable object of a required type from an object ID. The object may be immutable. Note that version
- * history nodes can be returned as Versions or Nodes.
- *
- * @param objectId
- * the object id
- * @param requiredType
- * the required type (NodeRef.class, Version.class, AssociationRef.class or Object.class)
- * @return the readable object
- * @throws CMISConstraintException
- * if the object can't be returned as the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public T getReadableObject(String objectId, Class requiredType) throws CMISConstraintException,
- CMISVersioningException, CMISObjectNotFoundException, CMISInvalidArgumentException,
- CMISPermissionDeniedException;
-
- /**
- * Gets an object or a required type from an object ID. The object's mutability and versioning state will be
- * validated as required.
- *
- * @param objectId
- * the object id
- * @param requiredType
- * the required type (NodeRef.class, Version.class, AssociationRef.class or Object.class)
- * @param forUpdate
- * Do we require to write to this object? If true
then the object must not be checked out
- * and must not be a version history node unless the required type is assignable from Version.class.
- * @param isVersionable
- * Should the object be versionable?
- * @param isPwc
- * If isVersionable is true
then the object should either be or not be a private working
- * copy, as indicated by this flag
- * @return the object
- * @throws CMISConstraintException
- * if the object can't be returned as the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public T getObject(String objectId, Class requiredType, boolean forUpdate, boolean isVersionable,
- boolean isPwc) throws CMISConstraintException, CMISVersioningException, CMISObjectNotFoundException,
- CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Gets the version series of an object.
- *
- * @param objectId
- * the object id
- * @param requiredType
- * the required type (NodeRef.class, Version.class or AssociationRef.class)
- * @param isVersionable
- * Should the object be versionable?
- * @return the version series
- * @throws CMISConstraintException
- * if the object can't be returned as the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public T getVersionSeries(String objectId, Class requiredType, boolean isVersionable)
- throws CMISConstraintException, CMISVersioningException, CMISObjectNotFoundException,
- CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Gets a folder from an object ID.
- *
- * @param objectId
- * the object id
- * @return the folder
- * @throws CMISConstraintException
- * if the object can't be returned as the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public NodeRef getFolder(String objectId) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Gets parent of a folder.
- *
- * @param folderId
- * the folder id
- * @return the folder parent
- * @throws CMISConstraintException
- * if the object can't be returned as the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public NodeRef getFolderParent(String folderId) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Gets the type definition for a node.
- *
- * @param nodeRef
- * the node
- * @return the type definition
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public CMISTypeDefinition getTypeDefinition(NodeRef nodeRef) throws CMISInvalidArgumentException;
-
- /**
- * Gets the type definition for an association.
- *
- * @param associationRef
- * the association
- * @return the type definition
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public CMISTypeDefinition getTypeDefinition(AssociationRef associationRef) throws CMISInvalidArgumentException;
-
- /**
- * Gets the type definition for a given type ID.
- *
- * @param typeId
- * the type id
- * @return the type definition
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public CMISTypeDefinition getTypeDefinition(String typeId) throws CMISInvalidArgumentException;
-
- /**
- * Gets the type definition for a given object.
- *
- * @param object
- * the object
- * @return the type definition
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- */
- public CMISTypeDefinition getTypeDefinition(Object object) throws CMISInvalidArgumentException;
-
- /**
- * Gets the CMIS base types.
- *
- * @return the base types
- */
- public Collection getBaseTypes();
-
- /**
- * Checks out an object.
- *
- * @param objectId
- * the object id
- * @return the resulting private working copy node
- * @throws CMISConstraintException
- * if the object isn't of the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public NodeRef checkOut(String objectId) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Checks in a private working copy.
- *
- * @param objectId
- * the object id of the private working copy
- * @param checkinComment
- * the checkin comment
- * @param isMajor
- * Is this a major version?
- * @return the checked in node
- * @throws CMISConstraintException
- * if the object isn't of the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public NodeRef checkIn(String objectId, String checkinComment, boolean isMajor) throws CMISConstraintException,
- CMISVersioningException, CMISObjectNotFoundException, CMISInvalidArgumentException,
- CMISPermissionDeniedException;
-
- /**
- * Cancels check out of a private working copy.
- *
- * @param objectId
- * the object id of the private working copy
- * @throws CMISConstraintException
- * if the object isn't of the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public void cancelCheckOut(String objectId) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Gets all versions of an object.
- *
- * @param objectId
- * the object id
- * @return the all versions
- * @throws CMISConstraintException
- * if the object isn't of the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public List getAllVersions(String objectId) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Gets the latest version of an object and optionally the latest major version.
- *
- * @param objectId
- * the object id
- * @param major
- * Should we return the latest major version?
- * @return the latest version
- * @throws CMISConstraintException
- * if the object isn't of the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public NodeRef getLatestVersion(String objectId, boolean major) throws CMISConstraintException,
- CMISVersioningException, CMISObjectNotFoundException, CMISInvalidArgumentException,
- CMISPermissionDeniedException;
-
- /**
- * Deletes a folder and its children, without raising any exceptions.
- *
- * @param objectId
- * the folder's object id
- * @param continueOnFailure
- * should we continue if an error occurs with one of the children?
- * @param unfile
- * should we remove non-primary associations to nodes rather than delete them?
- * @param deleteAllVersions
- * should we delete all the versions of the documents we delete?
- * @return list of object IDs of the children we failed to delete
- * @throws CMISConstraintException
- * if the object isn't of the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public List deleteTree(String objectId, boolean continueOnFailure, boolean unfile, boolean deleteAllVersions)
- throws CMISConstraintException, CMISVersioningException, CMISObjectNotFoundException,
- CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Deletes a folder and its children, raising an exception for the last error encountered.
- *
- * @param objectId
- * the folder's object id
- * @param continueOnFailure
- * should we continue if an error occurs with one of the children?
- * @param unfile
- * should we remove non-primary associations to nodes rather than delete them?
- * @param deleteAllVersions
- * should we delete all the versions of the nodes we delete?
- * @return list of object IDs of the children we failed to delete
- * @throws CMISServiceException
- * the last error encountered
- */
- public void deleteTreeReportLastError(String objectId, boolean continueOnFailure, boolean unfile,
- boolean deleteAllVersions) throws CMISServiceException;
-
- /**
- * Deletes a document's content stream.
- *
- * @param objectId
- * the object id of the document
- * @throws CMISConstraintException
- * if the object isn't of the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- */
- public void deleteContentStream(String objectId) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Deletes an object.
- *
- * @param objectId
- * the object id
- * @param allVersions
- * if the object is a document, should we delete all versions?
- * @throws CMISConstraintException
- * if the object isn't of the right type
- * @throws CMISVersioningException
- * if the object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if the object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to the object is denied
- * @throws CMISRuntimeException
- * on other exceptions
- */
- public void deleteObject(String objectId, boolean allVersions) throws CMISConstraintException,
- CMISVersioningException, CMISObjectNotFoundException, CMISInvalidArgumentException,
- CMISPermissionDeniedException, CMISRuntimeException, CMISServiceException;
-
- /**
- * Adds a secondary child association to an object from a folder.
- *
- * @param objectId
- * the object id
- * @param folderId
- * the folder id
- * @throws CMISConstraintException
- * if an object isn't of the right type
- * @throws CMISVersioningException
- * if an object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if an object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to an object is denied
- */
- public void addObjectToFolder(String objectId, String folderId) throws CMISConstraintException,
- CMISVersioningException, CMISObjectNotFoundException, CMISInvalidArgumentException,
- CMISPermissionDeniedException;
-
- /**
- * Removes a secondary child association to an object from a folder.
- *
- * @param objectId
- * the object id
- * @param folderId
- * the folder id
- * @throws CMISNotSupportedException
- * if the child association is primary
- * @throws CMISConstraintException
- * if an object isn't of the right type
- * @throws CMISVersioningException
- * if an object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if an object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to an object is denied
- */
- public void removeObjectFromFolder(String objectId, String folderId) throws CMISNotSupportedException,
- CMISConstraintException, CMISVersioningException, CMISObjectNotFoundException,
- CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Moves an object from one folder to another.
- *
- * @param objectId
- * the object id
- * @param targetFolderId
- * the target folder id
- * @param sourceFolderId
- * the source folder id
- * @throws CMISConstraintException
- * if an object isn't of the right type
- * @throws CMISVersioningException
- * if an object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if an object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to an object is denied
- */
- public void moveObject(String objectId, String targetFolderId, String sourceFolderId)
- throws CMISConstraintException, CMISVersioningException, CMISObjectNotFoundException,
- CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Sets the content stream on an object.
- *
- * @param objectId
- * the object id
- * @param propertyQName
- * the property q name
- * @param overwriteFlag
- * the overwrite flag
- * @param contentStream
- * the content stream
- * @param mimeType
- * the mime type
- * @return true
if content was overwritten
- * @throws CMISContentAlreadyExistsException
- * if overwrite was false
and content already existed
- * @throws CMISStreamNotSupportedException
- * if the object's type definition does not allow a content stream
- * @throws CMISConstraintException
- * if an object isn't of the right type
- * @throws CMISVersioningException
- * if an object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if an object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to an object is denied
- */
- public boolean setContentStream(String objectId, QName propertyQName, boolean overwriteFlag,
- InputStream contentStream, String mimeType) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISContentAlreadyExistsException, CMISStreamNotSupportedException,
- CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Creates a policy object of the specified type, and optionally adds the policy to a folder. Currently no policy
- * types can be created in Alfresco.
- *
- * @param properties
- * CMIS properties
- * @param folderId
- * parent folder for this new policy
- * @param policies
- * the policies
- * @return Id of the created policy object
- * @throws CMISConstraintException
- * if there is a problem with the supplied properties
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISRuntimeException
- * on other exceptions
- */
- public String createPolicy(Map properties, String folderId, List policies)
- throws CMISConstraintException, CMISRuntimeException, CMISInvalidArgumentException;
-
- /**
- * Applies a policy object to a target object.
- *
- * @param policyId
- * policy Id
- * @param objectId
- * target object Id
- * @throws CMISConstraintException
- * if an object isn't of the right type
- * @throws CMISVersioningException
- * if an object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if an object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to an object is denied
- */
- public void applyPolicy(String policyId, String objectId) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISInvalidArgumentException, CMISPermissionDeniedException;
-
- /**
- * Gets the list of policy objects currently applied to a target object.
- *
- * @param objectId
- * the object id
- * @param filter
- * property filter
- * @return the applied policies
- * @throws CMISConstraintException
- * if an object isn't of the right type
- * @throws CMISVersioningException
- * if an object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if an object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to an object is denied
- * @throws CMISFilterNotValidException
- * if the property filter is invalid
- */
- public List getAppliedPolicies(String objectId, String filter) throws CMISConstraintException,
- CMISVersioningException, CMISObjectNotFoundException, CMISInvalidArgumentException,
- CMISPermissionDeniedException, CMISFilterNotValidException;
-
- /**
- * Removes a previously applied policy from a target object. The policy object is not deleted, and may still be
- * applied to other objects.
- *
- * @param policyId
- * policy Id
- * @param objectId
- * target object Id.
- * @throws CMISConstraintException
- * if an object isn't of the right type
- * @throws CMISVersioningException
- * if an object's versioning state isn't as expected
- * @throws CMISObjectNotFoundException
- * if an object does not exist
- * @throws CMISInvalidArgumentException
- * if an argument is invalid
- * @throws CMISPermissionDeniedException
- * if access to an object is denied
- */
- public void removePolicy(String policyId, String objectId) throws CMISConstraintException, CMISVersioningException,
- CMISObjectNotFoundException, CMISInvalidArgumentException, CMISPermissionDeniedException;
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISStreamNotSupportedException.java b/source/java/org/alfresco/cmis/CMISStreamNotSupportedException.java
deleted file mode 100644
index 8952f3a148..0000000000
--- a/source/java/org/alfresco/cmis/CMISStreamNotSupportedException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-
-public class CMISStreamNotSupportedException extends CMISServiceException
-{
- private static final long serialVersionUID = -3036139369370574358L;
-
- public CMISStreamNotSupportedException(CMISTypeDefinition typeDefinition)
- {
- super("Stream not supported by type " + typeDefinition.getTypeId(), "streamNotSupported", 403);
- }
-
- public CMISStreamNotSupportedException(CMISTypeDefinition typeDefinition, Throwable cause)
- {
- super("Stream not supported by type " + typeDefinition.getTypeId(), cause, "streamNotSupported", 403);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISTypeDefinition.java b/source/java/org/alfresco/cmis/CMISTypeDefinition.java
deleted file mode 100644
index 659975d737..0000000000
--- a/source/java/org/alfresco/cmis/CMISTypeDefinition.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.Collection;
-import java.util.Map;
-
-
-/**
- * The base type definition for CMIS
- *
- * @author andyh
- */
-public interface CMISTypeDefinition
-{
- /**
- * @return true => type definition is for public consumption
- */
- public boolean isPublic();
-
- /**
- * Get the unique identifier for the type
- *
- * @return - the type id
- */
- public CMISTypeId getTypeId();
-
- /**
- * Get the table name used for queries against the type. This is also a unique identifier for the type. The string
- * conforms to SQL table naming conventions. TODO: Should we impose a maximum length and if so how do we avoid
- * collisions from truncations?
- *
- * @return the sql table name
- */
- public String getQueryName();
-
- /**
- * Get the display name for the type.
- *
- * @return - the display name
- */
- public String getDisplayName();
-
- /**
- * Get the type for the parent
- *
- * @return - the parent type id
- */
- public CMISTypeDefinition getParentType();
-
- /**
- * Get the sub-types
- *
- * @param descendants
- * @return
- */
- public Collection getSubTypes(boolean descendants);
-
- /**
- * Get the base type
- *
- * @return
- */
- public CMISTypeDefinition getBaseType();
-
- /**
- * Get the description for the type
- *
- * @return - the description
- */
- public String getDescription();
-
- /**
- * Can objects of this type be created?
- *
- * @return
- */
- public boolean isCreatable();
-
- /**
- * Are objects of this type fileable?
- *
- * @return
- */
- public boolean isFileable();
-
- /**
- * Is this type queryable? If not, the type may not appear in the FROM clause of a query. This property of the type
- * is not inherited in the type hierarchy. It is set on each type.
- *
- * @return true if queryable
- */
- public boolean isQueryable();
-
- /**
- * Is the type full text indexed for querying via CONTAINS()
- * @return
- */
- public boolean isFullTextIndexed();
-
- /**
- * Are objects of this type controllable via Policies.
- *
- * @return
- */
- public boolean isControllablePolicy();
-
- /**
- * Are objects of this type controllable via ACLs.
- *
- * @return
- */
- public boolean isControllableACL();
-
- /**
- * Are objects of this type included in super type queries
- *
- * @return
- */
- public boolean isIncludedInSuperTypeQuery();
-
- /**
- * Is this type versionable? If true this implies all instances of the type are versionable.
- *
- * @return true if versionable
- */
- public boolean isVersionable();
-
- /**
- * Is a content stream allowed for this type? It may be disallowed, optional or mandatory.
- *
- * @return
- */
- public CMISContentStreamAllowedEnum getContentStreamAllowed();
-
- /**
- * For an association, get the collection of valid source types. For non-associations the collection will be empty.
- *
- * @return
- */
- public Collection getAllowedSourceTypes();
-
- /**
- * For an association, get the collection of valid target types. For non-associations the collection will be empty.
- *
- * @return
- */
- public Collection getAllowedTargetTypes();
-
- /**
- * Gets the property definitions for this type (owned and inherited)
- *
- * @return property definitions
- */
- public Map getPropertyDefinitions();
-
- /**
- * Gets the property definitions owned by this type
- *
- * @return
- */
- public Map getOwnedPropertyDefinitions();
-
- /**
- * Gets the Action evaluators for this type
- *
- * @return
- */
- public Map> getActionEvaluators();
-}
diff --git a/source/java/org/alfresco/cmis/CMISTypeId.java b/source/java/org/alfresco/cmis/CMISTypeId.java
deleted file mode 100644
index f3ea43bd1e..0000000000
--- a/source/java/org/alfresco/cmis/CMISTypeId.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.io.Serializable;
-
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.service.namespace.QName;
-
-/**
- * CMIS Type Id
- *
- * @author andyh
- *
- */
-public class CMISTypeId implements Serializable
-{
- private static final long serialVersionUID = -4709046883083948302L;
-
- private CMISScope scope;
- private QName typeQName;
- private String typeId;
- private QName internalQName;
-
- /**
- * Construct
- *
- * @param scope type scope
- * @param typeQName name of the CMIS type
- * @param typeId id of the CMIS type
- * @param internalQName alfresco class definition representing the type
- */
- public CMISTypeId(CMISScope scope, QName typeQName, String typeId, QName internalQName)
- {
- this.scope = scope;
- this.typeQName = typeQName;
- this.typeId = typeId;
- this.internalQName = internalQName;
- }
-
- /**
- * Get the CMIS type id string
- * @return
- */
- public String getId()
- {
- return typeId;
- }
-
- /**
- * Get the CMIS local name
- * @return
- */
- public String getLocalName()
- {
- return typeQName.getLocalName();
- }
-
- /**
- * Get the CMIS local namespace
- * @return
- */
- public String getLocalNamespace()
- {
- return typeQName.getNamespaceURI();
- }
-
- /**
- * Get the scope for the type (Doc, Folder, Relationship or unknown)
- * @return
- */
- public CMISScope getScope()
- {
- return scope;
- }
-
- /**
- * Get the Alfresco model QName associated with the type
- *
- * @return alfresco QName
- */
- public QName getQName()
- {
- return internalQName;
- }
-
- /**
- * Get the base type id
- * @return
- */
- public CMISTypeId getBaseTypeId()
- {
- switch (scope)
- {
- case DOCUMENT:
- return CMISDictionaryModel.DOCUMENT_TYPE_ID;
- case FOLDER:
- return CMISDictionaryModel.FOLDER_TYPE_ID;
- case RELATIONSHIP:
- return CMISDictionaryModel.RELATIONSHIP_TYPE_ID;
- case POLICY:
- return CMISDictionaryModel.POLICY_TYPE_ID;
- case OBJECT:
- return CMISMapping.OBJECT_TYPE_ID;
- case UNKNOWN:
- default:
- return null;
- }
- }
-
- @Override
- public String toString()
- {
- return getId();
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((typeId == null) ? 0 : typeId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final CMISTypeId other = (CMISTypeId) obj;
- if (typeQName == null)
- {
- if (other.typeQName != null)
- return false;
- }
- else if (!typeQName.equals(other.typeQName))
- return false;
- return true;
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/CMISTypesFilterEnum.java b/source/java/org/alfresco/cmis/CMISTypesFilterEnum.java
deleted file mode 100644
index 4305022105..0000000000
--- a/source/java/org/alfresco/cmis/CMISTypesFilterEnum.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Types Filter Enum
- *
- * @author davidc
- */
-public enum CMISTypesFilterEnum implements EnumLabel
-{
- DOCUMENTS("documents"),
- FOLDERS("folders"),
- POLICIES("policies"),
- ANY("any");
-
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISTypesFilterEnum(String label)
- {
- this.label = label;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISTypesFilterEnum.class, ANY);
-}
\ No newline at end of file
diff --git a/source/java/org/alfresco/cmis/CMISUpdatabilityEnum.java b/source/java/org/alfresco/cmis/CMISUpdatabilityEnum.java
deleted file mode 100644
index eab05808b7..0000000000
--- a/source/java/org/alfresco/cmis/CMISUpdatabilityEnum.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Updatability Enum
- *
- * @author davidc
- */
-public enum CMISUpdatabilityEnum implements EnumLabel
-{
- READ_ONLY("readonly"),
- READ_AND_WRITE("readwrite"),
- READ_AND_WRITE_WHEN_CHECKED_OUT("whencheckedout"),
- ON_CREATE("oncreate");
-
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISUpdatabilityEnum(String label)
- {
- this.label = label;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(CMISUpdatabilityEnum.class, null, true);
-}
diff --git a/source/java/org/alfresco/cmis/CMISVersioningException.java b/source/java/org/alfresco/cmis/CMISVersioningException.java
deleted file mode 100644
index a325b5bbb8..0000000000
--- a/source/java/org/alfresco/cmis/CMISVersioningException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-public class CMISVersioningException extends CMISServiceException
-{
- private static final long serialVersionUID = 6876828094374256016L;
-
- public CMISVersioningException(String message)
- {
- super(message, "versioning", 409);
- }
-
- public CMISVersioningException(Throwable cause)
- {
- super(cause, "versioning", 409);
- }
-
- public CMISVersioningException(String message, Throwable cause)
- {
- super(message, cause, "versioning", 409);
- }
-}
diff --git a/source/java/org/alfresco/cmis/CMISVersioningStateEnum.java b/source/java/org/alfresco/cmis/CMISVersioningStateEnum.java
deleted file mode 100644
index fc9bea5bbc..0000000000
--- a/source/java/org/alfresco/cmis/CMISVersioningStateEnum.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * CMIS Versioning State Enumeration.
- *
- * @author dward
- */
-public enum CMISVersioningStateEnum implements EnumLabel
-{
- NONE("none"), CHECKED_OUT("checkedout"), MAJOR("major"), MINOR("minor");
-
- private String label;
-
- /**
- * Construct.
- *
- * @param label
- */
- CMISVersioningStateEnum(String label)
- {
- this.label = label;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- public static EnumFactory FACTORY = new EnumFactory(
- CMISVersioningStateEnum.class, null, true);
-}
diff --git a/source/java/org/alfresco/cmis/PropertyFilter.java b/source/java/org/alfresco/cmis/PropertyFilter.java
deleted file mode 100644
index 5015b0104e..0000000000
--- a/source/java/org/alfresco/cmis/PropertyFilter.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * http://docs.oasis-open.org/cmis/CMIS/v1.0/os/cmis-spec-v1.0.htm
- * 2.1.2.1 Property
- * All properties MUST supply a String queryName attribute which is used for query and filter operations on object-types.
- * This is an opaque String with limitations. This string SHOULD NOT contain any characters that negatively interact with the BNF grammar.
- *
- * The string MUST NOT contain:
- * whitespace “ “,
- * comma “,”
- * double quotes ‘”’
- * single quotes “’”
- * backslash “\”
- * the period “.” character or,
- * the open “(“ or close “)” parenthesis characters.
- *
- *
- * 2.2.1.2.1 Properties
- * Description: All of the methods that allow for the retrieval of properties for CMIS Objects have a “Property Filter”
- * as an optional parameter, which allows the caller to specify a subset of properties for Objects that MUST be returned by the repository in the output of the method.
- * Optional Input Parameter:
- * String filter: Value indicating which properties for Objects MUST be returned. Values are:
- * - Not set: The set of properties to be returned MUST be determined by the repository.
- * - A comma-delimited list of property definition Query Names: The properties listed MUST be returned.
- * - “*” : All properties MUST be returned for all objects.
- * Repositories SHOULD return only the properties specified in the property filter if they exist on the object’s type definition.
- *
- * If a property filter specifies a property that is ‘not set’, it MUST be represented as a property element without a value element.
-
- * @author Dmitry Velichkevich
- * @author Arseny Kovalchuk
- */
-public class PropertyFilter
-{
- public static final String MATCH_ALL_FILTER = "*";
- public static final String PROPERTY_NAME_TOKENS_DELIMITER = ",";
-
- private static final char[] PROPERTY_INVALID_CHARS = { ' ', ',', '"', '\'', '\\', '.', ',', '(', ')' };
- private final List properties;
-
- /**
- * @param filter filter value (case insensitive)
- * @throws CMISFilterNotValidException if filter string isn't valid
- */
- public PropertyFilter(String filter) throws CMISFilterNotValidException
- {
- properties = validateFilter(filter);
- }
-
- /**
- * @param filter to be validated
- * @return a list of tokenized and validated properties
- * @throws CMISFilterNotValidException if one of the filter tokens is not valid
- */
- private static List validateFilter(String filter) throws CMISFilterNotValidException
- {
- if (filter != null)
- {
- if (!filter.equals(MATCH_ALL_FILTER))
- {
- String[] tokens = filter.split(PROPERTY_NAME_TOKENS_DELIMITER);
- for (int i = 0; i < tokens.length; i++)
- {
- String token = tokens[i].trim();
- if (token.isEmpty() || token.indexOf('*') != -1 || !isValidToken(token))
- throw new CMISFilterNotValidException("Property filter \"" + filter + "\" is invalid");
- tokens[i] = token; // trimmed
- }
- return Arrays.asList(tokens);
- }
- else
- {
- return null;
- }
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Validates particular token within property filter
- *
- * @param token
- * @return true if token is valid
- */
- private static boolean isValidToken(String token)
- {
- if (token == null)
- return false;
- boolean result = true;
- for (char invalidChar : PROPERTY_INVALID_CHARS)
- {
- if (token.indexOf(invalidChar) != -1)
- {
- result = false;
- break;
- }
- }
- return result;
- }
-
- /**
- * @param property property token name
- * @return true returns if property is allowed by filter. In other case returns false
- */
- public boolean allow(String property)
- {
- return properties == null || properties.contains(property);
- }
-}
\ No newline at end of file
diff --git a/source/java/org/alfresco/cmis/acl/CMISAccessControlEntriesGroupedByPrincipalIdImpl.java b/source/java/org/alfresco/cmis/acl/CMISAccessControlEntriesGroupedByPrincipalIdImpl.java
deleted file mode 100644
index 9ecf97c6a8..0000000000
--- a/source/java/org/alfresco/cmis/acl/CMISAccessControlEntriesGroupedByPrincipalIdImpl.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.acl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.alfresco.cmis.CMISAccessControlEntriesGroupedByPrincipalId;
-import org.alfresco.cmis.CMISAccessControlEntry;
-import org.alfresco.cmis.CMISConstraintException;
-
-/**
- * @author andyh
- *
- */
-public class CMISAccessControlEntriesGroupedByPrincipalIdImpl implements CMISAccessControlEntriesGroupedByPrincipalId
-{
- private String principalId;
-
- private List directPermissions = new ArrayList();
-
- private List indirectPermissions = new ArrayList();
-
- /*package */ CMISAccessControlEntriesGroupedByPrincipalIdImpl(String principalId)
- {
- this.principalId = principalId;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlEntriesGroupedByPrincipalId#getDirectPermissions()
- */
- public List getDirectPermissions()
- {
- return directPermissions;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlEntriesGroupedByPrincipalId#getInirectPermissions()
- */
- public List getIndirectPermissions()
- {
- return indirectPermissions;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlEntriesGroupedByPrincipalId#getPrincipalId()
- */
- public String getPrincipalId()
- {
- return principalId;
- }
-
- /* package */ void addEntry(CMISAccessControlEntry entry) throws CMISConstraintException
- {
- if(!principalId.equals(entry.getPrincipalId()))
- {
- throw new CMISConstraintException("Grouping error in principal id");
- }
- if(entry.getDirect())
- {
- directPermissions.add(entry.getPermission());
- }
- else
- {
- indirectPermissions.add(entry.getPermission());
- }
- }
-
-
-
-}
diff --git a/source/java/org/alfresco/cmis/acl/CMISAccessControlEntryImpl.java b/source/java/org/alfresco/cmis/acl/CMISAccessControlEntryImpl.java
deleted file mode 100644
index d3c18c18ed..0000000000
--- a/source/java/org/alfresco/cmis/acl/CMISAccessControlEntryImpl.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.acl;
-
-import org.alfresco.cmis.CMISAccessControlEntry;
-
-/**
- * @author andyh
- *
- */
-public class CMISAccessControlEntryImpl implements CMISAccessControlEntry
-{
- private String principalId;
-
- private String permission;
-
- private int position;
-
- private boolean direct;
-
- /*package*/ CMISAccessControlEntryImpl(String principalId, String permission, int position, boolean direct)
- {
- this.principalId = principalId;
- this.permission = permission;
- this.position = position;
- this.direct = direct;
- }
-
- /*package*/ CMISAccessControlEntryImpl(String principalId, String permission, int position)
- {
- this(principalId, permission, position, position == 0);
- }
-
- /**
- * Can be used for external calls to add or delete aces.
- * (All must be at position 0 === directly set on the object)
- *
- * @param principalId
- * @param permission
- */
- public CMISAccessControlEntryImpl(String principalId, String permission)
- {
- this(principalId, permission, 0);
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlEntry#getDirect()
- */
- public boolean getDirect()
- {
- return direct;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlEntry#getPermission()
- */
- public String getPermission()
- {
- return permission;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlEntry#getPrincipalId()
- */
- public String getPrincipalId()
- {
- return principalId;
- }
-
- /**
- * @return the position
- */
- public int getPosition()
- {
- return position;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + (direct ? 1231 : 1237);
- result = prime * result + ((permission == null) ? 0 : permission.hashCode());
- result = prime * result + position;
- result = prime * result + ((principalId == null) ? 0 : principalId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CMISAccessControlEntryImpl other = (CMISAccessControlEntryImpl) obj;
- if (direct != other.direct)
- return false;
- if (permission == null)
- {
- if (other.permission != null)
- return false;
- }
- else if (!permission.equals(other.permission))
- return false;
- if (position != other.position)
- return false;
- if (principalId == null)
- {
- if (other.principalId != null)
- return false;
- }
- else if (!principalId.equals(other.principalId))
- return false;
- return true;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("[");
- builder.append(getPrincipalId()).append(", ");
- builder.append(getPermission()).append(", ");
- builder.append(getPosition()).append(", ");
- builder.append(getDirect()).append("]");
- return builder.toString();
- }
-
-
-
-
-}
diff --git a/source/java/org/alfresco/cmis/acl/CMISAccessControlReportImpl.java b/source/java/org/alfresco/cmis/acl/CMISAccessControlReportImpl.java
deleted file mode 100644
index f19f59b8c6..0000000000
--- a/source/java/org/alfresco/cmis/acl/CMISAccessControlReportImpl.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.acl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.alfresco.cmis.CMISAccessControlEntriesGroupedByPrincipalId;
-import org.alfresco.cmis.CMISAccessControlEntry;
-import org.alfresco.cmis.CMISAccessControlReport;
-import org.alfresco.cmis.CMISConstraintException;
-
-/**
- * A simple CMIS access control report
- *
- * @author andyh
- *
- */
-public class CMISAccessControlReportImpl implements CMISAccessControlReport
-{
- private ArrayList entries = new ArrayList();
-
- private boolean extract = false;
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlReport#getAccessControlEntries()
- */
- public List getAccessControlEntries()
- {
- return entries;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlReport#isExtract()
- */
- public boolean isExact()
- {
- return extract;
- }
-
- /**
- * Set extract.
- * @param extract
- */
- public void setExtract(boolean extract)
- {
- this.extract = extract;
- }
-
- /*package*/ void addEntry(CMISAccessControlEntry entry)
- {
- removeEntry(entry);
- entries.add(entry);
- }
-
- /*package*/ void removeEntry(CMISAccessControlEntry entry)
- {
- for(int i = 0; i < entries.size(); i++)
- {
- CMISAccessControlEntry current = entries.get(i);
- if(current.getPrincipalId().equals(entry.getPrincipalId()) && current.getPermission().equals(entry.getPermission()))
- {
- entries.remove(i);
- i--;
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlReport#getAccessControlEntriesGroupedByPrincipalId()
- */
- public List extends CMISAccessControlEntriesGroupedByPrincipalId> getAccessControlEntriesGroupedByPrincipalId() throws CMISConstraintException
- {
- HashMap grouped = new HashMap();
- for(CMISAccessControlEntry entry : getAccessControlEntries())
- {
- CMISAccessControlEntriesGroupedByPrincipalIdImpl value = grouped.get(entry.getPrincipalId());
- if(value == null)
- {
- value = new CMISAccessControlEntriesGroupedByPrincipalIdImpl(entry.getPrincipalId());
- grouped.put(entry.getPrincipalId(), value);
- }
- value.addEntry(entry);
- }
- ArrayList answer = new ArrayList(grouped.values());
- return answer;
- }
-
-
-}
diff --git a/source/java/org/alfresco/cmis/acl/CMISAccessControlServiceImpl.java b/source/java/org/alfresco/cmis/acl/CMISAccessControlServiceImpl.java
deleted file mode 100644
index fff11a36e6..0000000000
--- a/source/java/org/alfresco/cmis/acl/CMISAccessControlServiceImpl.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.acl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.alfresco.cmis.CMISAccessControlEntry;
-import org.alfresco.cmis.CMISAccessControlReport;
-import org.alfresco.cmis.CMISAccessControlService;
-import org.alfresco.cmis.CMISAclCapabilityEnum;
-import org.alfresco.cmis.CMISAclPropagationEnum;
-import org.alfresco.cmis.CMISAclSupportedPermissionEnum;
-import org.alfresco.cmis.CMISAllowedActionEnum;
-import org.alfresco.cmis.CMISConstraintException;
-import org.alfresco.cmis.CMISDictionaryService;
-import org.alfresco.cmis.CMISPermissionDefinition;
-import org.alfresco.cmis.CMISPermissionMapping;
-import org.alfresco.cmis.CMISTypeDefinition;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.opencmis.CMISAccessControlFormatEnum;
-import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.repo.security.permissions.PermissionReference;
-import org.alfresco.repo.security.permissions.impl.AccessPermissionImpl;
-import org.alfresco.repo.security.permissions.impl.ModelDAO;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.security.AccessPermission;
-import org.alfresco.service.cmr.security.AccessStatus;
-import org.alfresco.service.cmr.security.PermissionService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.Pair;
-
-/**
- * @author andyh
- */
-public class CMISAccessControlServiceImpl implements CMISAccessControlService
-{
- private CMISAclCapabilityEnum aclCapabilityEnum;
-
- private CMISAclSupportedPermissionEnum aclSupportedPermissionEnum;
-
- private CMISAclPropagationEnum aclPropagationEnum;
-
- private ModelDAO permissionModelDao;
-
- private PermissionService permissionService;
-
- private CMISMapping cmisMapping;
-
- private NodeService nodeService;
-
- private CMISDictionaryService cmisDictionaryService;
-
- /**
- * @param aclCapabilityEnum
- * the aclCapabilityEnum to set
- */
- public void setAclCapabilityEnum(CMISAclCapabilityEnum aclCapabilityEnum)
- {
- this.aclCapabilityEnum = aclCapabilityEnum;
- }
-
- /**
- * Sets the acl supported permission enum.
- *
- * @param aclSupportedPermissionEnum
- * the aclSupportedPermissionEnum to set
- */
- public void setAclSupportedPermissionEnum(CMISAclSupportedPermissionEnum aclSupportedPermissionEnum)
- {
- this.aclSupportedPermissionEnum = aclSupportedPermissionEnum;
- }
-
- /**
- * @param aclPropagationEnum
- * the aclPropagationEnum to set
- */
- public void setAclPropagationEnum(CMISAclPropagationEnum aclPropagationEnum)
- {
- this.aclPropagationEnum = aclPropagationEnum;
- }
-
- /**
- * @param permissionModelDao
- * the permissionModelDao to set
- */
- public void setPermissionModelDao(ModelDAO permissionModelDao)
- {
- this.permissionModelDao = permissionModelDao;
- }
-
- /**
- * @param permissionService
- * the permissionService to set
- */
- public void setPermissionService(PermissionService permissionService)
- {
- this.permissionService = permissionService;
- }
-
- /**
- * Sets the cmis mapping.
- *
- * @param cmisMapping
- * the cmis mapping
- */
- public void setCMISMapping(CMISMapping cmisMapping)
- {
- this.cmisMapping = cmisMapping;
- }
-
- /**
- * @param nodeService
- * the nodeService to set
- */
- public void setNodeService(NodeService nodeService)
- {
- this.nodeService = nodeService;
- }
-
- /**
- * @param cmisDictionaryService
- * the cmisDictionaryService to set
- */
- public void setCMISDictionaryService(CMISDictionaryService cmisDictionaryService)
- {
- this.cmisDictionaryService = cmisDictionaryService;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlService#applyAcl(org.alfresco.service.cmr.repository.NodeRef,
- * java.util.List)
- */
- public CMISAccessControlReport applyAcl(NodeRef nodeRef, List acesToApply) throws CMISConstraintException
- {
- Set acesToAdd = new LinkedHashSet(acesToApply);
- List extends CMISAccessControlEntry> acesExisting = getAcl(nodeRef,
- CMISAccessControlFormatEnum.REPOSITORY_SPECIFIC_PERMISSIONS).getAccessControlEntries();
- List acesToRemove = new ArrayList(acesExisting.size());
- for (CMISAccessControlEntry accessControlEntry : acesExisting)
- {
- // Only pay attention to existing direct entries
- if (accessControlEntry.getDirect() && !acesToAdd.remove(accessControlEntry))
- {
- acesToRemove.add(accessControlEntry);
- }
- }
- return applyAcl(nodeRef, acesToRemove, new ArrayList(acesToAdd),
- CMISAclPropagationEnum.PROPAGATE,
- CMISAccessControlFormatEnum.REPOSITORY_SPECIFIC_PERMISSIONS);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.CMISAccessControlService#applyAcl(org.alfresco.service.cmr.repository.NodeRef,
- * java.util.List, java.util.List, org.alfresco.cmis.CMISAclPropagationEnum)
- */
- public CMISAccessControlReport applyAcl(NodeRef nodeRef, List acesToRemove, List acesToAdd, CMISAclPropagationEnum propagation,
- CMISAccessControlFormatEnum format) throws CMISConstraintException
- {
- if (propagation == CMISAclPropagationEnum.OBJECT_ONLY)
- {
- throw new CMISConstraintException("Unsupported ACL propagation mode: " + propagation);
- }
- // Check controllable ACL
- QName type = nodeService.getType(nodeRef);
- CMISTypeDefinition cmisType = cmisDictionaryService.findTypeForClass(type);
- if (false == cmisType.isControllableACL())
- {
- throw new CMISConstraintException("ACLs are not supported for type: " + cmisType.getDisplayName());
- }
- // TODO: Check valid permissions. We do not check this internally. Ignore for now ...
-
- if (acesToRemove != null)
- {
- Set permissions = permissionService.getAllSetPermissions(nodeRef);
- for (CMISAccessControlEntry entry : acesToRemove)
- {
- String alfrescoPermission = cmisMapping.getSetPermission(compressPermission(entry.getPermission()));
- AccessPermission toCheck = new AccessPermissionImpl(alfrescoPermission, AccessStatus.ALLOWED, entry.getPrincipalId(), 0);
- if (false == permissions.contains(toCheck))
- {
- throw new CMISConstraintException("No matching ACE found to delete");
- }
- permissionService.deletePermission(nodeRef, entry.getPrincipalId(), alfrescoPermission);
- }
- }
- if (acesToAdd != null)
- {
- for (CMISAccessControlEntry entry : acesToAdd)
- {
- String alfrescoPermission = cmisMapping.getSetPermission(compressPermission(entry.getPermission()));
- permissionService.setPermission(nodeRef, entry.getPrincipalId(), alfrescoPermission, true);
- }
- }
- return getAcl(nodeRef, format);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.CMISAccessControlService#getAcl(org.alfresco.service.cmr.repository.NodeRef,
- * org.alfresco.cmis.CMISAccessControlFormatEnum)
- */
- public CMISAccessControlReport getAcl(NodeRef nodeRef, CMISAccessControlFormatEnum format)
- {
- CMISAccessControlReportImpl merge = new CMISAccessControlReportImpl();
- // Need to compact deny to mask correctly
- Set permissions = permissionService.getAllSetPermissions(nodeRef);
- ArrayList ordered = new ArrayList();
- AccessPermissionComparator comparator = new AccessPermissionComparator();
- for (AccessPermission current : permissions)
- {
- int index = Collections.binarySearch(ordered, current, comparator);
- if (index < 0)
- {
- ordered.add(-index - 1, current);
- }
- }
-
- for (AccessPermission entry : ordered)
- {
- if (entry.getAccessStatus() == AccessStatus.ALLOWED)
- {
- //answer.addEntry(new CMISAccessControlEntryImpl(entry.getAuthority(), expandPermission(cmisMapping.getReportedPermission(getPermission(entry.getPermission()),
- // format)), entry.getPosition()));
- merge.addEntry(new CMISAccessControlEntryImpl(entry.getAuthority(), entry.getPermission(), entry.getPosition()));
- }
- else if (entry.getAccessStatus() == AccessStatus.DENIED)
- {
- //answer.removeEntry(new CMISAccessControlEntryImpl(entry.getAuthority(), expandPermission(cmisMapping.getReportedPermission(getPermission(entry.getPermission()),
- // format)), entry.getPosition()));
- merge.removeEntry(new CMISAccessControlEntryImpl(entry.getAuthority(), entry.getPermission(), entry.getPosition()));
- }
- }
-
- CMISAccessControlReportImpl answer = new CMISAccessControlReportImpl();
- for(CMISAccessControlEntry entry : merge.getAccessControlEntries())
- {
- CMISAccessControlEntryImpl impl = (CMISAccessControlEntryImpl)entry;
- PermissionReference permissionReference = permissionModelDao.getPermissionReference(null, impl.getPermission());
- Set longForms = permissionModelDao.getGranteePermissions(permissionReference);
- HashSet shortForms = new HashSet();
- for(PermissionReference longForm : longForms)
- {
- shortForms.add(getPermission(longForm));
- }
- for(Pair toAdd : cmisMapping.getReportedPermissions(impl.getPermission(), shortForms, permissionModelDao.hasFull(permissionReference), impl.getDirect(), format))
- {
- answer.addEntry(new CMISAccessControlEntryImpl(impl.getPrincipalId(), expandPermission(toAdd.getFirst()), impl.getPosition(), toAdd.getSecond()));
- }
-
- }
- return answer;
- }
-
- private String getPermission(PermissionReference permissionReference)
- {
- if (permissionModelDao.isUnique(permissionReference))
- {
- return permissionReference.getName();
- }
- else
- {
- return permissionReference.toString();
- }
- }
-
- private String expandPermission(String permission)
- {
- if (permission.equals(CMIS_ALL_PERMISSION))
- {
- return permission;
- }
- else if (permission.equals(CMIS_READ_PERMISSION))
- {
- return permission;
- }
- else if (permission.equals(CMIS_WRITE_PERMISSION))
- {
- return permission;
-
- }
- else if (permission.startsWith("{"))
- {
- return permission;
- }
- else
- {
- PermissionReference permissionReference = permissionModelDao.getPermissionReference(null, permission);
- return permissionReference.toString();
- }
- }
-
- private String compressPermission(String permission) {
- int sepIndex;
- if (permission.equals(CMIS_ALL_PERMISSION) || permission.equals(CMIS_READ_PERMISSION)
- || permission.equals(CMIS_WRITE_PERMISSION) || !permission.startsWith("{")
- || (sepIndex = permission.lastIndexOf('.')) == -1) {
- return permission;
- }
- return permission.substring(sepIndex + 1);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.CMISAccessControlService#getAclCapability()
- */
- public CMISAclCapabilityEnum getAclCapability()
- {
- return aclCapabilityEnum;
- }
-
- /**
- * Set the acl capability enum.
- *
- * @param aclCapabilityEnum
- */
- public void setAclCapability(CMISAclCapabilityEnum aclCapabilityEnum)
- {
- this.aclCapabilityEnum = aclCapabilityEnum;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlService#getSupportedPermissions()
- */
- public CMISAclSupportedPermissionEnum getSupportedPermissions()
- {
- return this.aclSupportedPermissionEnum;
- }
-
- /**
- * Sets the supported permissions.
- *
- * @param aclSupportedPermissionEnum
- * the supported permissions
- */
- public void setSupportedPermissions(CMISAclSupportedPermissionEnum aclSupportedPermissionEnum)
- {
- this.aclSupportedPermissionEnum = aclSupportedPermissionEnum;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.CMISAccessControlService#getAclPropagation()
- */
- public CMISAclPropagationEnum getAclPropagation()
- {
- return aclPropagationEnum;
- }
-
- /**
- * Set the acl propagation enum.
- *
- * @param aclPropagationEnum
- */
- public void setAclPropagation(CMISAclPropagationEnum aclPropagationEnum)
- {
- this.aclPropagationEnum = aclPropagationEnum;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.CMISAccessControlService#getPermissionMappings()
- */
- public List extends CMISPermissionMapping> getPermissionMappings()
- {
- ArrayList mappings = new ArrayList();
- for(CMISAllowedActionEnum e : EnumSet.allOf(CMISAllowedActionEnum.class))
- {
- Map> enumMappings = e.getPermissionMapping();
- for(String key : enumMappings.keySet())
- {
- List list = enumMappings.get(key);
- CMISPermissionMappingImpl mapping = new CMISPermissionMappingImpl(key, list);
- mappings.add(mapping);
- }
- }
- return mappings;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.CMISAccessControlService#getRepositoryPermissions()
- */
- public List getRepositoryPermissions()
- {
- ArrayList answer = new ArrayList();
- PermissionReference allPermission = permissionModelDao.getPermissionReference(null, PermissionService.ALL_PERMISSIONS);
- Set all = permissionModelDao.getAllExposedPermissions();
- for (PermissionReference pr : all)
- {
- addPermissionDefinition(answer, pr);
- }
- // Add All
- addPermissionDefinition(answer, allPermission);
- // Add CMIS permissions
- answer.add(new CMISPermissionDefinitionImpl(CMIS_ALL_PERMISSION));
- answer.add(new CMISPermissionDefinitionImpl(CMIS_READ_PERMISSION));
- answer.add(new CMISPermissionDefinitionImpl(CMIS_WRITE_PERMISSION));
- return answer;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlService#getPrincipalAnonymous()
- */
- public String getPrincipalAnonymous()
- {
- return AuthenticationUtil.getGuestUserName();
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISAccessControlService#getPrincipalAnyone()
- */
- public String getPrincipalAnyone()
- {
- return PermissionService.ALL_AUTHORITIES;
- }
-
- private void addPermissionDefinition(ArrayList list, PermissionReference pr)
- {
- CMISPermissionDefinitionImpl def = new CMISPermissionDefinitionImpl(getPermissionString(pr));
- list.add(def);
- }
-
- private String getPermissionString(PermissionReference pr)
- {
- StringBuilder builder = new StringBuilder();
- builder.append(pr.getQName().toString());
- builder.append(".");
- builder.append(pr.getName());
- return builder.toString();
- }
-
- public static class AccessPermissionComparator implements Comparator
- {
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(AccessPermission left, AccessPermission right)
- {
- if (left.getPosition() != right.getPosition())
- {
- return right.getPosition() - left.getPosition();
- }
- else
- {
- if (left.getAccessStatus() != right.getAccessStatus())
- {
- return (left.getAccessStatus() == AccessStatus.DENIED) ? -1 : 1;
- }
- else
- {
- int compare = left.getAuthority().compareTo(right.getAuthority());
- if (compare != 0)
- {
- return compare;
- }
- else
- {
- return (left.getPermission().compareTo(right.getPermission()));
- }
-
- }
-
- }
- }
-
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/acl/CMISAllowedActionKeyTypeEnum.java b/source/java/org/alfresco/cmis/acl/CMISAllowedActionKeyTypeEnum.java
deleted file mode 100644
index 9610ffed7b..0000000000
--- a/source/java/org/alfresco/cmis/acl/CMISAllowedActionKeyTypeEnum.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.acl;
-
-import org.alfresco.opencmis.EnumFactory;
-import org.alfresco.opencmis.EnumLabel;
-
-/**
- * Part two of the allowable action key for the permission mappings
- * @author andyh
- *
- */
-public enum CMISAllowedActionKeyTypeEnum implements EnumLabel
-{
- /**
- * Folder
- */
- FOLDER("Folder"),
- /**
- * Object
- */
- OBJECT("Object"),
- /**
- * Source
- */
- SOURCE("Source"),
- /**
- * Target
- */
- TARGET("Target"),
- /**
- * Document
- */
- DOCUMENT("Document"),
- /**
- * Policy
- */
- POLICY("Policy");
-
- private String label;
-
- /**
- * Construct
- *
- * @param label
- */
- CMISAllowedActionKeyTypeEnum(String label)
- {
- this.label = label;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.EnumLabel#label()
- */
- public String getLabel()
- {
- return label;
- }
-
- /**
- * Factory for CMISAclCapabilityEnum
- */
- public static EnumFactory FACTORY = new EnumFactory(CMISAllowedActionKeyTypeEnum.class, null, true);
-
-
-
-}
diff --git a/source/java/org/alfresco/cmis/acl/CMISPermissionDefinitionImpl.java b/source/java/org/alfresco/cmis/acl/CMISPermissionDefinitionImpl.java
deleted file mode 100644
index 36ed021fef..0000000000
--- a/source/java/org/alfresco/cmis/acl/CMISPermissionDefinitionImpl.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.acl;
-
-import org.alfresco.cmis.CMISPermissionDefinition;
-
-/**
- * Implementation class for a simple CMIS permission definition.
- *
- * @author andyh
- *
- */
-public class CMISPermissionDefinitionImpl implements CMISPermissionDefinition
-{
- private String permission;
-
- private String description;
-
- /*package*/ CMISPermissionDefinitionImpl(String permission)
- {
- this.permission = permission;
- }
-
- /*package*/ CMISPermissionDefinitionImpl(String permission, String description)
- {
- this(permission);
- this.description = description;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISPermissionDefinition#getDescription()
- */
- public String getDescription()
- {
- if(description != null)
- {
- return description;
- }
- else
- {
- return permission;
- }
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISPermissionDefinition#getPermission()
- */
- public String getPermission()
- {
- return permission;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((permission == null) ? 0 : permission.hashCode());
- return result;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final CMISPermissionDefinitionImpl other = (CMISPermissionDefinitionImpl) obj;
- if (permission == null)
- {
- if (other.permission != null)
- return false;
- }
- else if (!permission.equals(other.permission))
- return false;
- return true;
- }
-
-
-}
diff --git a/source/java/org/alfresco/cmis/acl/CMISPermissionMappingImpl.java b/source/java/org/alfresco/cmis/acl/CMISPermissionMappingImpl.java
deleted file mode 100644
index 521c6da83d..0000000000
--- a/source/java/org/alfresco/cmis/acl/CMISPermissionMappingImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.acl;
-
-import java.util.List;
-
-import org.alfresco.cmis.CMISPermissionMapping;
-
-/**
- * @author andyh
- *
- */
-public class CMISPermissionMappingImpl implements CMISPermissionMapping
-{
- String key;
-
- List permissions;
-
- CMISPermissionMappingImpl(String key, List permissions)
- {
- this.key = key;
- this.permissions = permissions;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISPermissionMapping#getKey()
- */
- public String getKey()
- {
- return key;
- }
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISPermissionMapping#getPermissions()
- */
- public List getPermissions()
- {
- return permissions;
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/acl/CMISPermissionMappingKey.java b/source/java/org/alfresco/cmis/acl/CMISPermissionMappingKey.java
deleted file mode 100644
index cd0a8639ce..0000000000
--- a/source/java/org/alfresco/cmis/acl/CMISPermissionMappingKey.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.acl;
-
-import org.alfresco.cmis.CMISAllowedActionEnum;
-
-/**
- * @author andyh
- *
- */
-public interface CMISPermissionMappingKey
-{
- /**
- * Get the allowed action enum.
- * @return the allowed action enum.
- */
- public CMISAllowedActionEnum getAllowedActionEnum();
-
- /**
- * Get the allowed action key type enum.
- * @return the allowed action key type enum.
- */
- public CMISAllowedActionKeyTypeEnum getAllowedActionKeyTypeEnum();
-}
diff --git a/source/java/org/alfresco/cmis/changelog/CMISChangeEventImpl.java b/source/java/org/alfresco/cmis/changelog/CMISChangeEventImpl.java
deleted file mode 100644
index bcb3ffa931..0000000000
--- a/source/java/org/alfresco/cmis/changelog/CMISChangeEventImpl.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.changelog;
-
-import java.util.Date;
-
-import org.alfresco.cmis.CMISChangeEvent;
-import org.alfresco.cmis.CMISChangeType;
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * CMISChangeEvent Implementation
- *
- * @author Dmitry Velichkevich
- */
-public class CMISChangeEventImpl implements CMISChangeEvent
-{
- private CMISChangeType changeType;
- private Date changeTime;
- private NodeRef changedNode;
- private String objectId;
-
-
- /**
- * Instantiates a new CMIS change event.
- *
- * @param changeType
- * the change type
- * @param changeTime
- * the change time
- * @param changedNode
- * the changed node
- * @param objectId
- * the object id
- */
- public CMISChangeEventImpl(CMISChangeType changeType, Date changeTime, NodeRef changedNode, String objectId)
- {
- this.changeType = changeType;
- this.changeTime = changeTime;
- this.changedNode = changedNode;
- this.objectId = objectId;
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeEvent#getChangeType()
- */
- public CMISChangeType getChangeType()
- {
- return changeType;
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeEvent#getChangeTime()
- */
- public Date getChangeTime()
- {
- return changeTime;
- }
-
-
- /**
- * @see org.alfresco.cmis.CMISChangeEvent#getChangedNode()
- */
- public NodeRef getChangedNode()
- {
- return changedNode;
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeEvent#getObjectId()
- */
- public String getObjectId()
- {
- return objectId;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj)
- {
- if (!(obj instanceof CMISChangeEvent))
- {
- return false;
- }
- CMISChangeEvent converted = (CMISChangeEvent) obj;
- return same(changedNode, converted.getChangedNode()) && same(changeType, converted.getChangeType()) && same(changeTime, converted.getChangeTime());
- }
-
- private boolean same(Object left, Object right)
- {
- return (null == left) ? (null == right) : (left.equals(right));
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode()
- {
- int result = (null != changedNode) ? (changedNode.hashCode()) : (31);
- return result * 37 + (null != changeType ? changeType.hashCode() : 31) + (null != changeTime ? changeTime.hashCode() : 31);
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/changelog/CMISChangeLogImpl.java b/source/java/org/alfresco/cmis/changelog/CMISChangeLogImpl.java
deleted file mode 100644
index 47f4b05e57..0000000000
--- a/source/java/org/alfresco/cmis/changelog/CMISChangeLogImpl.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.changelog;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.alfresco.cmis.CMISChangeEvent;
-import org.alfresco.cmis.CMISChangeLog;
-
-/**
- * CMISChangeLog Implementation
- *
- * @author Dmitry Velichkevich
- */
-public class CMISChangeLogImpl implements CMISChangeLog
-{
- private boolean hasMoreItems;
- private List changeEvents = new LinkedList();
- private String nextChangeToken;
-
- /**
- * @see org.alfresco.cmis.CMISChangeLog#getChangeEvents()
- */
- public List getChangeEvents()
- {
- return changeEvents;
- }
-
- /**
- * Set the change events
- *
- * @param changeEvents list of change events
- */
- protected void setChangeEvents(List changeEvents)
- {
- this.changeEvents = changeEvents;
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLog#getEventCount()
- */
- public Integer getEventCount()
- {
- return changeEvents.size();
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLog#getNextChangeToken()
- */
- public String getNextChangeToken()
- {
- return nextChangeToken;
- }
-
- /**
- * Set the next ChangeToken
- *
- * @param nextChangeToken the next ChangeToken
- */
- public void setNextChangeToken(String nextChangeToken)
- {
- this.nextChangeToken = nextChangeToken;
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLog#hasMoreItems()
- */
- public boolean hasMoreItems()
- {
- return hasMoreItems;
- }
-
- /**
- * Set the hasMoreItems value
- *
- * @param hasMoreItems hasMoreItems value
- */
- protected void setHasMoreItems(boolean hasMoreItems)
- {
- this.hasMoreItems = hasMoreItems;
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/changelog/CMISChangeLogServiceImpl.java b/source/java/org/alfresco/cmis/changelog/CMISChangeLogServiceImpl.java
deleted file mode 100644
index 5524ab90d8..0000000000
--- a/source/java/org/alfresco/cmis/changelog/CMISChangeLogServiceImpl.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.changelog;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.alfresco.cmis.CMISBaseObjectTypeIds;
-import org.alfresco.cmis.CMISCapabilityChanges;
-import org.alfresco.cmis.CMISChangeEvent;
-import org.alfresco.cmis.CMISChangeLog;
-import org.alfresco.cmis.CMISChangeLogService;
-import org.alfresco.cmis.CMISChangeType;
-import org.alfresco.cmis.CMISInvalidArgumentException;
-import org.alfresco.error.AlfrescoRuntimeException;
-import org.alfresco.opencmis.CMISChangeLogDataExtractor;
-import org.alfresco.service.cmr.audit.AuditQueryParameters;
-import org.alfresco.service.cmr.audit.AuditService;
-import org.alfresco.service.cmr.audit.AuditService.AuditQueryCallback;
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * ChangeLog Service Implementation
- *
- * @author Dmitry Velichkevich
- */
-public class CMISChangeLogServiceImpl implements CMISChangeLogService
-{
- private static final String PATH_DELIMITER = "/";
- private static final int DEFAULT_RETURN_SIZE = 100;
-
- private AuditService auditService;
- private String cmisAuditApplicationName;
- private List changesOnTypeCapability;
-
- /**
- * Set the AuditService.
- *
- * @param auditService AuditService
- */
- public void setAuditService(AuditService auditService)
- {
- this.auditService = auditService;
- }
-
- /**
- * Set the Audit Application Name.
- *
- * @param cmisAuditApplicationName Audit Application Name
- */
- public void setCmisAuditApplicationName(String cmisAuditApplicationName)
- {
- this.cmisAuditApplicationName = cmisAuditApplicationName;
- }
-
- /**
- * Set the ChangesOnTypeCapability.
- *
- * @param changesOnTypeCapability list of CMISBaseObjectTypeIds
- */
- public void setChangesOnTypeCapability(List changesOnTypeCapability)
- {
- this.changesOnTypeCapability = changesOnTypeCapability;
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLogService#getCapability()
- */
- public CMISCapabilityChanges getCapability()
- {
- return (auditService.isAuditEnabled(cmisAuditApplicationName, PATH_DELIMITER + cmisAuditApplicationName)) ? (CMISCapabilityChanges.OBJECTIDSONLY)
- : (CMISCapabilityChanges.NONE);
- }
-
- /**
- * @throws CMISInvalidArgumentException
- * @see org.alfresco.cmis.CMISChangeLogService#getChangeLogEvents(java.lang.String, java.lang.Integer)
- */
- public CMISChangeLog getChangeLogEvents(String changeLogToken, Integer maxItems) throws CMISInvalidArgumentException
- {
- if (!auditService.isAuditEnabled(cmisAuditApplicationName, ("/" + cmisAuditApplicationName)))
- {
- throw new AlfrescoRuntimeException("Auditing for " + cmisAuditApplicationName + " is disabled!");
- }
- CMISChangeLogImpl result = new CMISChangeLogImpl();
- final List changeEvents = result.getChangeEvents();
- EntryIdCallback changeLogCollectingCallback = new EntryIdCallback(true)
- {
- @Override
- public boolean handleAuditEntry(Long entryId, String user, long time, Map values)
- {
- List changeLogEvents = convertValuesMapToChangeLogEvents(values, time);
- changeEvents.addAll(changeLogEvents);
- return super.handleAuditEntry(entryId, user, time, values);
- }
- };
- Long from;
- try
- {
- from = changeLogToken != null ? Long.parseLong(changeLogToken) : null;
- }
- catch (NumberFormatException e)
- {
- throw new CMISInvalidArgumentException("Invalid change log token " + changeLogToken);
- }
- AuditQueryParameters params = new AuditQueryParameters();
- params.setApplicationName(cmisAuditApplicationName);
- params.setForward(true);
- params.setFromId(from);
-
- // Query one past the last item, so that we know what the next ID is
- int maxAmount = ((null == maxItems) || (0 == maxItems)) ? (0) : (maxItems + 1);
- auditService.auditQuery(changeLogCollectingCallback, params, maxAmount);
-
- if ((0 != maxAmount) && (changeEvents.size() > maxItems))
- {
- changeEvents.remove(changeEvents.size() - 1);
- result.setNextChangeToken(changeLogCollectingCallback.getEntryId().toString());
- result.setHasMoreItems(true);
- }
- return result;
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLogService#getChangesIncomplete()
- */
- public boolean getChangesIncomplete()
- {
- return true;
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLogService#getLastChangeLogToken()
- */
- public String getLastChangeLogToken()
- {
- EntryIdCallback auditQueryCallback = new EntryIdCallback(false);
- AuditQueryParameters params = new AuditQueryParameters();
- params.setApplicationName(cmisAuditApplicationName);
- params.setForward(false);
- auditService.auditQuery(auditQueryCallback, params, 1);
- return auditQueryCallback.getEntryId();
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLogService#getPreviousPageChangeLogToken(java.lang.String, java.lang.Integer)
- */
- public String getPreviousPageChangeLogToken(String currentPageToken, Integer maxItems)
- {
- if (currentPageToken == null)
- {
- return null;
- }
- maxItems = maxItems == null ? DEFAULT_RETURN_SIZE : maxItems;
- EntryIdCallback auditQueryCallback = new EntryIdCallback(false);
- AuditQueryParameters params = new AuditQueryParameters();
- params.setApplicationName(cmisAuditApplicationName);
- params.setForward(false);
- params.setToId(Long.parseLong(currentPageToken));
- auditService.auditQuery(auditQueryCallback, params, maxItems);
- return auditQueryCallback.getEntryId();
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLogService#getLastPageChangeLogToken(java.lang.String, java.lang.Integer)
- */
- public String getLastPageChangeLogToken(String currentPageToken, Integer maxItems)
- {
- maxItems = maxItems == null ? DEFAULT_RETURN_SIZE : maxItems;
- EntryIdCallback auditQueryCallback = new PageStartEntryIdCallback(maxItems);
- AuditQueryParameters params = new AuditQueryParameters();
- params.setApplicationName(cmisAuditApplicationName);
- if (currentPageToken != null)
- {
- params.setFromId(Long.parseLong(currentPageToken));
- }
- auditService.auditQuery(auditQueryCallback, params, -1);
- return auditQueryCallback.getEntryId();
- }
-
- /**
- * @see org.alfresco.cmis.CMISChangeLogService#getChangesOnTypeCapability()
- */
- public List getChangesOnTypeCapability()
- {
- if (null == changesOnTypeCapability)
- {
- changesOnTypeCapability = new LinkedList();
- }
- return changesOnTypeCapability;
- }
-
- /**
- * Converts audit values map to list of CMISChangeEvents.
- *
- * @param values audit values map
- * @param time audit event time
- * @return list of CMISChangeEvent
- */
- @SuppressWarnings("unchecked")
- private List convertValuesMapToChangeLogEvents(Map values, long time)
- {
- List result = new ArrayList();
- if (values != null && values.size() > 0)
- {
- for (Entry entry : values.entrySet())
- {
- if (entry.getKey() != null && entry.getValue() != null)
- {
- String path = entry.getKey();
- CMISChangeType changeType = getCMISChangeType(path);
- if (changeType != null && entry.getValue() instanceof Map)
- {
- Map valueMap = (Map)entry.getValue();
- result.add(new CMISChangeEventImpl(changeType, new Date(time), (NodeRef) valueMap
- .get(CMISChangeLogDataExtractor.KEY_NODE_REF), (String) valueMap
- .get(CMISChangeLogDataExtractor.KEY_OBJECT_ID)));
- }
- }
- }
- }
- return result;
- }
-
- /**
- * Gets CMISChangeType by audit path.
- *
- * @param auditPath audit path
- * @return CMISChangeType
- */
- private CMISChangeType getCMISChangeType(String auditPath)
- {
- CMISChangeType result = null;
- if (auditPath != null)
- {
- if (auditPath.startsWith(PATH_DELIMITER))
- {
- auditPath = auditPath.substring(PATH_DELIMITER.length());
- }
- if (auditPath.startsWith(cmisAuditApplicationName))
- {
- auditPath = auditPath.substring(cmisAuditApplicationName.length());
- }
- if (auditPath.startsWith(PATH_DELIMITER))
- {
- auditPath = auditPath.substring(PATH_DELIMITER.length());
- }
- auditPath = auditPath.toLowerCase();
- for (CMISChangeType changeType : CMISChangeType.values())
- {
- if (auditPath.startsWith(changeType.getLabel()))
- {
- result = changeType;
- break;
- }
- }
- }
- return result;
- }
-
- private class EntryIdCallback implements AuditQueryCallback
- {
- private final boolean valuesRequired;
- private Long entryId;
-
- public EntryIdCallback(boolean valuesRequired)
- {
- this.valuesRequired = valuesRequired;
- }
-
- public String getEntryId()
- {
- return entryId == null ? null : entryId.toString();
- }
-
- public boolean valuesRequired()
- {
- return this.valuesRequired;
- }
-
- public final boolean handleAuditEntry(Long entryId, String applicationName, String user, long time, Map values)
- {
- if (applicationName.equals(CMISChangeLogServiceImpl.this.cmisAuditApplicationName))
- {
- return handleAuditEntry(entryId, user, time, values);
- }
- return true;
- }
-
- public boolean handleAuditEntry(Long entryId, String user, long time, Map values)
- {
- this.entryId = entryId;
- return true;
- }
-
- public boolean handleAuditEntryError(Long entryId, String errorMsg, Throwable error)
- {
- throw new AlfrescoRuntimeException(errorMsg, error);
- }
- };
-
- private class PageStartEntryIdCallback extends EntryIdCallback
- {
- private final int pageSize;
- private int indexWithinPage;
-
- public PageStartEntryIdCallback(int pageSize)
- {
- super(false);
- this.pageSize = pageSize;
- this.indexWithinPage = -1;
- }
-
- @Override
- public boolean handleAuditEntry(Long entryId, String user, long time, Map values)
- {
- if (++this.indexWithinPage == this.pageSize)
- {
- this.indexWithinPage = 0;
- return super.handleAuditEntry(entryId, user, time, values);
- }
- return true;
- }
- }
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISAbstractDictionaryService.java b/source/java/org/alfresco/cmis/dictionary/CMISAbstractDictionaryService.java
deleted file mode 100644
index 883fdb1497..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISAbstractDictionaryService.java
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- * Copyright (C) 2005-2013 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
-
-import org.alfresco.cmis.CMISDataTypeEnum;
-import org.alfresco.cmis.CMISDictionaryService;
-import org.alfresco.cmis.CMISPropertyDefinition;
-import org.alfresco.cmis.CMISPropertyId;
-import org.alfresco.cmis.CMISScope;
-import org.alfresco.cmis.CMISTypeDefinition;
-import org.alfresco.cmis.CMISTypeId;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.error.AlfrescoRuntimeException;
-import org.alfresco.repo.cache.SimpleCache;
-import org.alfresco.repo.dictionary.DictionaryDAO;
-import org.alfresco.repo.dictionary.DictionaryListener;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.namespace.QName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.extensions.surf.util.AbstractLifecycleBean;
-
-
-/**
- * Common CMIS Dictionary Support including registry of Types.
- *
- * @author davidc
- */
-public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBean implements CMISDictionaryService, DictionaryListener
-{
- // Logger
- protected static final Log logger = LogFactory.getLog(CMISAbstractDictionaryService.class);
-
- // service dependencies
- private DictionaryDAO dictionaryDAO;
- protected CMISMapping cmisMapping;
- protected DictionaryService dictionaryService;
-
- /**
- * Set the mapping service
- *
- * @param cmisMapping
- */
- public void setCMISMapping(CMISMapping cmisMapping)
- {
- this.cmisMapping = cmisMapping;
- }
-
- /**
- * Set the dictionary Service
- *
- * @param dictionaryService
- */
- public void setDictionaryService(DictionaryService dictionaryService)
- {
- this.dictionaryService = dictionaryService;
- }
-
- /**
- * Set the dictionary DAO
- *
- * @param dictionaryDAO
- */
- public void setDictionaryDAO(DictionaryDAO dictionaryDAO)
- {
- this.dictionaryDAO = dictionaryDAO;
- }
-
- public void setSingletonCache(SimpleCache singletonCache)
- {
- this.singletonCache = singletonCache;
- }
-
-
- private final ReentrantReadWriteLock registryLock = new ReentrantReadWriteLock();
- private final WriteLock registryWriteLock = registryLock.writeLock();
- private final ReadLock registryReadLock = registryLock.readLock();
- // note: cache is tenant-aware (if using TransctionalCache impl)
- private SimpleCache singletonCache; // eg. for cmisDictionaryRegistry
- private final String KEY_CMIS_DICTIONARY_REGISTRY = "key.cmisDictionaryRegistry";
-
- /**
- * CMIS Dictionary registry
- *
- * Index of CMIS Type Definitions
- */
- /*package*/ class DictionaryRegistry
- {
- // Type Definitions Index
- Map typeDefsByQName = new HashMap();
- Map assocDefsByQName = new HashMap();
- Map objectDefsByTypeId = new HashMap();
- Map typeDefsByTypeId = new HashMap();
- Map typeDefsByQueryName = new HashMap();
- List baseTypes = new ArrayList();
-
- // Property Definitions Index
- Map propDefsById = new HashMap();
- Map propDefsByQName = new HashMap();
- Map propDefsByPropId = new HashMap();
- Map propDefsByQueryName = new HashMap();
-
- /**
- * Register Type Definition
- *
- * @param typeDef
- */
- public void registerTypeDefinition(CMISAbstractTypeDefinition typeDef)
- {
- CMISTypeDefinition existingTypeDef = objectDefsByTypeId.get(typeDef.getTypeId());
- if (existingTypeDef != null)
- {
- throw new AlfrescoRuntimeException("Type " + typeDef.getTypeId() + " already registered");
- }
-
- objectDefsByTypeId.put(typeDef.getTypeId(), typeDef);
- if (typeDef.isPublic())
- {
- QName typeQName = typeDef.getTypeId().getQName();
- if (typeQName != null)
- {
- if (typeDef instanceof CMISRelationshipTypeDefinition)
- {
- assocDefsByQName.put(typeQName, typeDef);
- }
- else
- {
- typeDefsByQName.put(typeQName, typeDef);
- }
- }
- typeDefsByTypeId.put(typeDef.getTypeId(), typeDef);
- typeDefsByQueryName.put(typeDef.getQueryName().toLowerCase(), typeDef);
- }
-
- if (logger.isDebugEnabled())
- {
- logger.debug("Registered type " + typeDef.getTypeId() + " (scope=" + typeDef.getTypeId().getScope() + ", public=" + typeDef.isPublic() + ")");
- logger.debug(" QName: " + typeDef.getTypeId().getQName());
- logger.debug(" Table: " + typeDef.getQueryName());
- logger.debug(" Action Evaluators: " + typeDef.getActionEvaluators().size());
- }
- }
-
- /**
- * Registry Property Definition
- *
- * @param propDef
- */
- public void registerPropertyDefinition(CMISPropertyDefinition propDef)
- {
- CMISPropertyDefinition existingPropDef = propDefsByPropId.get(propDef.getPropertyId());
- if (existingPropDef != null)
- {
- throw new AlfrescoRuntimeException("Property " + propDef.getPropertyId() + " of " + propDef.getOwningType().getTypeId() + " already registered by type " + existingPropDef.getOwningType().getTypeId());
- }
-
- propDefsByPropId.put(propDef.getPropertyId(), propDef);
- propDefsByQName.put(propDef.getPropertyId().getQName(), propDef);
- propDefsById.put(propDef.getPropertyId().getId().toLowerCase(), propDef);
- propDefsByQueryName.put(propDef.getQueryName().toLowerCase(), propDef);
-
- if (logger.isDebugEnabled())
- {
- logger.debug("Registered property " + propDef.getPropertyId().getId());
- logger.debug(" QName: " + propDef.getPropertyId().getQName());
- logger.debug(" Id: " + propDef.getPropertyId().getId());
- logger.debug(" Owning Type: " + propDef.getOwningType().getTypeId());
- logger.debug(" Property Accessor: " + propDef.getPropertyAccessor() + " , mappedProperty=" + propDef.getPropertyAccessor().getMappedProperty());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("DictionaryRegistry[");
- builder.append("Types=").append(typeDefsByTypeId.size()).append(", ");
- builder.append("Base Types=").append(baseTypes.size()).append(", ");
- builder.append("Properties=").append(propDefsByPropId.size());
- builder.append("]");
- return builder.toString();
- }
- }
-
- protected DictionaryRegistry getRegistry()
- {
- return getRegistryImpl();
- }
-
- protected DictionaryRegistry getRegistryImpl()
- {
- DictionaryRegistry registry = null;
-
- registryReadLock.lock();
- try
- {
- registry = singletonCache.get(KEY_CMIS_DICTIONARY_REGISTRY);
- }
- finally
- {
- registryReadLock.unlock();
- }
-
- if (registry == null)
- {
- init();
- registry = singletonCache.get(KEY_CMIS_DICTIONARY_REGISTRY);
- }
- return registry;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISDictionaryService#findType(org.alfresco.cmis.dictionary.CMISTypeId)
- */
- public CMISTypeDefinition findType(CMISTypeId typeId)
- {
- return getRegistry().objectDefsByTypeId.get(typeId);
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISDictionaryService#findType(java.lang.String)
- */
- public CMISTypeDefinition findType(String typeId)
- {
- CMISTypeId cmisTypeId = cmisMapping.getCmisTypeId(typeId);
- return findType(cmisTypeId);
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISDictionaryService#findTypeForClass(org.alfresco.service.namespace.QName, org.alfresco.cmis.dictionary.CMISScope[])
- */
- public CMISTypeDefinition findTypeForClass(QName clazz, CMISScope... matchingScopes)
- {
- // searching for relationship
- boolean scopeByRelationship = false;
- for (CMISScope scope : matchingScopes)
- {
- if (scope == CMISScope.RELATIONSHIP)
- {
- scopeByRelationship = true;
- break;
- }
- }
-
- // locate type in registry
- CMISTypeDefinition typeDef = null;
- if (scopeByRelationship)
- {
- typeDef = getRegistry().assocDefsByQName.get(clazz);
- }
- else
- {
- typeDef = getRegistry().typeDefsByQName.get(clazz);
- if (typeDef == null)
- {
- typeDef = getRegistry().assocDefsByQName.get(clazz);
- }
- }
-
- // ensure matches one of provided matching scopes
- CMISTypeDefinition matchingTypeDef = (matchingScopes.length == 0) ? typeDef : null;
- if (typeDef != null)
- {
- for (CMISScope scope : matchingScopes)
- {
- if (typeDef.getTypeId().getScope() == scope)
- {
- matchingTypeDef = typeDef;
- break;
- }
- }
- }
-
- return matchingTypeDef;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISDictionaryService#findTypeForTable(java.lang.String)
- */
- public CMISTypeDefinition findTypeByQueryName(String queryName)
- {
- CMISTypeDefinition typeDef = getRegistry().typeDefsByQueryName.get(queryName.toLowerCase());
- return typeDef;
- }
-
-
- /* (non-Javadoc)
- * @see org.alfresco.cmis.CMISDictionaryService#findPropertyByQueryName(java.lang.String)
- */
- public CMISPropertyDefinition findPropertyByQueryName(String queryName)
- {
- CMISPropertyDefinition propertyDef = getRegistry().propDefsByQueryName.get(queryName.toLowerCase());
- return propertyDef;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISDictionaryService#getBaseTypes()
- */
- public Collection getBaseTypes()
- {
- return Collections.unmodifiableCollection(getRegistry().baseTypes);
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISDictionaryService#getAllTypes()
- */
- public Collection getAllTypes()
- {
- return Collections.unmodifiableCollection(getRegistry().typeDefsByTypeId.values());
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISDictionaryService#getProperty(org.alfresco.service.namespace.QName, org.alfresco.cmis.dictionary.CMISTypeDefinition)
- */
- public CMISPropertyDefinition findProperty(QName property, CMISTypeDefinition matchingType)
- {
- CMISPropertyDefinition propDef = getRegistry().propDefsByQName.get(property);
- return getProperty(propDef, matchingType);
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISDictionaryService#getProperty(java.lang.String, org.alfresco.cmis.dictionary.CMISTypeDefinition)
- */
- public CMISPropertyDefinition findProperty(String property, CMISTypeDefinition matchingType)
- {
- CMISPropertyDefinition propDef = getRegistry().propDefsById.get(property.toLowerCase());
- return getProperty(propDef, matchingType);
- }
-
- /**
- * Return property definition if part of specified type definition
- *
- * @param property
- * @param matchingType
- * @return property definition (if matches), or null (if not matches)
- */
- private CMISPropertyDefinition getProperty(CMISPropertyDefinition property, CMISTypeDefinition matchingType)
- {
- boolean isMatchingType = (matchingType == null);
- if (property != null && matchingType != null)
- {
- Map props = matchingType.getPropertyDefinitions();
- if (props.containsKey(property.getPropertyId().getId()))
- {
- isMatchingType = true;
- }
- }
- return isMatchingType ? property : null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISDictionaryService#getDataType(org.alfresco.service.namespace.QName)
- */
- public CMISDataTypeEnum findDataType(QName dataType)
- {
- return cmisMapping.getDataType(dataType);
- }
-
-
- /**
- * Factory for creating CMIS Definitions
- *
- * @param registry
- */
- abstract protected void createDefinitions(DictionaryRegistry registry);
-
-
- /**
- * Dictionary Initialisation - creates a new registry
- */
- private void init()
- {
- registryWriteLock.lock();
- try
- {
- DictionaryRegistry registry = new DictionaryRegistry();
-
- if (logger.isDebugEnabled())
- logger.debug("Creating type definitions...");
-
- // phase 1: construct type definitions
- createDefinitions(registry);
- for (CMISAbstractTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values())
- {
- Map propDefs = objectTypeDef.createProperties(cmisMapping, dictionaryService);
- for (CMISPropertyDefinition propDef : propDefs.values())
- {
- registry.registerPropertyDefinition(propDef);
- }
- objectTypeDef.createSubTypes(cmisMapping, dictionaryService);
- }
-
- if (logger.isDebugEnabled())
- logger.debug("Linking type definitions...");
-
- // phase 2: link together
- for (CMISAbstractTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values())
- {
- objectTypeDef.resolveDependencies(registry);
- }
-
- if (logger.isDebugEnabled())
- logger.debug("Resolving type inheritance...");
-
- // phase 3: resolve inheritance
- Map> order = new TreeMap>();
- for (CMISAbstractTypeDefinition typeDef : registry.objectDefsByTypeId.values())
- {
- // calculate class depth in hierarchy
- int depth = 0;
- CMISAbstractTypeDefinition parent = typeDef.getInternalParentType();
- while (parent != null)
- {
- depth = depth +1;
- parent = parent.getInternalParentType();
- }
-
- // map class to depth
- List classes = order.get(depth);
- if (classes == null)
- {
- classes = new ArrayList();
- order.put(depth, classes);
- }
- classes.add(typeDef);
- }
- for (int depth = 0; depth < order.size(); depth++)
- {
- for (CMISAbstractTypeDefinition typeDef : order.get(depth))
- {
- typeDef.resolveInheritance(registry);
- }
- }
-
- // phase 4: assert valid
- for (CMISAbstractTypeDefinition typeDef : registry.objectDefsByTypeId.values())
- {
- typeDef.assertComplete();
- }
-
- // phase 5: register base types
- for (CMISAbstractTypeDefinition typeDef : registry.objectDefsByTypeId.values())
- {
- if (typeDef.isPublic() && typeDef.getParentType() == null)
- {
- registry.baseTypes.add(typeDef);
- }
- }
-
- // publish new registry
- singletonCache.put(KEY_CMIS_DICTIONARY_REGISTRY, registry);
-
- if (logger.isInfoEnabled())
- logger.info("Initialized CMIS Dictionary. Types:" + registry.typeDefsByTypeId.size() + ", Base Types:" + registry.baseTypes.size() + ", Properties:" + registry.propDefsByPropId.size());
- }
- finally
- {
- registryWriteLock.unlock();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.repo.dictionary.DictionaryListener#onInit()
- */
- public void onDictionaryInit()
- {
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.repo.dictionary.DictionaryListener#afterInit()
- */
- public void afterDictionaryInit()
- {
- init();
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.repo.dictionary.DictionaryListener#afterDictionaryDestroy()
- */
- public void afterDictionaryDestroy()
- {
- registryWriteLock.lock();
- try
- {
- singletonCache.remove(KEY_CMIS_DICTIONARY_REGISTRY);
- }
- finally
- {
- registryWriteLock.unlock();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.extensions.surf.util.AbstractLifecycleBean#onBootstrap(org.springframework.context.ApplicationEvent)
- */
- protected void onBootstrap(ApplicationEvent event)
- {
- afterDictionaryInit();
-
- // TODO revisit (for KS and/or 1.1)
- if (dictionaryDAO != null)
- {
- dictionaryDAO.register(this);
- }
- else
- {
- logger.error("DictionaryDAO is null - hence CMIS Dictionary not registered for updates");
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.extensions.surf.util.AbstractLifecycleBean#onShutdown(org.springframework.context.ApplicationEvent)
- */
- protected void onShutdown(ApplicationEvent event)
- {
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISAbstractTypeDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISAbstractTypeDefinition.java
deleted file mode 100644
index a45c160c2a..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISAbstractTypeDefinition.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-
-import org.alfresco.cmis.CMISActionEvaluator;
-import org.alfresco.cmis.CMISAllowedActionEnum;
-import org.alfresco.cmis.CMISContentStreamAllowedEnum;
-import org.alfresco.cmis.CMISPropertyDefinition;
-import org.alfresco.cmis.CMISPropertyId;
-import org.alfresco.cmis.CMISTypeDefinition;
-import org.alfresco.cmis.CMISTypeId;
-import org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.DictionaryRegistry;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.error.AlfrescoRuntimeException;
-import org.alfresco.service.cmr.dictionary.ClassDefinition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.cmr.dictionary.PropertyDefinition;
-import org.alfresco.service.namespace.QName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-
-/**
- * CMIS Object Type Definition
- *
- * @author davidc
- */
-public abstract class CMISAbstractTypeDefinition implements CMISTypeDefinition, Serializable
-{
- // Logger
- protected static final Log logger = LogFactory.getLog(CMISAbstractTypeDefinition.class);
-
- private static final long serialVersionUID = -3131505923356013430L;
-
- // Object type properties
- protected Boolean isPublic = null;
- protected ClassDefinition cmisClassDef = null;
- protected CMISTypeId objectTypeId = null;
- protected String objectTypeQueryName = null;
- protected String displayName = null;
- protected CMISTypeId parentTypeId = null;
- protected CMISTypeDefinition parentType = null;
- protected CMISAbstractTypeDefinition internalParentType = null;
- protected CMISTypeDefinition rootType = null;
- protected String description = null;
- protected Boolean creatable = null;
- protected Boolean queryable = null;
- protected Boolean fullTextIndexed = null;
- protected Boolean controllablePolicy = null;
- protected Boolean controllableACL = null;
- protected Boolean includedInSuperTypeQuery = null;
- protected Collection subTypeIds = null;
- protected Collection subTypes = null;
- protected Map properties = null;
- protected Map inheritedProperties = null;
- protected Map ownedProperties = null;
- protected Map> actionEvaluators = null;
-
-
- /*package*/ void assertComplete()
- {
- if (objectTypeId == null) throw new IllegalStateException("objectTypeId not specified");
- if (isPublic == null) throw new IllegalStateException("isPublic not specified; objectTypeId=" + objectTypeId);
- //if (cmisClassDef == null) throw new IllegalStateException("cmisClassDef not specified; objectTypeId=" + objectTypeId);
- if (objectTypeQueryName == null) throw new IllegalStateException("objectTypeQueryName not specified; objectTypeId=" + objectTypeId);
- if (displayName == null) throw new IllegalStateException("displayName not specified; objectTypeId=" + objectTypeId);
- //if (parentTypeId == null) throw new IllegalStateException("parentTypeId not specified; objectTypeId=" + objectTypeId);
- if (parentTypeId != null && internalParentType == null) throw new IllegalStateException("parentType not specified; objectTypeId=" + objectTypeId + ",parentTypeId=" + parentTypeId);
- if (rootType == null) throw new IllegalStateException("rootType not specified; objectTypeId=" + objectTypeId);
- if (description == null) throw new IllegalStateException("description not specified; objectTypeId=" + objectTypeId);
- if (creatable == null) throw new IllegalStateException("creatable not specified; objectTypeId=" + objectTypeId);
- if (queryable == null) throw new IllegalStateException("queryable not specified; objectTypeId=" + objectTypeId);
- if (fullTextIndexed == null) throw new IllegalStateException("fullTextIndexed not specified; objectTypeId=" + objectTypeId);
- if (controllablePolicy == null) throw new IllegalStateException("controllablePolicy not specified; objectTypeId=" + objectTypeId);
- if (controllableACL == null) throw new IllegalStateException("controllablePolicy not specified; objectTypeId=" + objectTypeId);
- if (includedInSuperTypeQuery == null) throw new IllegalStateException("includedInSuperTypeQuery not specified; objectTypeId=" + objectTypeId);
- if (subTypeIds == null) throw new IllegalStateException("subTypeIds not specified; objectTypeId=" + objectTypeId);
- if (subTypes == null) throw new IllegalStateException("subTypes not specified; objectTypeId=" + objectTypeId);
- if (properties == null) throw new IllegalStateException("properties not specified; objectTypeId=" + objectTypeId);
- if (inheritedProperties == null) throw new IllegalStateException("inheritedProperties not specified; objectTypeId=" + objectTypeId);
- if (ownedProperties == null) throw new IllegalStateException("inheritedProperties not specified; objectTypeId=" + objectTypeId);
- if (actionEvaluators == null) throw new IllegalStateException("actionEvaluators not specified; objectTypeId=" + objectTypeId);
- }
-
-
- /**
- * Construct
- *
- * @param cmisMapping
- * @param dictionaryService
- * @return
- */
- /*package*/ Map createProperties(CMISMapping cmisMapping, DictionaryService dictionaryService)
- {
- // map properties directly defined on this type
- properties = new HashMap();
- for (PropertyDefinition propDef : cmisClassDef.getProperties().values())
- {
- if (propDef.getContainerClass().equals(cmisClassDef) && !propDef.isOverride())
- {
- if (cmisMapping.getDataType(propDef.getDataType()) != null)
- {
- CMISPropertyDefinition cmisPropDef = createProperty(cmisMapping, dictionaryService, propDef);
- properties.put(cmisPropDef.getPropertyId().getId(), cmisPropDef);
- }
- }
- }
-
- return properties;
- }
-
- /**
- * Create Property Definition
- *
- * @param cmisMapping
- * @param propDef
- * @return
- */
- private CMISPropertyDefinition createProperty(CMISMapping cmisMapping, DictionaryService dictionaryService, PropertyDefinition propDef)
- {
- QName propertyQName = propDef.getName();
- String propertyId = cmisMapping.getCmisPropertyId(propertyQName);
- CMISPropertyId cmisPropertyId = new CMISPropertyId(propertyQName, propertyId);
- return new CMISBasePropertyDefinition(cmisMapping, cmisPropertyId, dictionaryService, propDef, this);
- }
-
- /**
- * Create Sub Types
- *
- * @param cmisMapping
- * @param dictionaryService
- */
- /*package*/ void createSubTypes(CMISMapping cmisMapping, DictionaryService dictionaryService)
- {
- subTypeIds = new ArrayList();
- Collection subTypes = dictionaryService.getSubTypes(objectTypeId.getQName(), false);
- for (QName subType : subTypes)
- {
- if (cmisMapping.isValidCmisDocumentOrFolder(subType))
- {
- CMISTypeId subTypeId = cmisMapping.getCmisTypeId(subType);
- if (subTypeId != null)
- {
- subTypeIds.add(subTypeId);
- }
- }
- }
- }
-
- /**
- * Resolve Dependencies
- *
- * @param registry
- */
- /*package*/ void resolveDependencies(DictionaryRegistry registry)
- {
- if (parentTypeId != null)
- {
- internalParentType = registry.objectDefsByTypeId.get(parentTypeId);
- if (internalParentType == null)
- {
- throw new AlfrescoRuntimeException("Failed to retrieve parent type for type id " + parentTypeId);
- }
- if (internalParentType.isPublic() == isPublic)
- {
- parentType = internalParentType;
- }
- }
-
- if (logger.isDebugEnabled())
- logger.debug("Type " + objectTypeId + ": parent=" + (parentType == null ? "" : parentType.getTypeId()) +
- ", internal parent=" + (internalParentType == null ? "" : internalParentType.getTypeId()));
-
- CMISTypeId rootTypeId = objectTypeId.getBaseTypeId();
- if (rootTypeId != null)
- {
- rootType = registry.objectDefsByTypeId.get(rootTypeId);
- if (rootType == null)
- {
- throw new AlfrescoRuntimeException("Failed to retrieve root type for type id " + rootTypeId);
- }
- }
-
- if (logger.isDebugEnabled())
- logger.debug("Type " + objectTypeId + ": root=" + rootType.getTypeId());
-
- subTypes = new ArrayList();
- for (CMISTypeId subTypeId : subTypeIds)
- {
- CMISTypeDefinition subType = registry.objectDefsByTypeId.get(subTypeId);
- if (subType == null)
- {
- throw new AlfrescoRuntimeException("Failed to retrieve sub type for type id " + subTypeId + " for parent type " + objectTypeId);
- }
- if (subType.isPublic() == isPublic)
- {
- subTypes.add(subType);
-
- if (logger.isDebugEnabled())
- logger.debug("Type " + objectTypeId + ": subtype=" + subType.getTypeId());
- }
- }
- }
-
- /**
- * Resolve Inheritance
- *
- * @param registry
- */
- /*package*/ void resolveInheritance(DictionaryRegistry registry)
- {
- inheritedProperties = new HashMap();
- ownedProperties = new HashMap();
- inheritedProperties.putAll(properties);
- ownedProperties.putAll(properties);
- if (internalParentType != null)
- {
- inheritedProperties.putAll(internalParentType.getPropertyDefinitions());
-
- // collapse all internal inherited properties into owned properties
- if (internalParentType.isPublic != isPublic)
- {
- ownedProperties.putAll(internalParentType.getPropertyDefinitions());
- }
-
- if (logger.isDebugEnabled())
- logger.debug("Type " + objectTypeId + " inheriting properties: " + internalParentType.getPropertyDefinitions().size() + " from " + internalParentType.getTypeId());
- }
-
- if (logger.isDebugEnabled())
- logger.debug("Type " + objectTypeId + " properties: " + inheritedProperties.size() + ", owned: " + ownedProperties.size());
- }
-
- /**
- * Get internal parent type
- *
- * @return
- */
- public CMISAbstractTypeDefinition getInternalParentType()
- {
- return internalParentType;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isPublic()
- */
- public boolean isPublic()
- {
- return isPublic;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getTypeId()
- */
- public CMISTypeId getTypeId()
- {
- return objectTypeId;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getQueryName()
- */
- public String getQueryName()
- {
- return objectTypeQueryName;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getDisplayName()
- */
- public String getDisplayName()
- {
- return displayName;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getParentType()
- */
- public CMISTypeDefinition getParentType()
- {
- return parentType;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getRootType()
- */
- public CMISTypeDefinition getBaseType()
- {
- return rootType;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getSubTypes(boolean)
- */
- public Collection getSubTypes(boolean includeDescendants)
- {
- if (!includeDescendants)
- {
- return subTypes;
- }
-
- // recurse sub-type hierarchy
- Collection descendants = new ArrayList();
- LinkedList stack = new LinkedList();
- stack.addLast(this);
- while (stack.size() > 0)
- {
- CMISTypeDefinition current = stack.removeLast();
- if (!current.equals(this)) // do not add this type
- {
- descendants.add(current);
- }
-
- // descend...
- for (CMISTypeDefinition type : current.getSubTypes(false))
- {
- stack.addLast(type);
- }
- }
- return descendants;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getDescription()
- */
- public String getDescription()
- {
- return description;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isCreatable()
- */
- public boolean isCreatable()
- {
- return creatable;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isQueryable()
- */
- public boolean isQueryable()
- {
- return queryable;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISTypeDefinition#isFullTextIndexed()
- */
- public boolean isFullTextIndexed()
- {
- return fullTextIndexed;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isControllable()
- */
- public boolean isControllablePolicy()
- {
- return controllablePolicy;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISTypeDefinition#isControllableACL()
- */
- public boolean isControllableACL()
- {
- return controllableACL;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isIncludedInSuperTypeQuery()
- */
- public boolean isIncludedInSuperTypeQuery()
- {
- return includedInSuperTypeQuery;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getPropertyDefinitions()
- */
- public Map getPropertyDefinitions()
- {
- return inheritedProperties;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getOwnedPropertyDefinitions()
- */
- public Map getOwnedPropertyDefinitions()
- {
- return ownedProperties;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISTypeDefinition#getActionEvaluators()
- */
- public Map> getActionEvaluators()
- {
- return actionEvaluators;
- }
-
- //
- // Document Type specific
- //
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isFileable()
- */
- public boolean isFileable()
- {
- return false;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isVersionable()
- */
- public boolean isVersionable()
- {
- return false;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getContentStreamAllowed()
- */
- public CMISContentStreamAllowedEnum getContentStreamAllowed()
- {
- return CMISContentStreamAllowedEnum.NOT_ALLOWED;
- }
-
- //
- // Relationship Type specific
- //
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getAllowedSourceTypes()
- */
- public Collection getAllowedSourceTypes()
- {
- return Collections.emptyList();
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getAllowedTargetTypes()
- */
- public Collection getAllowedTargetTypes()
- {
- return Collections.emptyList();
- }
-
- @Override
- public int hashCode()
- {
- return objectTypeId.hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final CMISTypeDefinition other = (CMISTypeDefinition) obj;
- if (objectTypeId == null)
- {
- if (other.getTypeId() != null)
- return false;
- }
- else if (!objectTypeId.equals(other.getTypeId()))
- return false;
- return true;
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISBasePropertyDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISBasePropertyDefinition.java
deleted file mode 100644
index f5b76788d3..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISBasePropertyDefinition.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.alfresco.cmis.CMISCardinalityEnum;
-import org.alfresco.cmis.CMISChoice;
-import org.alfresco.cmis.CMISDataTypeEnum;
-import org.alfresco.cmis.CMISDictionaryModel;
-import org.alfresco.cmis.CMISPropertyAccessor;
-import org.alfresco.cmis.CMISPropertyDefinition;
-import org.alfresco.cmis.CMISPropertyId;
-import org.alfresco.cmis.CMISTypeDefinition;
-import org.alfresco.cmis.CMISUpdatabilityEnum;
-import org.alfresco.cmis.mapping.AbstractProperty;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.opencmis.dictionary.CMISPropertyLuceneBuilder;
-import org.alfresco.repo.dictionary.IndexTokenisationMode;
-import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint;
-import org.alfresco.repo.dictionary.constraint.NumericRangeConstraint;
-import org.alfresco.repo.dictionary.constraint.StringLengthConstraint;
-import org.alfresco.service.cmr.dictionary.Constraint;
-import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
-import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.cmr.dictionary.PropertyDefinition;
-import org.alfresco.util.ISO9075;
-
-/**
- * CMIS Property Definition
- *
- * @author andyh
- */
-public class CMISBasePropertyDefinition implements CMISPropertyDefinition, Serializable
-{
- private static final long serialVersionUID = -8119257313852558466L;
-
- // Properties of Property
- private CMISTypeDefinition typeDef;
-
- private CMISPropertyId propertyId;
-
- private String queryName;
-
- private String displayName;
-
- private String description;
-
- private CMISDataTypeEnum propertyType;
-
- private CMISCardinalityEnum cardinality;
-
- private Double minValue = null;
-
- private Double maxValue = null;
-
- private int maximumLength = -1;
-
- private Collection choices = new HashSet();
-
- private boolean isOpenChoice = false;
-
- private boolean required;
-
- private String defaultValue;
-
- private CMISUpdatabilityEnum updatability;
-
- private boolean queryable;
-
- private boolean orderable;
-
- private AbstractProperty propertyAccessor;
-
- /**
- * Construct
- *
- * @param cmisMapping
- * @param propertyId
- * @param propDef
- * @param typeDef
- */
- public CMISBasePropertyDefinition(CMISMapping cmisMapping, CMISPropertyId propertyId, DictionaryService dictionaryService, PropertyDefinition propDef,
- CMISTypeDefinition typeDef)
- {
- this.propertyId = propertyId;
- this.typeDef = typeDef;
- queryName = ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(propertyId.getQName()));
- displayName = (propDef.getTitle(dictionaryService) != null) ? propDef.getTitle(dictionaryService) : propertyId.getId();
- description = propDef.getDescription(dictionaryService) != null ? propDef.getDescription(dictionaryService) : displayName;
- propertyType = cmisMapping.getDataType(propDef.getDataType());
- cardinality = propDef.isMultiValued() ? CMISCardinalityEnum.MULTI_VALUED : CMISCardinalityEnum.SINGLE_VALUED;
- for (ConstraintDefinition constraintDef : propDef.getConstraints())
- {
- Constraint constraint = constraintDef.getConstraint();
- if (constraint instanceof ListOfValuesConstraint)
- {
- int position = 1; // CMIS is 1 based (according to XSDs)
- ListOfValuesConstraint lovc = (ListOfValuesConstraint) constraint;
- for (String allowed : lovc.getAllowedValues())
- {
- CMISChoice choice = new CMISChoice(allowed, allowed, position++);
- choices.add(choice);
- }
- }
- if (constraint instanceof StringLengthConstraint)
- {
- StringLengthConstraint slc = (StringLengthConstraint) constraint;
- maximumLength = slc.getMaxLength();
- }
- if (constraint instanceof NumericRangeConstraint)
- {
- NumericRangeConstraint nrc = (NumericRangeConstraint) constraint;
- minValue = nrc.getMinValue();
- maxValue = nrc.getMaxValue();
- }
- }
- required = propDef.isMandatory();
- defaultValue = propDef.getDefaultValue();
- if (propertyId.getId().equals(CMISDictionaryModel.PROP_OBJECT_TYPE_ID)
- || propertyId.getId().equals(CMISDictionaryModel.PROP_SOURCE_ID)
- || propertyId.getId().equals(CMISDictionaryModel.PROP_TARGET_ID))
- {
- // Fix http://issues.alfresco.com/jira/browse/ALF-2637
- updatability = CMISUpdatabilityEnum.ON_CREATE;
- } else
- {
- updatability = propDef.isProtected() ? CMISUpdatabilityEnum.READ_ONLY : CMISUpdatabilityEnum.READ_AND_WRITE;
- }
- queryable = propDef.isIndexed();
- if (queryable)
- {
- if (cardinality == CMISCardinalityEnum.SINGLE_VALUED)
- {
- IndexTokenisationMode indexTokenisationMode = IndexTokenisationMode.TRUE;
- if (propDef.getIndexTokenisationMode() != null)
- {
- indexTokenisationMode = propDef.getIndexTokenisationMode();
- }
- switch (indexTokenisationMode)
- {
- case BOTH:
- case FALSE:
- orderable = true;
- break;
- case TRUE:
- default:
- if (propDef.getDataType().getName().equals(DataTypeDefinition.BOOLEAN)
- || propDef.getDataType().getName().equals(DataTypeDefinition.DATE)
- || propDef.getDataType().getName().equals(DataTypeDefinition.DATETIME)
- || propDef.getDataType().getName().equals(DataTypeDefinition.DOUBLE)
- || propDef.getDataType().getName().equals(DataTypeDefinition.FLOAT)
- || propDef.getDataType().getName().equals(DataTypeDefinition.INT)
- || propDef.getDataType().getName().equals(DataTypeDefinition.LONG)
- || propDef.getDataType().getName().equals(DataTypeDefinition.PATH)
- )
- {
- orderable = true;
- }
- else
- {
- orderable = false;
- }
- }
- } else
- {
- orderable = false;
- }
- } else
- {
- orderable = false;
- }
- propertyAccessor = cmisMapping.getPropertyAccessor(propertyId);
- }
-
- /**
- * Get Property Id
- *
- * @return
- */
- public CMISPropertyId getPropertyId()
- {
- return propertyId;
- }
-
- /**
- * Get Owning Type
- *
- * @return
- */
- public CMISTypeDefinition getOwningType()
- {
- return typeDef;
- }
-
- /**
- * Get the query name
- *
- * @return
- */
- public String getQueryName()
- {
- return queryName;
- }
-
- /**
- * Get the display name
- *
- * @return
- */
- public String getDisplayName()
- {
- return displayName;
- }
-
- /**
- * Get the description
- *
- * @return
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Get the property type
- *
- * @return
- */
- public CMISDataTypeEnum getDataType()
- {
- return propertyType;
- }
-
- /**
- * Get the cardinality
- *
- * @return
- */
- public CMISCardinalityEnum getCardinality()
- {
- return cardinality;
- }
-
- /**
- * For variable length properties, get the maximum length allowed.
- * Unsupported.
- *
- * @return
- */
- public int getMaximumLength()
- {
- return maximumLength;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.CMISPropertyDefinition#getMinValue()
- */
- public Double getMinValue()
- {
- return minValue;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.CMISPropertyDefinition#getMaxValue()
- */
- public Double getMaxValue()
- {
- return maxValue;
- }
-
- /**
- * Get the choices available as values for this property TODO: not
- * implemented yet
- *
- * @return
- */
- public Collection getChoices()
- {
- return choices;
- }
-
- /**
- * Is this a choice where a user can enter other values (ie a list with
- * common options)
- *
- * @return
- */
- public boolean isOpenChoice()
- {
- return isOpenChoice;
- }
-
- /**
- * Is this property required?
- *
- * @return
- */
- public boolean isRequired()
- {
- return required;
- }
-
- /**
- * get the default value as a String
- *
- * @return
- */
- public String getDefaultValue()
- {
- return defaultValue;
- }
-
- /**
- * Is this property updatable?
- *
- * @return
- */
- public CMISUpdatabilityEnum getUpdatability()
- {
- return updatability;
- }
-
- /**
- * Is this property queryable?
- *
- * @return
- */
- public boolean isQueryable()
- {
- return queryable;
- }
-
- /**
- * Is this property orderable in queries?
- *
- * @return
- */
- public boolean isOrderable()
- {
- return orderable;
- }
-
- /**
- * Gets the property accessor (for reading / writing values)
- *
- * @return
- */
- public CMISPropertyAccessor getPropertyAccessor()
- {
- return propertyAccessor;
- }
-
- /**
- * Gets the property Lucene builder
- *
- * @return
- */
- public CMISPropertyLuceneBuilder getPropertyLuceneBuilder()
- {
- return propertyAccessor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("CMISPropertyDefinition[");
- builder.append("OwningTypeId=").append(getOwningType().getTypeId()).append(", ");
- builder.append("Id=").append(getPropertyId().getId()).append(", ");
- builder.append("LocalName=").append(getPropertyId().getLocalName()).append(", ");
- builder.append("Namespace=").append(getPropertyId().getLocalNamespace()).append(", ");
- builder.append("InternalQName=").append(getPropertyId().getQName()).append(", ");
- builder.append("QueryName=").append(getQueryName()).append(", ");
- builder.append("DisplayName=").append(getDisplayName()).append(", ");
- builder.append("Description=").append(getDescription()).append(", ");
- builder.append("PropertyType=").append(getDataType()).append(", ");
- builder.append("Cardinality=").append(getCardinality()).append(", ");
- builder.append("MaximumLength=").append(getMaximumLength()).append(", ");
- builder.append("Choices=").append(getChoices()).append(", ");
- builder.append("IsOpenChoice=").append(isOpenChoice()).append(", ");
- builder.append("Required=").append(isRequired()).append(", ");
- builder.append("Default=").append(getDefaultValue()).append(", ");
- builder.append("Updatable=").append(getUpdatability()).append(", ");
- builder.append("Queryable=").append(isQueryable()).append(", ");
- builder.append("Orderable=").append(isOrderable());
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISDocumentTypeDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISDocumentTypeDefinition.java
deleted file mode 100644
index 090ba25a80..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISDocumentTypeDefinition.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import org.alfresco.cmis.CMISContentStreamAllowedEnum;
-import org.alfresco.cmis.CMISDictionaryModel;
-import org.alfresco.cmis.CMISScope;
-import org.alfresco.cmis.CMISTypeId;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.service.cmr.dictionary.ClassDefinition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.ISO9075;
-
-
-/**
- * CMIS Document Type Definition
- *
- * @author davidc
- */
-public class CMISDocumentTypeDefinition extends CMISAbstractTypeDefinition
-{
- private static final long serialVersionUID = -7209732754962781522L;
-
- // document specific properties
- protected boolean fileable;
- protected CMISContentStreamAllowedEnum contentStreamAllowed;
-
-
- /**
- * Construct
- *
- * @param cmisMapping
- * @param typeId
- * @param cmisClassDef
- */
- public CMISDocumentTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef)
- {
- isPublic = true;
-
- // Object type properties
- this.cmisClassDef = cmisClassDef;
- objectTypeId = typeId;
- displayName = (cmisClassDef.getTitle(dictionaryService) != null) ? cmisClassDef.getTitle(dictionaryService) : typeId.getId();
- description = cmisClassDef.getDescription(dictionaryService) != null ? cmisClassDef.getDescription(dictionaryService) : displayName;
-
- QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
- if (typeId == CMISDictionaryModel.DOCUMENT_TYPE_ID)
- {
- objectTypeQueryName = typeId.getId();
- if (parentQName != null)
- {
- parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
- }
- }
- else
- {
- objectTypeQueryName = ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(typeId.getQName()));
- if (cmisMapping.isValidCmisDocument(parentQName))
- {
- parentTypeId = cmisMapping.getCmisTypeId(CMISScope.DOCUMENT, parentQName);
- }
- }
-
- creatable = true;
- queryable = true;
- fullTextIndexed = true;
- controllablePolicy = false;
- controllableACL = true;
- includedInSuperTypeQuery = cmisClassDef.getIncludedInSuperTypeQuery();
-
- actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
-
- fileable = true;
- contentStreamAllowed = CMISContentStreamAllowedEnum.ALLOWED;
- }
-
- /**
- * Are objects of this type fileable?
- *
- * @return
- */
- public boolean isFileable()
- {
- return fileable;
- }
-
- /**
- * Is this type versionable? If true this implies all instances of the type are versionable.
- *
- * @return true if versionable
- */
- public boolean isVersionable()
- {
- // Documents and their subtypes are versionable
- return true;
- }
-
- /**
- * Is a content stream allowed for this type? It may be disallowed, optional or mandatory.
- *
- * @return
- */
- public CMISContentStreamAllowedEnum getContentStreamAllowed()
- {
- return contentStreamAllowed;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("CMISDocumentTypeDefinition[");
- builder.append("Id=").append(getTypeId().getId()).append(", ");
- builder.append("Namespace=").append(getTypeId().getLocalNamespace()).append(", ");
- builder.append("LocalName=").append(getTypeId().getLocalName()).append(", ");
- builder.append("QueryName=").append(getQueryName()).append(", ");
- builder.append("DisplayName=").append(getDisplayName()).append(", ");
- builder.append("ParentId=").append(getParentType() == null ? "" : getParentType().getTypeId()).append(", ");
- builder.append("Description=").append(getDescription()).append(", ");
- builder.append("Creatable=").append(isCreatable()).append(", ");
- builder.append("Queryable=").append(isQueryable()).append(", ");
- builder.append("FullTextIndexed=").append(isFullTextIndexed()).append(", ");
- builder.append("IncludedInSuperTypeQuery=").append(isIncludedInSuperTypeQuery()).append(", ");
- builder.append("ControllablePolicy=").append(isControllablePolicy()).append(", ");
- builder.append("ControllableACL=").append(isControllableACL()).append(", ");
- builder.append("Fileable=").append(isFileable()).append(", ");
- builder.append("Versionable=").append(isVersionable()).append(", ");
- builder.append("ContentStreamAllowed=").append(getContentStreamAllowed()).append(", ");
- builder.append("SubTypes=").append(getSubTypes(false).size()).append(", ");
- builder.append("Properties=").append(getPropertyDefinitions().size());
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISFolderTypeDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISFolderTypeDefinition.java
deleted file mode 100644
index fb9375c029..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISFolderTypeDefinition.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import org.alfresco.cmis.CMISDictionaryModel;
-import org.alfresco.cmis.CMISScope;
-import org.alfresco.cmis.CMISTypeId;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.model.ContentModel;
-import org.alfresco.service.cmr.dictionary.ClassDefinition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.ISO9075;
-
-
-/**
- * CMIS Folder Type Definition
- *
- * @author davidc
- */
-public class CMISFolderTypeDefinition extends CMISAbstractTypeDefinition
-{
- private static final long serialVersionUID = 7526155195125799106L;
-
- protected final boolean fileable = true;
-
- /**
- * Construct
- * @param cmisMapping
- * @param typeId
- * @param cmisClassDef
- */
- public CMISFolderTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef, boolean isSystem)
- {
- isPublic = true;
-
- // Object type properties
- this.cmisClassDef = cmisClassDef;
- objectTypeId = typeId;
- displayName = (cmisClassDef.getTitle(dictionaryService) != null) ? cmisClassDef.getTitle(dictionaryService) : typeId.getId();
- description = cmisClassDef.getDescription(dictionaryService) != null ? cmisClassDef.getDescription(dictionaryService) : displayName;
-
- QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
- if (typeId == CMISDictionaryModel.FOLDER_TYPE_ID)
- {
- objectTypeQueryName = typeId.getId();
- if (parentQName != null)
- {
- parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
- }
- }
- else
- {
- objectTypeQueryName = ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(typeId.getQName()));
- if (cmisMapping.isValidCmisFolder(parentQName))
- {
- parentTypeId = cmisMapping.getCmisTypeId(CMISScope.FOLDER, parentQName);
- }
- }
-
- actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
-
- // TODO: introduce abstract into core alfresco content metamodel
- creatable = !isSystem;
- queryable = true;
- fullTextIndexed = true;
- controllablePolicy = false;
- controllableACL = true;
- includedInSuperTypeQuery = cmisClassDef.getIncludedInSuperTypeQuery();
- }
-
- /**
- * Are objects of this type fileable?
- *
- * @return
- */
- public boolean isFileable()
- {
- return fileable;
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("CMISFolderTypeDefinition[");
- builder.append("Id=").append(getTypeId().getId()).append(", ");
- builder.append("Namespace=").append(getTypeId().getLocalNamespace()).append(", ");
- builder.append("LocalName=").append(getTypeId().getLocalName()).append(", ");
- builder.append("QueryName=").append(getQueryName()).append(", ");
- builder.append("DisplayName=").append(getDisplayName()).append(", ");
- builder.append("ParentId=").append(getParentType() == null ? "" : getParentType().getTypeId()).append(", ");
- builder.append("Description=").append(getDescription()).append(", ");
- builder.append("Creatable=").append(isCreatable()).append(", ");
- builder.append("Queryable=").append(isQueryable()).append(", ");
- builder.append("FullTextIndexed=").append(isFullTextIndexed()).append(", ");
- builder.append("IncludedInSuperTypeQuery=").append(isIncludedInSuperTypeQuery()).append(", ");
- builder.append("ControllablePolicy=").append(isControllablePolicy()).append(", ");
- builder.append("ControllableACL=").append(isControllableACL()).append(", ");
- builder.append("Fileable=").append(isFileable()).append(", ");
- builder.append("SubTypes=").append(getSubTypes(false).size()).append(", ");
- builder.append("Properties=").append(getPropertyDefinitions().size());
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISObjectTypeDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISObjectTypeDefinition.java
deleted file mode 100644
index 8179348f50..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISObjectTypeDefinition.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.alfresco.cmis.CMISScope;
-import org.alfresco.cmis.CMISTypeId;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.service.cmr.dictionary.ClassDefinition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.ISO9075;
-
-
-/**
- * CMIS Object Type Definition
- *
- * @author davidc
- */
-public class CMISObjectTypeDefinition extends CMISAbstractTypeDefinition
-{
- private static final long serialVersionUID = -3131505923356013430L;
-
-
- /**
- * Construct
- *
- * @param cmisMapping
- * @param typeId
- * @param cmisClassDef
- */
- public CMISObjectTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef, boolean isPublic)
- {
- this.isPublic = isPublic;
-
- // Object type properties
- objectTypeId = typeId;
- objectTypeQueryName = ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(typeId.getQName()));
-
- if (cmisClassDef != null)
- {
- this.cmisClassDef = cmisClassDef;
- displayName = (cmisClassDef.getTitle(dictionaryService) != null) ? cmisClassDef.getTitle(dictionaryService) : typeId.getId();
- description = cmisClassDef.getDescription(dictionaryService) != null ? cmisClassDef.getDescription(dictionaryService) : displayName;
- QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
- if (parentQName != null)
- {
- parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
- }
- includedInSuperTypeQuery = cmisClassDef.getIncludedInSuperTypeQuery();
- }
-
- actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
-
- creatable = false;
- queryable = false;
- fullTextIndexed = false;
- controllablePolicy = false;
- controllableACL = false;
- }
-
- /**
- * Create Sub Types
- *
- * @param cmisMapping
- * @param dictionaryService
- */
- /*package*/ void createSubTypes(CMISMapping cmisMapping, DictionaryService dictionaryService)
- {
- subTypeIds = new ArrayList();
- Collection subTypes = dictionaryService.getSubTypes(objectTypeId.getQName(), false);
- for (QName subType : subTypes)
- {
- CMISTypeId subTypeId = cmisMapping.getCmisTypeId(subType);
- if (subTypeId != null)
- {
- subTypeIds.add(subTypeId);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("CMISObjectTypeDefinition[");
- builder.append("Public=").append(isPublic()).append(", ");
- builder.append("ObjectTypeId=").append(getTypeId()).append(", ");
- builder.append("ObjectTypeQueryName=").append(getQueryName()).append(", ");
- builder.append("ObjectTypeDisplayName=").append(getDisplayName()).append(", ");
- builder.append("ParentTypeId=").append(getParentType() == null ? "" : getParentType().getTypeId()).append(", ");
- builder.append("Description=").append(getDescription()).append(", ");
- builder.append("Creatable=").append(isCreatable()).append(", ");
- builder.append("Queryable=").append(isQueryable()).append(", ");
- builder.append("Controllable=").append(isControllablePolicy()).append(", ");
- builder.append("IncludedInSuperTypeQuery=").append(isIncludedInSuperTypeQuery()).append(", ");
- builder.append("SubTypes=").append(getSubTypes(false).size()).append(", ");
- builder.append("Properties=").append(getPropertyDefinitions().size());
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISPolicyTypeDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISPolicyTypeDefinition.java
deleted file mode 100644
index b527b6bee7..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISPolicyTypeDefinition.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.alfresco.cmis.CMISDictionaryModel;
-import org.alfresco.cmis.CMISPropertyDefinition;
-import org.alfresco.cmis.CMISScope;
-import org.alfresco.cmis.CMISTypeId;
-import org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.DictionaryRegistry;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.service.cmr.dictionary.ClassDefinition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.ISO9075;
-
-
-/**
- * CMIS Policy Type Definition
- *
- * @author davidc
- */
-public class CMISPolicyTypeDefinition extends CMISAbstractTypeDefinition
-{
- private static final long serialVersionUID = 1621538303752395828L;
-
- /**
- * Construct
- *
- * @param cmisMapping
- * @param typeId
- * @param cmisClassDef
- */
- public CMISPolicyTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef)
- {
- isPublic = true;
-
- // Object Type definitions
- this.cmisClassDef = cmisClassDef;
- objectTypeId = typeId;
- displayName = (cmisClassDef.getTitle(dictionaryService) != null) ? cmisClassDef.getTitle(dictionaryService) : typeId.getId();
- if (typeId == CMISDictionaryModel.POLICY_TYPE_ID)
- {
- objectTypeQueryName = typeId.getId();
- QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
- if (parentQName != null)
- {
- parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
- }
- }
- else
- {
- objectTypeQueryName = ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(typeId.getQName()));
- parentTypeId = CMISDictionaryModel.POLICY_TYPE_ID;
- }
- description = cmisClassDef.getDescription(dictionaryService) != null ? cmisClassDef.getDescription(dictionaryService) : displayName;
-
- actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
-
- creatable = false;
- queryable = true;
- includedInSuperTypeQuery = cmisClassDef.getIncludedInSuperTypeQuery();
- fullTextIndexed = true;
- controllablePolicy = false;
- controllableACL = false;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISObjectTypeDefinition#createSubTypes(org.alfresco.cmis.dictionary.CMISMapping, org.alfresco.service.cmr.dictionary.DictionaryService)
- */
- @Override
- /*package*/ void createSubTypes(CMISMapping cmisMapping, DictionaryService dictionaryService)
- {
- subTypeIds = new ArrayList();
- if (objectTypeId.equals(CMISDictionaryModel.POLICY_TYPE_ID))
- {
- // all aspects are sub-type of POLICY_OBJECT_TYPE
- Collection aspects = dictionaryService.getAllAspects();
- for (QName aspect : aspects)
- {
- if (cmisMapping.isValidCmisPolicy(aspect))
- {
- subTypeIds.add(cmisMapping.getCmisTypeId(CMISScope.POLICY, aspect));
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISObjectTypeDefinition#resolveInheritance(org.alfresco.cmis.dictionary.AbstractCMISDictionaryService.DictionaryRegistry)
- */
- @Override
- /*package*/ void resolveInheritance(DictionaryRegistry registry)
- {
- inheritedProperties = new HashMap();
- ownedProperties = new HashMap();
- // NOTE: Force no inheritance of base Policy type
- inheritedProperties.putAll(properties);
- ownedProperties.putAll(properties);
-
- if (logger.isDebugEnabled())
- logger.debug("Type " + objectTypeId + " properties: " + inheritedProperties.size() + ", owned: " + ownedProperties.size());
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("CMISPolicyTypeDefinition[");
- builder.append("Id=").append(getTypeId().getId()).append(", ");
- builder.append("Namespace=").append(getTypeId().getLocalNamespace()).append(", ");
- builder.append("LocalName=").append(getTypeId().getLocalName()).append(", ");
- builder.append("QueryName=").append(getQueryName()).append(", ");
- builder.append("DisplayName=").append(getDisplayName()).append(", ");
- builder.append("ParentId=").append(getParentType() == null ? "" : getParentType().getTypeId()).append(", ");
- builder.append("Description=").append(getDescription()).append(", ");
- builder.append("Creatable=").append(isCreatable()).append(", ");
- builder.append("Queryable=").append(isQueryable()).append(", ");
- builder.append("Controllable=").append(isControllablePolicy()).append(", ");
- builder.append("IncludedInSuperTypeQuery=").append(isIncludedInSuperTypeQuery()).append(", ");
- builder.append("SubTypes=").append(getSubTypes(false).size()).append(", ");
- builder.append("Properties=").append(getPropertyDefinitions().size());
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISRelationshipTypeDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISRelationshipTypeDefinition.java
deleted file mode 100644
index 2290f2d912..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISRelationshipTypeDefinition.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.cmis.CMISDictionaryModel;
-import org.alfresco.cmis.CMISPropertyDefinition;
-import org.alfresco.cmis.CMISScope;
-import org.alfresco.cmis.CMISTypeDefinition;
-import org.alfresco.cmis.CMISTypeId;
-import org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.DictionaryRegistry;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.error.AlfrescoRuntimeException;
-import org.alfresco.service.cmr.dictionary.AssociationDefinition;
-import org.alfresco.service.cmr.dictionary.ClassDefinition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.ISO9075;
-
-
-/**
- * CMIS Relationship Type Definition
- *
- * @author davidc
- */
-public class CMISRelationshipTypeDefinition extends CMISAbstractTypeDefinition
-{
- private static final long serialVersionUID = 5291428171784061346L;
-
- // Relationship properties
- private List allowedSourceTypeIds = new ArrayList();
- private List allowedSourceTypes = new ArrayList();
- private List inheritedAllowedSourceTypes = new ArrayList();
- private List allowedTargetTypeIds = new ArrayList();
- private List allowedTargetTypes = new ArrayList();
- private List inheritedAllowedTargetTypes = new ArrayList();
-
-
- /**
- * Construct
- *
- * @param cmisMapping
- * @param typeId
- * @param cmisClassDef
- * @param assocDef
- */
- public CMISRelationshipTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef, AssociationDefinition assocDef)
- {
- isPublic = true;
- this.cmisClassDef = cmisClassDef;
- objectTypeId = typeId;
-
- actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
-
- queryable = false;
- fullTextIndexed = false;
- includedInSuperTypeQuery = true;
- controllablePolicy = false;
- controllableACL = false;
-
- if (assocDef == null)
- {
- // TODO: Add CMIS Association mapping??
- creatable = false;
- displayName = (cmisClassDef.getTitle(dictionaryService) != null) ? cmisClassDef.getTitle(dictionaryService) : typeId.getId();
- objectTypeQueryName = typeId.getId();
- QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
- if (parentQName != null)
- {
- parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
- }
- description = cmisClassDef.getDescription(dictionaryService) != null ? cmisClassDef.getDescription(dictionaryService) : displayName;
- }
- else
- {
- creatable = true;
- displayName = (assocDef.getTitle(dictionaryService) != null) ? assocDef.getTitle(dictionaryService) : typeId.getId();
- objectTypeQueryName = ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(typeId.getQName()));
- parentTypeId = CMISDictionaryModel.RELATIONSHIP_TYPE_ID;
- description = assocDef.getDescription(dictionaryService) != null ? assocDef.getDescription(dictionaryService) : displayName;
-
- CMISTypeId sourceTypeId = cmisMapping.getCmisTypeId(cmisMapping.getCmisType(assocDef.getSourceClass().getName()));
- if (sourceTypeId != null)
- {
- allowedSourceTypeIds.add(sourceTypeId);
- }
-
- CMISTypeId targetTypeId = cmisMapping.getCmisTypeId(cmisMapping.getCmisType(assocDef.getTargetClass().getName()));
- if (targetTypeId != null)
- {
- allowedTargetTypeIds.add(targetTypeId);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISObjectTypeDefinition#createProperties(org.alfresco.cmis.dictionary.CMISMapping, org.alfresco.service.cmr.dictionary.DictionaryService)
- */
- @Override
- /*package*/ Map createProperties(CMISMapping cmisMapping, DictionaryService dictionaryService)
- {
- if (objectTypeId.equals(CMISDictionaryModel.RELATIONSHIP_TYPE_ID))
- {
- return super.createProperties(cmisMapping, dictionaryService);
- }
- properties = new HashMap();
- return properties;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISObjectTypeDefinition#createSubTypes(org.alfresco.cmis.dictionary.CMISMapping, org.alfresco.service.cmr.dictionary.DictionaryService)
- */
- @Override
- /*package*/ void createSubTypes(CMISMapping cmisMapping, DictionaryService dictionaryService)
- {
- subTypeIds = new ArrayList();
- if (objectTypeId.equals(CMISDictionaryModel.RELATIONSHIP_TYPE_ID))
- {
- // all associations are sub-type of RELATIONSHIP_OBJECT_TYPE
- Collection assocs = dictionaryService.getAllAssociations();
- for (QName assoc : assocs)
- {
- if (cmisMapping.isValidCmisRelationship(assoc))
- {
- subTypeIds.add(cmisMapping.getCmisTypeId(CMISScope.RELATIONSHIP, assoc));
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISObjectTypeDefinition#resolveDependencies(org.alfresco.cmis.dictionary.AbstractCMISDictionaryService.DictionaryRegistry)
- */
- @Override
- /*package*/ void resolveDependencies(DictionaryRegistry registry)
- {
- super.resolveDependencies(registry);
- for (CMISTypeId sourceTypeId : allowedSourceTypeIds)
- {
- CMISTypeDefinition type = registry.objectDefsByTypeId.get(sourceTypeId);
- if (type == null)
- {
- throw new AlfrescoRuntimeException("Failed to retrieve allowed source type for type id " + sourceTypeId);
- }
- if (type.isPublic() == isPublic)
- {
- allowedSourceTypes.add(type);
- }
- }
- for (CMISTypeId targetTypeId : allowedTargetTypeIds)
- {
- CMISTypeDefinition type = registry.objectDefsByTypeId.get(targetTypeId);
- if (type == null)
- {
- throw new AlfrescoRuntimeException("Failed to retrieve allowed target type for type id " + targetTypeId);
- }
- if (type.isPublic() == isPublic)
- {
- allowedTargetTypes.add(type);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.CMISObjectTypeDefinition#resolveInheritance(org.alfresco.cmis.dictionary.AbstractCMISDictionaryService.DictionaryRegistry)
- */
- @Override
- /*package*/ void resolveInheritance(DictionaryRegistry registry)
- {
- super.resolveInheritance(registry);
- inheritedAllowedSourceTypes.addAll(allowedSourceTypes);
- inheritedAllowedTargetTypes.addAll(allowedTargetTypes);
- if (internalParentType != null)
- {
- inheritedAllowedSourceTypes.addAll(internalParentType.getAllowedSourceTypes());
- inheritedAllowedTargetTypes.addAll(internalParentType.getAllowedTargetTypes());
- }
- }
-
- /**
- * For an association, get the collection of valid source types. For non-associations the collection will be empty.
- *
- * @return
- */
- public Collection getAllowedSourceTypes()
- {
- return inheritedAllowedSourceTypes;
- }
-
- /**
- * For an association, get the collection of valid target types. For non-associations the collection will be empty.
- *
- * @return
- */
- public Collection getAllowedTargetTypes()
- {
- return inheritedAllowedTargetTypes;
- }
-
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("CMISRelationshipTypeDefinition[");
- builder.append("Id=").append(getTypeId().getId()).append(", ");
- builder.append("Namespace=").append(getTypeId().getLocalNamespace()).append(", ");
- builder.append("LocalName=").append(getTypeId().getLocalName()).append(", ");
- builder.append("QueryName=").append(getQueryName()).append(", ");
- builder.append("DisplayName=").append(getDisplayName()).append(", ");
- builder.append("ParentId=").append(getParentType() == null ? "" : getParentType().getTypeId()).append(", ");
- builder.append("Description=").append(getDescription()).append(", ");
- builder.append("Creatable=").append(isCreatable()).append(", ");
- builder.append("Queryable=").append(isQueryable()).append(", ");
- builder.append("Controllable=").append(isControllablePolicy()).append(", ");
- builder.append("IncludedInSuperTypeQuery=").append(isIncludedInSuperTypeQuery()).append(", ");
- builder.append("AllowedSourceTypes=[");
- for (CMISTypeDefinition type : getAllowedSourceTypes())
- {
- builder.append(type.getTypeId()).append(",");
- }
- builder.append("], ");
- builder.append("AllowedTargetTypes=[");
- for (CMISTypeDefinition type : getAllowedTargetTypes())
- {
- builder.append(type.getTypeId()).append(",");
- }
- builder.append("], ");
- builder.append("SubTypes=").append(getSubTypes(false).size()).append(", ");
- builder.append("Properties=").append(getPropertyDefinitions().size());
- builder.append("]");
- return builder.toString();
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/dictionary/CMISStrictDictionaryService.java b/source/java/org/alfresco/cmis/dictionary/CMISStrictDictionaryService.java
deleted file mode 100644
index d59a39c60b..0000000000
--- a/source/java/org/alfresco/cmis/dictionary/CMISStrictDictionaryService.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2005-2013 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.dictionary;
-
-import java.util.Collection;
-
-import org.alfresco.cmis.CMISScope;
-import org.alfresco.cmis.CMISTypeId;
-import org.alfresco.cmis.mapping.CMISMapping;
-import org.alfresco.model.ContentModel;
-import org.alfresco.service.cmr.dictionary.AssociationDefinition;
-import org.alfresco.service.cmr.dictionary.ClassDefinition;
-import org.alfresco.service.namespace.QName;
-
-
-/**
- * CMIS Dictionary which provides Types that strictly conform to the CMIS specification.
- *
- * That is, only maps types to one of root Document, Folder, Relationship & Policy.
- *
- * @author davidc
- */
-public class CMISStrictDictionaryService extends CMISAbstractDictionaryService
-{
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.dictionary.AbstractCMISDictionaryService#createDefinitions(org.alfresco.cmis.dictionary.AbstractCMISDictionaryService.DictionaryRegistry)
- */
- @Override
- protected void createDefinitions(DictionaryRegistry registry)
- {
- createTypeDefs(registry, dictionaryService.getAllTypes());
- createAssocDefs(registry, dictionaryService.getAllAssociations());
- createTypeDefs(registry, dictionaryService.getAllAspects());
- }
-
- /**
- * Create Type Definitions
- *
- * @param registry
- * @param classQNames
- */
- private void createTypeDefs(DictionaryRegistry registry, Collection classQNames)
- {
- for (QName classQName : classQNames)
- {
- // skip items that are remapped to CMIS model
- if (cmisMapping.isRemappedType(classQName))
- continue;
-
- // skip all items that are not mapped to CMIS model
- CMISTypeId typeId = cmisMapping.getCmisTypeId(classQName);
- if (typeId == null)
- continue;
- if (typeId.getScope() == CMISScope.RELATIONSHIP || typeId.getScope() == CMISScope.UNKNOWN )
- continue;
-
- // create appropriate kind of type definition
- ClassDefinition classDef = dictionaryService.getClass(cmisMapping.getCmisType(typeId.getQName()));
- CMISAbstractTypeDefinition objectTypeDef = null;
- if (typeId.getScope() == CMISScope.DOCUMENT)
- {
- objectTypeDef = new CMISDocumentTypeDefinition(cmisMapping, typeId, dictionaryService, classDef);
- }
- else if (typeId.getScope() == CMISScope.FOLDER)
- {
- boolean isSystem = dictionaryService.isSubClass(classDef.getName(), ContentModel.TYPE_SYSTEM_FOLDER);
- objectTypeDef = new CMISFolderTypeDefinition(cmisMapping, typeId, dictionaryService, classDef, isSystem);
- }
- else if (typeId.getScope() == CMISScope.POLICY)
- {
- objectTypeDef = new CMISPolicyTypeDefinition(cmisMapping, typeId, dictionaryService, classDef);
- }
- else if (typeId.getScope() == CMISScope.OBJECT)
- {
- objectTypeDef = new CMISObjectTypeDefinition(cmisMapping, typeId, dictionaryService, classDef, false);
- }
-
- registry.registerTypeDefinition(objectTypeDef);
- }
- }
-
- /**
- * Create Relationship Definitions
- *
- * @param registry
- * @param classQNames
- */
- private void createAssocDefs(DictionaryRegistry registry, Collection classQNames)
- {
- CMISTypeId typeId = cmisMapping.getCmisTypeId(CMISScope.RELATIONSHIP, CMISMapping.RELATIONSHIP_QNAME);
- ClassDefinition classDef = dictionaryService.getClass(cmisMapping.getCmisType(typeId.getQName()));
-
- // from Thor
- if (classDef == null)
- {
- if (classQNames.size() != 0)
- {
- logger.warn("Unexpected - no class for "+cmisMapping.getCmisType(typeId.getQName())+" - cannot create assocDefs for: "+classQNames);
- }
- return;
- }
-
- CMISAbstractTypeDefinition objectTypeDef = new CMISRelationshipTypeDefinition(cmisMapping, typeId, dictionaryService, classDef, null);
- registry.registerTypeDefinition(objectTypeDef);
-
- for (QName classQName : classQNames)
- {
- if (!cmisMapping.isValidCmisRelationship(classQName))
- continue;
-
- // create appropriate kind of type definition
- typeId = cmisMapping.getCmisTypeId(CMISScope.RELATIONSHIP, classQName);
- AssociationDefinition assocDef = dictionaryService.getAssociation(classQName);
- objectTypeDef = new CMISRelationshipTypeDefinition(cmisMapping, typeId, dictionaryService, null, assocDef);
-
- registry.registerTypeDefinition(objectTypeDef);
- }
- }
-
-}
diff --git a/source/java/org/alfresco/cmis/mapping/AbstractActionEvaluator.java b/source/java/org/alfresco/cmis/mapping/AbstractActionEvaluator.java
deleted file mode 100644
index 1b2ad63b40..0000000000
--- a/source/java/org/alfresco/cmis/mapping/AbstractActionEvaluator.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.mapping;
-
-import org.alfresco.cmis.CMISActionEvaluator;
-import org.alfresco.cmis.CMISAllowedActionEnum;
-import org.alfresco.service.ServiceRegistry;
-
-/**
- * Base class for all action evaluators
- *
- * @author davidc
- *
- */
-public abstract class AbstractActionEvaluator implements CMISActionEvaluator
-{
- private ServiceRegistry serviceRegistry;
- private CMISAllowedActionEnum action;
-
- /**
- * Construct
- *
- * @param serviceRegistry
- * @param action
- */
- protected AbstractActionEvaluator(ServiceRegistry serviceRegistry, CMISAllowedActionEnum action)
- {
- this.serviceRegistry = serviceRegistry;
- this.action = action;
- }
-
- /**
- * @return service registry
- */
- protected ServiceRegistry getServiceRegistry()
- {
- return serviceRegistry;
- }
-
- /*
- * (non-Javadoc)
- * @see org.alfresco.cmis.CMISActionEvaluator#getAction()
- */
- public CMISAllowedActionEnum getAction()
- {
- return action;
- }
-}
diff --git a/source/java/org/alfresco/cmis/mapping/AbstractProperty.java b/source/java/org/alfresco/cmis/mapping/AbstractProperty.java
deleted file mode 100644
index 10a717a4fe..0000000000
--- a/source/java/org/alfresco/cmis/mapping/AbstractProperty.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.cmis.mapping;
-
-import java.io.Serializable;
-import java.util.Collection;
-
-import org.alfresco.cmis.CMISPropertyAccessor;
-import org.alfresco.opencmis.dictionary.CMISPropertyLuceneBuilder;
-import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
-import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
-import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserExpressionAdaptor;
-import org.alfresco.repo.search.impl.querymodel.PredicateMode;
-import org.alfresco.service.ServiceRegistry;
-import org.alfresco.service.cmr.repository.AssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.namespace.QName;
-
-/**
- * Base class for all property accessors
- *
- * @author andyh
- *
- */
-public abstract class AbstractProperty implements CMISPropertyAccessor, CMISPropertyLuceneBuilder
-{
- private ServiceRegistry serviceRegistry;
- private String propertyName;
-
- /**
- * Construct
- *
- * @param serviceRegistry
- * @param propertyName
- */
- protected AbstractProperty(ServiceRegistry serviceRegistry, String propertyName)
- {
- this.serviceRegistry = serviceRegistry;
- this.propertyName = propertyName;
- }
-
- /**
- * @return service registry
- */
- protected ServiceRegistry getServiceRegistry()
- {
- return serviceRegistry;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.property.PropertyAccessor#getName()
- */
- public String getName()
- {
- return propertyName;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.cmis.property.PropertyAccessor#getMappedProperty()
- */
- public QName getMappedProperty()
- {
- return null;
- }
-
- public Q buildLuceneEquality(LuceneQueryParserAdaptor lqpa, Serializable value, PredicateMode mode,
- LuceneFunction luceneFunction) throws E
- {
- return null;
- }
-
- public Q buildLuceneExists(LuceneQueryParserAdaptor lqpa, Boolean not) throws E
- {
- return null;
- }
-
- public Q buildLuceneGreaterThan(LuceneQueryParserAdaptor lqpa, Serializable value, PredicateMode mode,
- LuceneFunction luceneFunction) throws E
- {
- return null;
- }
-
- public Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor lqpa, Serializable value, PredicateMode mode,
- LuceneFunction luceneFunction) throws E
- {
- return null;
- }
-
- public Q buildLuceneIn(LuceneQueryParserAdaptor lqpa, Collection values, Boolean not,
- PredicateMode mode) throws E
- {
- LuceneQueryParserExpressionAdaptor