chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1463002 [2/5] - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/ main/java/org/apache/chemistry/opencmis/inmemory/query/ main/java/org/apache/c...
Date Sun, 31 Mar 2013 16:39:14 GMT
Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java?rev=1463002&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryRelationshipServiceImpl.java Sun Mar 31 16:39:14 2013
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.inmemory.server;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
+import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.commons.data.ObjectList;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
+import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectListImpl;
+import org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
+import org.apache.chemistry.opencmis.commons.server.ObjectInfoHandler;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.ObjectStore;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager;
+import org.apache.chemistry.opencmis.inmemory.storedobj.api.StoredObject;
+import org.apache.chemistry.opencmis.inmemory.types.PropertyCreationHelper;
+import org.apache.chemistry.opencmis.server.support.TypeManager;
+
+public class InMemoryRelationshipServiceImpl extends InMemoryAbstractServiceImpl {
+
+    private InMemoryRepositoryServiceImpl repSvc;
+    protected InMemoryRelationshipServiceImpl(StoreManager storeManager, InMemoryRepositoryServiceImpl repSvc) {
+        super(storeManager);
+        this.repSvc = repSvc;
+    }
+
+    public ObjectList getObjectRelationships(CallContext context, String repositoryId, String objectId, Boolean includeSubRelationshipTypes,
+            RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions,
+            BigInteger maxItems, BigInteger skipCount, ExtensionsData extension, ObjectInfoHandler objectInfos) {
+
+        int skip = null == skipCount ? 0: skipCount.intValue();
+        ObjectStore objStore = fStoreManager.getObjectStore(repositoryId);
+
+        StoredObject so = validator.getObjectRelationships(context, repositoryId, objectId, relationshipDirection,
+                typeId, extension);
+
+        if (so == null) {
+            throw new CmisObjectNotFoundException("Unknown object id: " + objectId);
+        }
+
+        String user = context.getUsername();
+        TypeManager tm = fStoreManager.getTypeManager(repositoryId);
+        List<String> typeIds = null;
+        if (null != typeId) {
+            typeIds = new ArrayList<String>();
+            typeIds.add(typeId);
+            if (includeSubRelationshipTypes) {
+                List<TypeDefinitionContainer> typeDescs = repSvc.getTypeDescendants(context, repositoryId, typeId, null, true, null);
+                if (null != typeDescs) {
+                    for (TypeDefinitionContainer t : typeDescs) {
+                        typeIds.add(t.getTypeDefinition().getId());
+                    }
+                }
+            }
+        }
+        List<StoredObject> rels = objStore.getRelationships(objectId, typeIds, relationshipDirection);
+        ObjectListImpl result = new ObjectListImpl();
+        List<ObjectData> odList = new ArrayList<ObjectData>();
+
+        for (StoredObject rel : rels) {
+            ObjectData od = PropertyCreationHelper.getObjectData(tm, rel, filter, user, includeAllowableActions,
+                    IncludeRelationships.NONE, null, false, false, extension);
+            odList.add(od);
+        }
+        if (context.isObjectInfoRequired()) {
+            ObjectInfoImpl objectInfo = new ObjectInfoImpl();
+            fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
+            objectInfos.addObjectInfo(objectInfo);
+        }
+
+        result.setObjects(odList);
+        result.setNumItems(BigInteger.valueOf(rels.size()));
+        result.setHasMoreItems(rels.size() > skip + rels.size());
+
+        return result;
+    }
+
+}

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java?rev=1463002&r1=1463001&r2=1463002&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryService.java Sun Mar 31 16:39:14 2013
@@ -63,6 +63,8 @@ public class InMemoryService extends Abs
     private final InMemoryVersioningServiceImpl fVerSvc;
     private final InMemoryDiscoveryServiceImpl fDisSvc;
     private final InMemoryMultiFilingServiceImpl fMultiSvc;
+    private final InMemoryRelationshipServiceImpl fRelSvc;
+    private final InMemoryPolicyServiceImpl fPolSvc;
     private final InMemoryAclService fAclSvc;
 
     public StoreManager getStoreManager() {
@@ -77,6 +79,8 @@ public class InMemoryService extends Abs
         fVerSvc = new InMemoryVersioningServiceImpl(storeManager, fObjSvc);
         fDisSvc = new InMemoryDiscoveryServiceImpl(storeManager, fRepSvc, fNavSvc);
         fMultiSvc = new InMemoryMultiFilingServiceImpl(storeManager);
+        fRelSvc = new InMemoryRelationshipServiceImpl(storeManager, fRepSvc);
+        fPolSvc = new InMemoryPolicyServiceImpl(storeManager);
         fAclSvc = new InMemoryAclService(storeManager);
     }
 
@@ -421,8 +425,8 @@ public class InMemoryService extends Abs
     public ObjectList getObjectRelationships(String repositoryId, String objectId, Boolean includeSubRelationshipTypes,
             RelationshipDirection relationshipDirection, String typeId, String filter, Boolean includeAllowableActions,
             BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
-        return super.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes, relationshipDirection,
-                typeId, filter, includeAllowableActions, maxItems, skipCount, extension);
+        return fRelSvc.getObjectRelationships(getCallContext(), repositoryId, objectId, includeSubRelationshipTypes,
+                relationshipDirection, typeId, filter, includeAllowableActions, maxItems, skipCount, extension, this);
     }
 
     // --- ACL service ---
@@ -447,18 +451,18 @@ public class InMemoryService extends Abs
 
     @Override
     public void applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
-        super.applyPolicy(repositoryId, policyId, objectId, extension);
+        fPolSvc.applyPolicy(repositoryId, policyId, objectId, extension);
     }
 
     @Override
     public List<ObjectData> getAppliedPolicies(String repositoryId, String objectId, String filter,
             ExtensionsData extension) {
-        return super.getAppliedPolicies(repositoryId, objectId, filter, extension);
+        return fPolSvc.getAppliedPolicies(repositoryId, objectId, filter, extension);
     }
 
     @Override
     public void removePolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
-        super.removePolicy(repositoryId, policyId, objectId, extension);
+        fPolSvc.removePolicy(repositoryId, policyId, objectId, extension);
     }
 
     // /////////////

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java?rev=1463002&r1=1463001&r2=1463002&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java Sun Mar 31 16:39:14 2013
@@ -157,6 +157,7 @@ public class InMemoryServiceFactoryImpl 
 
         InMemoryService inMemoryService = InMemoryServiceContext.getCmisService();
         if (inMemoryService == null) {
+            LOG.debug("Creating new InMemoryService instance!");
             CmisServiceWrapper<InMemoryService> wrapperService;
             inMemoryService = new InMemoryService(inMemoryServiceParameters, storeManager);
             wrapperService = new CmisServiceWrapper<InMemoryService>(inMemoryService, DEFAULT_MAX_ITEMS_TYPES,
@@ -192,6 +193,7 @@ public class InMemoryServiceFactoryImpl 
 
     @Override
     public void destroy() {
+        LOG.debug("Destroying InMemory service instance.");
         if (null != cleanManager) {
             cleanManager.stopCleanRepositoryJob();
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java?rev=1463002&r1=1463001&r2=1463002&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryVersioningServiceImpl.java Sun Mar 31 16:39:14 2013
@@ -52,7 +52,8 @@ public class InMemoryVersioningServiceIm
 
     private static final Logger LOG = LoggerFactory.getLogger(InMemoryVersioningServiceImpl.class.getName());
 
-    final InMemoryObjectServiceImpl fObjectService; // real implementation of the
+    final InMemoryObjectServiceImpl fObjectService; // real implementation of
+                                                    // the
     // service
     final AtomLinkInfoProvider fAtomLinkProvider;
 
@@ -70,7 +71,7 @@ public class InMemoryVersioningServiceIm
         VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);
 
         verDoc.cancelCheckOut(user);
-        
+
         // if this is the last version delete the document itself
         if (verDoc.getAllVersions().size() == 0)
             fStoreManager.getObjectStore(repositoryId).deleteObject(verDoc.getId(), true, user);
@@ -80,10 +81,11 @@ public class InMemoryVersioningServiceIm
             Properties properties, ContentStream contentStream, String checkinComment, List<String> policies,
             Acl addAces, Acl removeAces, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
-    	addAces  = org.apache.chemistry.opencmis.inmemory.TypeValidator.expandAclMakros(context.getUsername(), addAces);
-    	removeAces  = org.apache.chemistry.opencmis.inmemory.TypeValidator.expandAclMakros(context.getUsername(), removeAces);
+        addAces = org.apache.chemistry.opencmis.inmemory.TypeValidator.expandAclMakros(context.getUsername(), addAces);
+        removeAces = org.apache.chemistry.opencmis.inmemory.TypeValidator.expandAclMakros(context.getUsername(),
+                removeAces);
 
-    	StoredObject so = validator.checkIn(context, repositoryId, objectId, addAces, removeAces, extension);
+        StoredObject so = validator.checkIn(context, repositoryId, objectId, addAces, removeAces, policies, extension);
 
         String user = context.getUsername();
         VersionedDocument verDoc = testHasProperCheckedOutStatus(so, user);
@@ -92,8 +94,8 @@ public class InMemoryVersioningServiceIm
         // Note Bworser binding sets an empty object
         if (contentStream != null && contentStream.getStream() == null)
             contentStream = null;
-        
-        verDoc.checkIn(major, properties, contentStream, checkinComment, user);
+
+        verDoc.checkIn(major, properties, contentStream, checkinComment, policies, user);
 
         // To be able to provide all Atom links in the response we need
         // additional information:
@@ -104,8 +106,8 @@ public class InMemoryVersioningServiceIm
         }
     }
 
-    public void checkOut(CallContext context, String repositoryId, Holder<String> objectId,
-            ExtensionsData extension, Holder<Boolean> contentCopied, ObjectInfoHandler objectInfos) {
+    public void checkOut(CallContext context, String repositoryId, Holder<String> objectId, ExtensionsData extension,
+            Holder<Boolean> contentCopied, ObjectInfoHandler objectInfos) {
 
         StoredObject so = validator.checkOut(context, repositoryId, objectId, extension, contentCopied);
 
@@ -140,7 +142,7 @@ public class InMemoryVersioningServiceIm
         objectId.setValue(pwc.getId()); // return the id of the created pwc
         if (null != contentCopied) // Note: always null in AtomPub binding
             contentCopied.setValue(true);
-        
+
         // To be able to provide all Atom links in the response we need
         // additional information:
         if (context.isObjectInfoRequired()) {
@@ -150,10 +152,12 @@ public class InMemoryVersioningServiceIm
         }
     }
 
-    public List<ObjectData> getAllVersions(CallContext context, String repositoryId, String objectId, String versionSeriesId,
-            String filter, Boolean includeAllowableActions, ExtensionsData extension, ObjectInfoHandler objectInfos) {
-        
-        // Note that in AtomPub object id is null and versionSeriesId is set and in SOAP bindinf versionSeriesId is set
+    public List<ObjectData> getAllVersions(CallContext context, String repositoryId, String objectId,
+            String versionSeriesId, String filter, Boolean includeAllowableActions, ExtensionsData extension,
+            ObjectInfoHandler objectInfos) {
+
+        // Note that in AtomPub object id is null and versionSeriesId is set and
+        // in SOAP bindinf versionSeriesId is set
         // and objectId is null
         StoredObject so;
         List<ObjectData> res = new ArrayList<ObjectData>();
@@ -169,18 +173,19 @@ public class InMemoryVersioningServiceIm
         if (!(so instanceof VersionedDocument)) {
             if (!(so instanceof DocumentVersion))
                 throw new CmisInvalidArgumentException("getAllVersions requires an id of a versioned document.");
-            so = ((DocumentVersion)so).getParentDocument();
+            so = ((DocumentVersion) so).getParentDocument();
         }
-//        ObjectData objData = getObject(context, repositoryId, so.getId(), filter, includeAllowableActions,
-//                IncludeRelationships.NONE,extension, objectInfos);
-//        res.add(objData);
+        // ObjectData objData = getObject(context, repositoryId, so.getId(),
+        // filter, includeAllowableActions,
+        // IncludeRelationships.NONE,extension, objectInfos);
+        // res.add(objData);
 
         VersionedDocument verDoc = (VersionedDocument) so;
         res = new ArrayList<ObjectData>();
         List<DocumentVersion> versions = verDoc.getAllVersions();
         for (DocumentVersion version : versions) {
             ObjectData objData = getObject(context, repositoryId, version.getId(), filter, includeAllowableActions,
-                    IncludeRelationships.NONE,extension, objectInfos);
+                    IncludeRelationships.NONE, false, extension, objectInfos);
             res.add(objData);
         }
 
@@ -200,28 +205,29 @@ public class InMemoryVersioningServiceIm
         return res;
     }
 
-    public ObjectData getObjectOfLatestVersion(CallContext context, String repositoryId, String objectId, String versionSeriesId,
-            Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
-            String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension,
-            ObjectInfoHandler objectInfos) {
+    public ObjectData getObjectOfLatestVersion(CallContext context, String repositoryId, String objectId,
+            String versionSeriesId, Boolean major, String filter, Boolean includeAllowableActions,
+            IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+            Boolean includeAcl, ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
-        StoredObject so = validator.getObjectOfLatestVersion(context, repositoryId, objectId, versionSeriesId, extension);
+        StoredObject so = validator.getObjectOfLatestVersion(context, repositoryId, objectId, versionSeriesId,
+                extension);
 
         ObjectData objData = null;
 
         // In AtomPu8b you do not get the version series id, only the object id
         if (so instanceof DocumentVersion) {
-            so = ((DocumentVersion)so).getParentDocument();
+            so = ((DocumentVersion) so).getParentDocument();
         }
-        
+
         if (so instanceof VersionedDocument) {
             VersionedDocument verDoc = (VersionedDocument) so;
             DocumentVersion latestVersion = verDoc.getLatestVersion(major);
             objData = getObject(context, repositoryId, latestVersion.getId(), filter, includeAllowableActions,
-                    includeRelationships, extension, objectInfos);
+                    includeRelationships, includePolicyIds, extension, objectInfos);
         } else if (so instanceof Document) {
             objData = getObject(context, repositoryId, so.getId(), filter, includeAllowableActions,
-                    includeRelationships, extension, objectInfos);
+                    includeRelationships, includePolicyIds, extension, objectInfos);
         } else {
             throw new CmisInvalidArgumentException("Object is not instance of a document (version series)");
         }
@@ -236,16 +242,17 @@ public class InMemoryVersioningServiceIm
         return objData;
     }
 
-    public Properties getPropertiesOfLatestVersion(CallContext context, String repositoryId, String objectId, String versionSeriesId,
-            Boolean major, String filter, ExtensionsData extension) {
+    public Properties getPropertiesOfLatestVersion(CallContext context, String repositoryId, String objectId,
+            String versionSeriesId, Boolean major, String filter, ExtensionsData extension) {
 
-        StoredObject so = validator.getPropertiesOfLatestVersion(context, repositoryId, objectId, versionSeriesId, extension);
+        StoredObject so = validator.getPropertiesOfLatestVersion(context, repositoryId, objectId, versionSeriesId,
+                extension);
 
         StoredObject latestVersionObject = null;
 
         // In AtomPu8b you do not get the version series id, only the object id
         if (so instanceof DocumentVersion) {
-            so = ((DocumentVersion)so).getParentDocument();
+            so = ((DocumentVersion) so).getParentDocument();
         }
 
         if (so instanceof VersionedDocument) {
@@ -261,17 +268,16 @@ public class InMemoryVersioningServiceIm
 
         TypeManager tm = fStoreManager.getTypeManager(repositoryId);
 
-        Properties props = PropertyCreationHelper.getPropertiesFromObject(latestVersionObject, tm,
-                requestedIds, true);
+        Properties props = PropertyCreationHelper.getPropertiesFromObject(latestVersionObject, tm, requestedIds, true);
 
         return props;
     }
 
     private ObjectData getObject(CallContext context, String repositoryId, String objectId, String filter,
-            Boolean includeAllowableActions, IncludeRelationships includeRelationships, ExtensionsData extension,
-            ObjectInfoHandler objectInfos) {
+            Boolean includeAllowableActions, IncludeRelationships includeRelationships, Boolean includePolicies,
+            ExtensionsData extension, ObjectInfoHandler objectInfos) {
 
         return fObjectService.getObject(context, repositoryId, objectId, filter, includeAllowableActions,
-                includeRelationships, null, false, includeAllowableActions, extension, objectInfos);
+                includeRelationships, null, includePolicies, includeAllowableActions, extension, objectInfos);
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/CmisServiceValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/CmisServiceValidator.java?rev=1463002&r1=1463001&r2=1463002&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/CmisServiceValidator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/CmisServiceValidator.java Sun Mar 31 16:39:14 2013
@@ -35,81 +35,68 @@ public interface CmisServiceValidator {
 
     void getRepositoryInfo(CallContext context, String repositoryId, ExtensionsData extension);
 
-    void getTypeChildren(CallContext context, String repositoryId, String typeId,
-            ExtensionsData extension);
+    void getTypeChildren(CallContext context, String repositoryId, String typeId, ExtensionsData extension);
 
-    void getTypeDescendants(CallContext context, String repositoryId, String typeId,
-            ExtensionsData extension);
+    void getTypeDescendants(CallContext context, String repositoryId, String typeId, ExtensionsData extension);
 
-    void getTypeDefinition(CallContext context, String repositoryId, String typeId,
-            ExtensionsData extension);
+    void getTypeDefinition(CallContext context, String repositoryId, String typeId, ExtensionsData extension);
 
     StoredObject getChildren(CallContext context, String repositoryId, String folderId, ExtensionsData extension);
 
-    StoredObject getDescendants(CallContext context, String repositoryId, String folderId,
-            ExtensionsData extension);
+    StoredObject getDescendants(CallContext context, String repositoryId, String folderId, ExtensionsData extension);
 
-    StoredObject getFolderTree(CallContext context, String repositoryId, String folderId,
-            ExtensionsData extension);
+    StoredObject getFolderTree(CallContext context, String repositoryId, String folderId, ExtensionsData extension);
 
-    StoredObject getObjectParents(CallContext context, String repositoryId, String objectId,
-            ExtensionsData extension);
+    StoredObject getObjectParents(CallContext context, String repositoryId, String objectId, ExtensionsData extension);
 
-    StoredObject getFolderParent(CallContext context, String repositoryId, String folderId,
-            ExtensionsData extension);
+    StoredObject getFolderParent(CallContext context, String repositoryId, String folderId, ExtensionsData extension);
 
-    StoredObject getCheckedOutDocs(CallContext context, String repositoryId, String folderId,
-            ExtensionsData extension);
+    StoredObject getCheckedOutDocs(CallContext context, String repositoryId, String folderId, ExtensionsData extension);
 
-    StoredObject createDocument(CallContext context, String repositoryId, String folderId,
+    StoredObject createDocument(CallContext context, String repositoryId, String folderId, List<String> policyIds,
             ExtensionsData extension);
 
-    StoredObject createDocumentFromSource(CallContext context, String repositoryId, String sourceId,
-            String folderId, ExtensionsData extension);
+    StoredObject createDocumentFromSource(CallContext context, String repositoryId, String sourceId, String folderId,
+            List<String> policyIds, ExtensionsData extension);
 
-    StoredObject createFolder(CallContext context, String repositoryId, String folderId,
+    StoredObject createFolder(CallContext context, String repositoryId, String folderId, List<String> policyIds,
             ExtensionsData extension);
 
     // relationship has no parent, returns source and target object
-    StoredObject[] createRelationship(CallContext context, String repositoryId, String sourceId, 
-    		 String targetId, ExtensionsData extension);
+    StoredObject[] createRelationship(CallContext context, String repositoryId, String sourceId, String targetId,
+            List<String> policyIds, ExtensionsData extension);
 
-    StoredObject createPolicy(CallContext context, String repositoryId, String folderId,
-            ExtensionsData extension);
+    StoredObject createPolicy(CallContext context, String repositoryId, String folderId, Acl addAces, Acl removeAces,
+            List<String> policyIds, ExtensionsData extension);
 
-    StoredObject getAllowableActions(CallContext context, String repositoryId, String objectId,
-            ExtensionsData extension);
+    StoredObject getAllowableActions(CallContext context, String repositoryId, String objectId, ExtensionsData extension);
 
-    StoredObject getObject(CallContext context, String repositoryId, String objectId,
-            ExtensionsData extension);
+    StoredObject getObject(CallContext context, String repositoryId, String objectId, ExtensionsData extension);
 
-    StoredObject getProperties(CallContext context, String repositoryId, String objectId,
-            ExtensionsData extension);
+    StoredObject getProperties(CallContext context, String repositoryId, String objectId, ExtensionsData extension);
 
-    StoredObject getRenditions(CallContext context, String repositoryId, String objectId,
-            ExtensionsData extension);
+    StoredObject getRenditions(CallContext context, String repositoryId, String objectId, ExtensionsData extension);
 
-    StoredObject getObjectByPath(CallContext context, String repositoryId, String path,
-            ExtensionsData extension);
+    StoredObject getObjectByPath(CallContext context, String repositoryId, String path, ExtensionsData extension);
 
-    StoredObject getContentStream(CallContext context, String repositoryId, String objectId,
-            String streamId, ExtensionsData extension);
+    StoredObject getContentStream(CallContext context, String repositoryId, String objectId, String streamId,
+            ExtensionsData extension);
 
     StoredObject updateProperties(CallContext context, String repositoryId, Holder<String> objectId,
             ExtensionsData extension);
 
-    StoredObject[] moveObject(CallContext context, String repositoryId, Holder<String> objectId,
-            String targetFolderId, String sourceFolderId, ExtensionsData extension);
+    StoredObject[] moveObject(CallContext context, String repositoryId, Holder<String> objectId, String targetFolderId,
+            String sourceFolderId, ExtensionsData extension);
 
-    StoredObject deleteObject(CallContext context, String repositoryId, String objectId,
-            Boolean allVersions, ExtensionsData extension);
+    StoredObject deleteObject(CallContext context, String repositoryId, String objectId, Boolean allVersions,
+            ExtensionsData extension);
 
-    StoredObject deleteTree(CallContext context, String repositoryId, String folderId,
-            Boolean allVersions, UnfileObject unfileObjects, ExtensionsData extension);
+    StoredObject deleteTree(CallContext context, String repositoryId, String folderId, Boolean allVersions,
+            UnfileObject unfileObjects, ExtensionsData extension);
 
     StoredObject setContentStream(CallContext context, String repositoryId, Holder<String> objectId,
             Boolean overwriteFlag, ExtensionsData extension);
-    
+
     // CMIS 1.1
     StoredObject appendContentStream(CallContext context, String repositoryId, Holder<String> objectId,
             ExtensionsData extension);
@@ -117,60 +104,55 @@ public interface CmisServiceValidator {
     StoredObject deleteContentStream(CallContext context, String repositoryId, Holder<String> objectId,
             ExtensionsData extension);
 
-    StoredObject checkOut(CallContext context, String repositoryId, Holder<String> objectId,
-            ExtensionsData extension, Holder<Boolean> contentCopied);
+    StoredObject checkOut(CallContext context, String repositoryId, Holder<String> objectId, ExtensionsData extension,
+            Holder<Boolean> contentCopied);
 
-    StoredObject cancelCheckOut(CallContext context, String repositoryId, String objectId,
-            ExtensionsData extension);
+    StoredObject cancelCheckOut(CallContext context, String repositoryId, String objectId, ExtensionsData extension);
 
-    StoredObject checkIn(CallContext context, String repositoryId, Holder<String> objectId,
-            Acl addAces, Acl removeAces, ExtensionsData extension);
+    StoredObject checkIn(CallContext context, String repositoryId, Holder<String> objectId, Acl addAces,
+            Acl removeAces, List<String> policyIds, ExtensionsData extension);
 
     StoredObject getObjectOfLatestVersion(CallContext context, String repositoryId, String objectId,
             String versionSeriesId, ExtensionsData extension);
 
-    StoredObject getPropertiesOfLatestVersion(CallContext context, String repositoryId,
-            String objectId, String versionSeriesId, ExtensionsData extension);
-
-    StoredObject getAllVersions(CallContext context, String repositoryId, String objectId,
+    StoredObject getPropertiesOfLatestVersion(CallContext context, String repositoryId, String objectId,
             String versionSeriesId, ExtensionsData extension);
 
+    StoredObject getAllVersions(CallContext context, String repositoryId, String objectId, String versionSeriesId,
+            ExtensionsData extension);
+
     void query(CallContext context, String repositoryId, ExtensionsData extension);
 
     void getContentChanges(CallContext context, String repositoryId, ExtensionsData extension);
 
-    StoredObject[] addObjectToFolder(CallContext context, String repositoryId, String objectId,
-            String folderId, Boolean allVersions, ExtensionsData extension);
+    StoredObject[] addObjectToFolder(CallContext context, String repositoryId, String objectId, String folderId,
+            Boolean allVersions, ExtensionsData extension);
 
-    StoredObject[] removeObjectFromFolder(CallContext context, String repositoryId, String objectId,
-            String folderId, ExtensionsData extension);
+    StoredObject[] removeObjectFromFolder(CallContext context, String repositoryId, String objectId, String folderId,
+            ExtensionsData extension);
 
     StoredObject getObjectRelationships(CallContext context, String repositoryId, String objectId,
             RelationshipDirection relationshipDirection, String typeId, ExtensionsData extension);
 
-    StoredObject getAcl(CallContext context, String repositoryId, String objectId,
-            ExtensionsData extension);
-
-    StoredObject applyAcl(CallContext context, String repositoryId, String objectId,
-            AclPropagation aclPropagation, ExtensionsData extension);
+    StoredObject getAcl(CallContext context, String repositoryId, String objectId, ExtensionsData extension);
 
-    StoredObject[] applyPolicy(CallContext context, String repositoryId, String policyId,
-            String objectId, ExtensionsData extension);
-
-    StoredObject[] removePolicy(CallContext context, String repositoryId, String policyId,
-            String objectId, ExtensionsData extension);
+    StoredObject applyAcl(CallContext context, String repositoryId, String objectId, AclPropagation aclPropagation,
+            ExtensionsData extension);
 
-    StoredObject getAppliedPolicies(CallContext context, String repositoryId, String objectId,
+    StoredObject[] applyPolicy(CallContext context, String repositoryId, String policyId, String objectId,
             ExtensionsData extension);
 
-    StoredObject create(CallContext context, String repositoryId, String folderId,
+    StoredObject[] removePolicy(CallContext context, String repositoryId, String policyId, String objectId,
             ExtensionsData extension);
 
+    StoredObject getAppliedPolicies(CallContext context, String repositoryId, String objectId, ExtensionsData extension);
+
+    StoredObject create(CallContext context, String repositoryId, String folderId, ExtensionsData extension);
+
     StoredObject applyAcl(CallContext context, String repositoryId, String objectId);
 
     // CMIS 1.1
     StoredObject createItem(CallContext context, String repositoryId, Properties properties, String folderId,
             List<String> policies, Acl addAces, Acl removeAces, ExtensionsData extension);
 
-
- }
\ No newline at end of file
+}
\ No newline at end of file

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java?rev=1463002&r1=1463001&r2=1463002&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/ObjectStore.java Sun Mar 31 16:39:14 2013
@@ -26,6 +26,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.data.PropertyData;
 import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
 import org.apache.chemistry.opencmis.commons.enums.VersioningState;
 
 /**
@@ -89,6 +90,8 @@ public interface ObjectStore {
      * 			  the user who creates the document
      * @param folder
      * 			  the parent folder 
+     * @param policies
+     *            list of policies to apply 
      * @param addACEs
      * 			  aces that are added 
      * @param removeACEs 
@@ -96,7 +99,7 @@ public interface ObjectStore {
      * @return document object
      */
      Document createDocument(String name, Map<String, PropertyData<?>> propMap, String user, Folder folder,
- 			Acl addACEs, Acl removeACEs);
+ 			List<String> policies, Acl addACEs, Acl removeACEs);
 
 
     /**
@@ -113,6 +116,8 @@ public interface ObjectStore {
      * 			  the user who creates the document
      * @param folder
      * 			  the parent folder 
+     * @param policies
+     *            list of policies to apply 
      * @param addACEs
      * 			  aces that are added 
      * @param removeACEs 
@@ -120,7 +125,7 @@ public interface ObjectStore {
      * @return folder object
      */
     Folder createFolder(String name, Map<String, PropertyData<?>> propMap, String user, Folder folder,
-			Acl addACEs, Acl removeACEs);
+            List<String> policies, Acl addACEs, Acl removeACEs);
 
     /**
      * Create a document that supports versions as initial step. The document is
@@ -136,6 +141,8 @@ public interface ObjectStore {
      * 			  the user who creates the document
      * @param folder
      * 			  the parent folder 
+     * @param policies
+     *            list of policies to apply 
      * @param addACEs
      * 			  aces that are added 
      * @param removeACEs 
@@ -144,7 +151,7 @@ public interface ObjectStore {
      */
     DocumentVersion createVersionedDocument(String name,
 			Map<String, PropertyData<?>> propMap, String user, Folder folder,
-			Acl addACEs, Acl removeACEs, ContentStream contentStream, VersioningState versioningState);
+			List<String> policies, Acl addACEs, Acl removeACEs, ContentStream contentStream, VersioningState versioningState);
 
     /**
      * Create an item as initial step. The item is created but still
@@ -160,6 +167,8 @@ public interface ObjectStore {
      *            the user who creates the document
      * @param folder
      *            the parent folder 
+     * @param policies
+     *            list of policies to apply 
      * @param addACEs
      *            aces that are added 
      * @param removeACEs 
@@ -167,9 +176,27 @@ public interface ObjectStore {
      * @return document object
      */
     StoredObject createItem(String name, Map<String, PropertyData<?>> propMap, String user, Folder folder,
-            Acl addACEs, Acl removeACEs);
+            List<String> policies, Acl addACEs, Acl removeACEs);
 
     /**
+     * Create a policy. The policy is created but still
+     * temporary. It is not yet persisted and does not have an id yet. After this
+     * call additional actions can take place (like assigning properties and a
+     * type) before it is persisted.
+     * 
+     * @param name
+     *            name of the document
+     * @param policyText
+     *            policy text to apply to this policy   
+     * @param propMap
+     *            map of properties   
+     * @param user
+     *            the user who creates the document
+     * @return policy object
+     */
+    public StoredObject createPolicy(String name, String policyText, Map<String, PropertyData<?>> propMap, String user);
+
+     /**
      * Clear repository and remove all data.
      */
     void clear();
@@ -203,7 +230,7 @@ public interface ObjectStore {
      *            aces that are removed
      * @return versioned document object
      */
-    StoredObject createRelationship(StoredObject sourceObject, StoredObject targetObject, 
+    StoredObject createRelationship(String name, StoredObject sourceObject, StoredObject targetObject, 
     		Map<String, PropertyData<?>> propMap,
 			String user, Acl addACEs, Acl removeACEs);
     
@@ -260,4 +287,18 @@ public interface ObjectStore {
      *      if no objects exist having this type
      */
     boolean isTypeInUse(String typeId);
+
+    /**
+     * Get relationships to and from an object
+     * 
+     * @param objectId
+     *      id of object to get relationships with
+     * @param subTypeIds
+     *      list of all types to be included
+     * @param relationshipDirection
+     *      direction of relationship
+     * @return
+     */
+    List<StoredObject> getRelationships(String objectId, List<String> typeIds,
+            RelationshipDirection direction);
 }
\ No newline at end of file

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Policy.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Policy.java?rev=1463002&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Policy.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Policy.java Sun Mar 31 16:39:14 2013
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.inmemory.storedobj.api;
+
+public interface Policy {
+
+    String getPolicyText();
+    
+}

Added: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Relationship.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Relationship.java?rev=1463002&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Relationship.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/Relationship.java Sun Mar 31 16:39:14 2013
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.inmemory.storedobj.api;
+
+
+public interface Relationship {
+    
+    String getSourceObjectId();
+    
+    String getTargetObjectId();
+}

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java?rev=1463002&r1=1463001&r2=1463002&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/StoredObject.java Sun Mar 31 16:39:14 2013
@@ -18,7 +18,6 @@
  */
 package org.apache.chemistry.opencmis.inmemory.storedobj.api;
 
-import java.math.BigInteger;
 import java.util.GregorianCalendar;
 import java.util.List;
 import java.util.Map;
@@ -26,8 +25,6 @@ import java.util.Map;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.AllowableActions;
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
-import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
-import org.apache.chemistry.opencmis.commons.data.ObjectList;
 import org.apache.chemistry.opencmis.commons.data.PropertyData;
 import org.apache.chemistry.opencmis.commons.data.RenditionData;
 import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
@@ -293,11 +290,7 @@ public interface StoredObject {
      * @param user
      * 			the id of the user calling the method 
      */
-	ObjectList getObjectRelationships(
-			Boolean includeSubRelationshipTypes,
-			RelationshipDirection relationshipDirection, String typeId,
-			String filter, Boolean includeAllowableActions,
-			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension, String user);
+    public List<StoredObject> getObjectRelationships(RelationshipDirection relationshipDirection, String user);
 	
 	/*
      * get the allowable actions  of the object
@@ -337,5 +330,14 @@ public interface StoredObject {
      *     ContentStream containing the rendition
      */
     public ContentStream getRenditionContent(String streamId, long offset, long length);
+    
+    /**
+     * get applied policies of this object
+     * 
+     * @return
+     *      list of ids of policies applied to this object
+     */
+    public List<String> getAppliedPolicies();
+
 
 }
\ No newline at end of file

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.java?rev=1463002&r1=1463001&r2=1463002&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/api/VersionedDocument.java Sun Mar 31 16:39:14 2013
@@ -54,7 +54,8 @@ public interface VersionedDocument exten
 
     DocumentVersion checkOut(ContentStream content, String user);
 
-    void checkIn(boolean isMajor, Properties properties, ContentStream content, String checkinComment, String user);
+    void checkIn(boolean isMajor, Properties properties, ContentStream content, String checkinComment,
+            List<String> policyIds, String user);
 
     List<DocumentVersion> getAllVersions();
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.java?rev=1463002&r1=1463001&r2=1463002&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/FolderImpl.java Sun Mar 31 16:39:14 2013
@@ -126,16 +126,18 @@ public class FolderImpl extends Abstract
         List<StoredObject> result = new ArrayList<StoredObject>();
         for (String id : fObjStore.getIds()) {
             StoredObject obj = fObjStore.getObject(id);
-            Filing pathObj = (Filing) obj;
-            if (fObjStore.hasReadAccess(user, obj) && pathObj.getParents(user).contains(this)) {
-                if (pathObj instanceof VersionedDocument) {
-                    DocumentVersion ver = ((VersionedDocument) pathObj).getLatestVersion(false);
-                    result.add(ver);
-                } else if (pathObj instanceof DocumentVersion) {
-                    // ignore
-                } else {
-                    result.add(obj);
-                }
+            if (obj instanceof Filing) {
+                Filing pathObj = (Filing) obj;
+                if (fObjStore.hasReadAccess(user, obj) && pathObj.getParents(user).contains(this)) {
+                    if (pathObj instanceof VersionedDocument) {
+                        DocumentVersion ver = ((VersionedDocument) pathObj).getLatestVersion(false);
+                        result.add(ver);
+                    } else if (pathObj instanceof DocumentVersion) {
+                        // ignore
+                    } else {
+                        result.add(obj);
+                    }
+                }                
             }
         }
         sortFolderList(result);



Mime
View raw message