Revision: 39
Author:
jeanmari...@alfresco.com
Date: Tue Mar 18 15:06:05 2014 UTC
Log: Update to reflect modification on OpenCMIS 1.0.0-SNAPSHOT +
preparation of AlfrescoItem.
http://code.google.com/a/apache-extras.org/p/alfresco-opencmis-extension/source/detail?r=39
Added:
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoItemImpl.java
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoItemTypeImpl.java
/branches/android/src/main/java/org/alfresco/cmis/client/type/AlfrescoItemType.java
Deleted:
/branches/android/src/main/java/org/alfresco/cmis/client/TransientAlfrescoDocument.java
/branches/android/src/main/java/org/alfresco/cmis/client/TransientAlfrescoFolder.java
/branches/android/src/main/java/org/alfresco/cmis/client/impl/TransientAlfrescoAspectsImpl.java
/branches/android/src/main/java/org/alfresco/cmis/client/impl/TransientAlfrescoDocumentImpl.java
/branches/android/src/main/java/org/alfresco/cmis/client/impl/TransientAlfrescoFolderImpl.java
Modified:
/branches/android
/branches/android/pom.xml
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoDocumentImpl.java
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoFolderImpl.java
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoObjectFactoryImpl.java
=======================================
--- /dev/null
+++
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoItemImpl.java
Tue Mar 18 15:06:05 2014 UTC
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005-2014 Alfresco Software Limited.
+ *
+ * Licensed 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.alfresco.cmis.client.impl;
+
+import org.apache.chemistry.opencmis.client.api.ObjectType;
+import org.apache.chemistry.opencmis.client.api.OperationContext;
+import org.apache.chemistry.opencmis.client.runtime.ItemImpl;
+import org.apache.chemistry.opencmis.client.runtime.SessionImpl;
+import org.apache.chemistry.opencmis.commons.data.ObjectData;
+
+public class AlfrescoItemImpl extends ItemImpl
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = -564801526480912392L;
+
+ public AlfrescoItemImpl(SessionImpl session, ObjectType objectType,
+ ObjectData objectData, OperationContext context)
+ {
+ super(session, objectType, objectData, context);
+ }
+}
=======================================
--- /dev/null
+++
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoItemTypeImpl.java
Tue Mar 18 15:06:05 2014 UTC
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2005-2014 Alfresco Software Limited.
+ *
+ * Licensed 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.alfresco.cmis.client.impl;
+
+public class AlfrescoItemTypeImpl {
+
+}
=======================================
--- /dev/null
+++
/branches/android/src/main/java/org/alfresco/cmis/client/type/AlfrescoItemType.java
Tue Mar 18 15:06:05 2014 UTC
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-2014 Alfresco Software Limited.
+ *
+ * Licensed 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.alfresco.cmis.client.type;
+
+import java.util.List;
+
+import org.alfresco.cmis.client.impl.AlfrescoUtils;
+import org.apache.chemistry.opencmis.client.api.Session;
+import
org.apache.chemistry.opencmis.client.runtime.objecttype.ItemTypeImpl;
+import
org.apache.chemistry.opencmis.commons.definitions.ItemTypeDefinition;
+
+public class AlfrescoItemType extends ItemTypeImpl implements AlfrescoType
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8384158771339321883L;
+
+ public AlfrescoItemType(Session session, ItemTypeDefinition
typeDefinition) {
+ super(session, typeDefinition);
+ }
+
+ public List<String> getMandatoryAspects() {
+ return AlfrescoUtils.getMandatoryAspects(this);
+ }
+}
=======================================
---
/branches/android/src/main/java/org/alfresco/cmis/client/TransientAlfrescoDocument.java
Mon Apr 4 11:55:46 2011 UTC
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2005-2011 Alfresco Software Limited.
- *
- * Licensed 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.alfresco.cmis.client;
-
-import org.apache.chemistry.opencmis.client.api.TransientDocument;
-
-public interface TransientAlfrescoDocument extends TransientDocument,
AlfrescoAspects
-{
-}
=======================================
---
/branches/android/src/main/java/org/alfresco/cmis/client/TransientAlfrescoFolder.java
Mon Apr 4 11:55:46 2011 UTC
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2005-2011 Alfresco Software Limited.
- *
- * Licensed 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.alfresco.cmis.client;
-
-import org.apache.chemistry.opencmis.client.api.TransientFolder;
-
-public interface TransientAlfrescoFolder extends TransientFolder,
AlfrescoAspects
-{
-}
=======================================
---
/branches/android/src/main/java/org/alfresco/cmis/client/impl/TransientAlfrescoAspectsImpl.java
Fri Oct 4 13:51:33 2013 UTC
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2005-2011 Alfresco Software Limited.
- *
- * Licensed 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.alfresco.cmis.client.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.alfresco.cmis.client.AlfrescoAspects;
-import org.alfresco.cmis.client.AlfrescoDocument;
-import org.alfresco.cmis.client.AlfrescoFolder;
-import org.apache.chemistry.opencmis.client.api.CmisObject;
-import org.apache.chemistry.opencmis.client.api.ObjectType;
-import org.apache.chemistry.opencmis.client.api.Session;
-import org.apache.chemistry.opencmis.client.api.TransientCmisObject;
-import org.apache.chemistry.opencmis.commons.data.CmisExtensionElement;
-import org.apache.chemistry.opencmis.commons.enums.ExtensionLevel;
-
-public class TransientAlfrescoAspectsImpl implements AlfrescoAspects {
- private Session session;
- private CmisObject object;
- private Map<String, ObjectType> aspectTypes;
- private Map<String, ObjectType> addAspectTypes;
- private Map<String, ObjectType> removeAspectTypes;
-
- public TransientAlfrescoAspectsImpl(Session session, CmisObject object) {
- this.session = session;
- this.object = object;
-
- List<CmisExtensionElement> alfrescoExtensions = AlfrescoUtils
- .findAlfrescoExtensions(object
- .getExtensions(ExtensionLevel.PROPERTIES));
-
- if (alfrescoExtensions == null) {
- aspectTypes = Collections.emptyMap();
- } else {
- aspectTypes = new HashMap<String, ObjectType>();
- for (ObjectType type : AlfrescoUtils.getAspectTypes(session,
- alfrescoExtensions)) {
- if (type != null) {
- aspectTypes.put(type.getId(), type);
- }
- }
- }
-
- addAspectTypes = new HashMap<String, ObjectType>();
- removeAspectTypes = new HashMap<String, ObjectType>();
- }
-
- public ObjectType getTypeWithAspects() {
- if (object instanceof AlfrescoDocument) {
- return new AlfrescoDocumentTypeImpl((AlfrescoDocument) object);
- } else if (object instanceof AlfrescoFolder) {
- return new AlfrescoFolderTypeImpl((AlfrescoFolder) object);
- } else {
- return object.getType();
- }
- }
-
- public boolean hasAspect(String id) {
- return (aspectTypes.containsKey(id) || addAspectTypes.containsKey(id))
- && (!removeAspectTypes.containsKey(id));
- }
-
- public boolean hasAspect(ObjectType type) {
- return type == null ? false : hasAspect(type.getId());
- }
-
- public Collection<ObjectType> getAspects() {
- Collection<ObjectType> result = new ArrayList<ObjectType>();
- Set<String> addTypes = new HashSet<String>(addAspectTypes.keySet());
-
- for (String typeId : aspectTypes.keySet()) {
- if (!removeAspectTypes.containsKey(typeId)) {
- result.add(aspectTypes.get(typeId));
- }
- addTypes.remove(typeId);
- }
-
- for (String typeId : addTypes) {
- result.add(addAspectTypes.get(typeId));
- }
-
- return result;
- }
-
- public ObjectType findAspect(String propertyId) {
- return AlfrescoUtils.findAspect(getAspects(), propertyId);
- }
-
- public CmisObject addAspect(String... id) {
- if (id == null || id.length == 0) {
- throw new IllegalArgumentException("Id must be set!");
- }
-
- ObjectType[] types = new ObjectType[id.length];
- for (int i = 0; i < id.length; i++) {
- types[i] = session.getTypeDefinition(id[i]);
- }
-
- return addAspect(types);
- }
-
- public CmisObject addAspect(ObjectType... type) {
- if (type == null || type.length == 0) {
- throw new IllegalArgumentException("Type must be set!");
- }
-
- for (ObjectType t : type) {
- if (t != null) {
- addAspectTypes.put(t.getId(), t);
- removeAspectTypes.remove(t.getId());
- }
- }
-
- return object;
- }
-
- public void setPropertyValues(TransientCmisObject object,
- Map<String, ?> properties) {
- if (properties == null || properties.isEmpty()) {
- return;
- }
-
- for (Map.Entry<String, ?> property : properties.entrySet()) {
- object.setPropertyValue(property.getKey(), property.getValue());
- }
- }
-
- public CmisObject addAspect(ObjectType type, Map<String, ?> properties) {
- return addAspect(type);
- }
-
- public CmisObject addAspect(ObjectType[] type, Map<String, ?> properties)
{
- return addAspect(type);
- }
-
- public CmisObject addAspect(String id, Map<String, ?> properties) {
- return addAspect(id);
- }
-
- public CmisObject addAspect(String[] id, Map<String, ?> properties) {
- return addAspect(id);
- }
-
- public CmisObject removeAspect(String... id) {
- if (id == null || id.length == 0) {
- throw new IllegalArgumentException("Id must be set!");
- }
-
- ObjectType[] types = new ObjectType[id.length];
- for (int i = 0; i < id.length; i++) {
- types[i] = session.getTypeDefinition(id[i]);
- }
-
- return removeAspect(types);
- }
-
- public CmisObject removeAspect(ObjectType... type) {
- if (type == null || type.length == 0) {
- throw new IllegalArgumentException("Type must be set!");
- }
-
- for (ObjectType t : type) {
- if (t != null) {
- addAspectTypes.remove(t.getId());
- removeAspectTypes.put(t.getId(), t);
- }
- }
- return object;
- }
-
- public void save() {
- if (addAspectTypes.isEmpty() && removeAspectTypes.isEmpty()) {
- return;
- }
-
- AlfrescoUtils.updateAspects(session, object,
- addAspectTypes.values().toArray(new ObjectType[0]),
- removeAspectTypes.values().toArray(new ObjectType[0]), null);
- }
-}
=======================================
---
/branches/android/src/main/java/org/alfresco/cmis/client/impl/TransientAlfrescoDocumentImpl.java
Fri Oct 4 13:51:33 2013 UTC
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2005-2011 Alfresco Software Limited.
- *
- * Licensed 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.alfresco.cmis.client.impl;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.cmis.client.TransientAlfrescoDocument;
-import org.apache.chemistry.opencmis.client.api.CmisObject;
-import org.apache.chemistry.opencmis.client.api.ObjectId;
-import org.apache.chemistry.opencmis.client.api.ObjectType;
-import org.apache.chemistry.opencmis.client.api.Property;
-import org.apache.chemistry.opencmis.client.api.Session;
-import org.apache.chemistry.opencmis.client.runtime.TransientDocumentImpl;
-import org.apache.chemistry.opencmis.commons.PropertyIds;
-import org.apache.chemistry.opencmis.commons.data.Properties;
-import
org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
-import org.apache.chemistry.opencmis.commons.enums.Updatability;
-
-public class TransientAlfrescoDocumentImpl extends TransientDocumentImpl
- implements TransientAlfrescoDocument {
- protected TransientAlfrescoAspectsImpl aspects;
-
- @Override
- protected void initialize(Session session, CmisObject object) {
- super.initialize(session, object);
- aspects = new TransientAlfrescoAspectsImpl(session, object);
- }
-
- public ObjectType getTypeWithAspects()
- {
- return aspects.getTypeWithAspects();
- }
-
- @SuppressWarnings("unchecked")
- public <T> void setPropertyValue(String id, Object value) {
- ObjectType aspectType = aspects.findAspect(id);
-
- if (aspectType == null) {
- super.setPropertyValue(id, value);
- return;
- }
-
- PropertyDefinition<T> propertyDefinition = (PropertyDefinition<T>)
aspectType
- .getPropertyDefinitions().get(id);
- if (propertyDefinition == null) {
- throw new IllegalArgumentException("Unknown property '" + id + "'!");
- }
- // check updatability
- if (propertyDefinition.getUpdatability() == Updatability.READONLY) {
- throw new IllegalArgumentException("Property is read-only!");
- }
-
- List<T> values = AlfrescoUtils.checkProperty(propertyDefinition,
- value);
-
- // create and set property
- Property<T> newProperty = getObjectFactory().createProperty(
- propertyDefinition, values);
- properties.put(id, newProperty);
-
- isPropertyUpdateRequired = true;
- isModified = true;
- }
-
- public boolean hasAspect(String id) {
- return aspects.hasAspect(id);
- }
-
- public boolean hasAspect(ObjectType type) {
- return aspects.hasAspect(type);
- }
-
- public Collection<ObjectType> getAspects() {
- return aspects.getAspects();
- }
-
- public ObjectType findAspect(String propertyId) {
- return aspects.findAspect(propertyId);
- }
-
- public CmisObject addAspect(String... id) {
- return aspects.addAspect(id);
- }
-
- public CmisObject addAspect(ObjectType... type) {
- return aspects.addAspect(type);
- }
-
- public CmisObject addAspect(ObjectType type, Map<String, ?> properties) {
- CmisObject cmisObject = aspects.addAspect(type);
- aspects.setPropertyValues(this, properties);
- return cmisObject;
- }
-
- public CmisObject addAspect(ObjectType[] type, Map<String, ?> properties)
{
- CmisObject cmisObject = aspects.addAspect(type);
- aspects.setPropertyValues(this, properties);
- return cmisObject;
- }
-
- public CmisObject addAspect(String id, Map<String, ?> properties) {
- CmisObject cmisObject = aspects.addAspect(id);
- aspects.setPropertyValues(this, properties);
- return cmisObject;
- }
-
- public CmisObject addAspect(String[] id, Map<String, ?> properties) {
- CmisObject cmisObject = aspects.addAspect(id);
- aspects.setPropertyValues(this, properties);
- return cmisObject;
- }
-
- public CmisObject removeAspect(String... id) {
- return aspects.removeAspect(id);
- }
-
- public CmisObject removeAspect(ObjectType... type) {
- return aspects.removeAspect(type);
- }
-
- @Override
- public ObjectId save() {
- ObjectId id = super.save();
- if (!isMarkedForDelete) {
- aspects.save();
- }
-
- return id;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected Properties prepareProperties() {
- ObjectType type = getType();
- PropertyDefinition<String> propDef = (PropertyDefinition<String>) type
- .getPropertyDefinitions().get(PropertyIds.OBJECT_TYPE_ID);
- String objectTypeIdValue = AlfrescoUtils
- .createObjectTypeIdValue(type, getAspects());
- Property<String> objectTypeIdProperty = getObjectFactory()
- .createProperty(propDef,
- Collections.singletonList(objectTypeIdValue));
-
- properties.put(PropertyIds.OBJECT_TYPE_ID, objectTypeIdProperty);
-
- return super.prepareProperties();
- }
-}
=======================================
---
/branches/android/src/main/java/org/alfresco/cmis/client/impl/TransientAlfrescoFolderImpl.java
Fri Oct 4 13:51:33 2013 UTC
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2005-2011 Alfresco Software Limited.
- *
- * Licensed 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.alfresco.cmis.client.impl;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.cmis.client.AlfrescoAspects;
-import org.apache.chemistry.opencmis.client.api.CmisObject;
-import org.apache.chemistry.opencmis.client.api.ObjectId;
-import org.apache.chemistry.opencmis.client.api.ObjectType;
-import org.apache.chemistry.opencmis.client.api.Property;
-import org.apache.chemistry.opencmis.client.api.Session;
-import org.apache.chemistry.opencmis.client.runtime.TransientFolderImpl;
-import org.apache.chemistry.opencmis.commons.PropertyIds;
-import org.apache.chemistry.opencmis.commons.data.Properties;
-import
org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
-import org.apache.chemistry.opencmis.commons.enums.Updatability;
-
-public class TransientAlfrescoFolderImpl extends TransientFolderImpl
implements AlfrescoAspects
-{
- protected TransientAlfrescoAspectsImpl aspects;
-
- @Override
- protected void initialize(Session session, CmisObject object)
- {
- super.initialize(session, object);
- aspects = new TransientAlfrescoAspectsImpl(session, object);
- }
-
- public ObjectType getTypeWithAspects()
- {
- return aspects.getTypeWithAspects();
- }
-
- @SuppressWarnings("unchecked")
- public <T> void setPropertyValue(String id, Object value)
- {
- ObjectType aspectType = aspects.findAspect(id);
-
- if (aspectType == null)
- {
- super.setPropertyValue(id, value);
- return;
- }
-
- PropertyDefinition<T> propertyDefinition = (PropertyDefinition<T>)
aspectType.getPropertyDefinitions().get(id);
- if (propertyDefinition == null)
- {
- throw new IllegalArgumentException("Unknown property '" + id
+ "'!");
- }
- // check updatability
- if (propertyDefinition.getUpdatability() == Updatability.READONLY)
- {
- throw new IllegalArgumentException("Property is read-only!");
- }
-
- List<T> values = AlfrescoUtils.checkProperty(propertyDefinition,
value);
-
- // create and set property
- Property<T> newProperty =
getObjectFactory().createProperty(propertyDefinition, values);
- properties.put(id, newProperty);
-
- isPropertyUpdateRequired = true;
- isModified = true;
- }
-
- public boolean hasAspect(String id)
- {
- return aspects.hasAspect(id);
- }
-
- public boolean hasAspect(ObjectType type)
- {
- return aspects.hasAspect(type);
- }
-
- public Collection<ObjectType> getAspects()
- {
- return aspects.getAspects();
- }
-
- public ObjectType findAspect(String propertyId)
- {
- return aspects.findAspect(propertyId);
- }
-
- public CmisObject addAspect(String... id)
- {
- return aspects.addAspect(id);
- }
-
- public CmisObject addAspect(ObjectType... type)
- {
- return aspects.addAspect(type);
- }
-
- public CmisObject removeAspect(String... id)
- {
- return aspects.removeAspect(id);
- }
-
- public CmisObject addAspect(ObjectType type, Map<String, ?> properties)
- {
- CmisObject ret = aspects.addAspect(type);
- aspects.setPropertyValues(this, properties);
- return ret;
- }
-
- public CmisObject addAspect(ObjectType[] type, Map<String, ?>
properties)
- {
- CmisObject ret = aspects.addAspect(type);
- aspects.setPropertyValues(this, properties);
- return ret;
- }
-
- public CmisObject addAspect(String id, Map<String, ?> properties)
- {
- CmisObject ret = aspects.addAspect(id);
- aspects.setPropertyValues(this, properties);
- return ret;
- }
-
- public CmisObject addAspect(String[] id, Map<String, ?> properties)
- {
- CmisObject ret = aspects.addAspect(id);
- aspects.setPropertyValues(this, properties);
- return ret;
- }
-
- public CmisObject removeAspect(ObjectType... type)
- {
- return aspects.removeAspect(type);
- }
-
- @Override
- public ObjectId save()
- {
- ObjectId id = super.save();
- if (!isMarkedForDelete)
- {
- aspects.save();
- }
-
- return id;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected Properties prepareProperties()
- {
- ObjectType type = getType();
- PropertyDefinition<String> propDef = (PropertyDefinition<String>)
type.getPropertyDefinitions().get(
- PropertyIds.OBJECT_TYPE_ID);
- String objectTypeIdValue =
AlfrescoUtils.createObjectTypeIdValue(type, getAspects());
- Property<String> objectTypeIdProperty =
getObjectFactory().createProperty(propDef,
- Collections.singletonList(objectTypeIdValue));
-
- properties.put(PropertyIds.OBJECT_TYPE_ID, objectTypeIdProperty);
-
- return super.prepareProperties();
- }
-}
=======================================
--- /branches/android/pom.xml Fri Oct 4 13:51:33 2013 UTC
+++ /branches/android/pom.xml Tue Mar 18 15:06:05 2014 UTC
@@ -20,7 +20,7 @@
<groupId>org.alfresco.cmis.client</groupId>
<artifactId>alfresco-opencmis-extension</artifactId>
<name>Alfresco OpenCMIS Extension</name>
- <version>0.6-ANDROID</version>
+ <version>0.7-ANDROID</version>
<packaging>jar</packaging>
<organization>
@@ -135,7 +135,7 @@
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-android-client</artifactId>
- <version>0.10.0</version>
+ <version>1.0.0-r1578909</version>
</dependency>
</dependencies>
</project>
=======================================
---
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoDocumentImpl.java
Fri Oct 4 13:51:33 2013 UTC
+++
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoDocumentImpl.java
Tue Mar 18 15:06:05 2014 UTC
@@ -26,7 +26,6 @@
import org.apache.chemistry.opencmis.client.api.ObjectType;
import org.apache.chemistry.opencmis.client.api.OperationContext;
import org.apache.chemistry.opencmis.client.api.Policy;
-import org.apache.chemistry.opencmis.client.api.TransientCmisObject;
import org.apache.chemistry.opencmis.client.runtime.DocumentImpl;
import org.apache.chemistry.opencmis.client.runtime.SessionImpl;
import org.apache.chemistry.opencmis.commons.data.Ace;
@@ -50,14 +49,6 @@
super.initialize(session, objectType, objectData, context);
aspects = new AlfrescoAspectsImpl(session, this);
}
-
- @Override
- protected TransientCmisObject createTransientCmisObject() {
- TransientAlfrescoDocumentImpl td = new TransientAlfrescoDocumentImpl();
- td.initialize(getSession(), this);
-
- return td;
- }
public AlfrescoDocumentType getTypeWithAspects() {
readLock();
=======================================
---
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoFolderImpl.java
Fri Oct 4 13:51:33 2013 UTC
+++
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoFolderImpl.java
Tue Mar 18 15:06:05 2014 UTC
@@ -23,7 +23,6 @@
import org.apache.chemistry.opencmis.client.api.ObjectId;
import org.apache.chemistry.opencmis.client.api.ObjectType;
import org.apache.chemistry.opencmis.client.api.OperationContext;
-import org.apache.chemistry.opencmis.client.api.TransientCmisObject;
import org.apache.chemistry.opencmis.client.runtime.FolderImpl;
import org.apache.chemistry.opencmis.client.runtime.SessionImpl;
import org.apache.chemistry.opencmis.commons.data.ObjectData;
@@ -47,15 +46,6 @@
super.initialize(session, objectType, objectData, context);
aspects = new AlfrescoAspectsImpl(session, this);
}
-
- @Override
- protected TransientCmisObject createTransientCmisObject()
- {
- TransientAlfrescoFolderImpl td = new TransientAlfrescoFolderImpl();
- td.initialize(getSession(), this);
-
- return td;
- }
public ObjectType getTypeWithAspects()
{
=======================================
---
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoObjectFactoryImpl.java
Sun Oct 13 11:37:59 2013 UTC
+++
/branches/android/src/main/java/org/alfresco/cmis/client/impl/AlfrescoObjectFactoryImpl.java
Tue Mar 18 15:06:05 2014 UTC
@@ -31,6 +31,7 @@
import org.alfresco.cmis.client.impl.utils.DateUtils;
import org.alfresco.cmis.client.type.AlfrescoDocumentType;
import org.alfresco.cmis.client.type.AlfrescoFolderType;
+import org.alfresco.cmis.client.type.AlfrescoItemType;
import org.alfresco.cmis.client.type.AlfrescoPolicyType;
import org.alfresco.cmis.client.type.AlfrescoRelationshipType;
import org.alfresco.cmis.client.type.AlfrescoSecondaryType;
@@ -40,6 +41,7 @@
import org.apache.chemistry.opencmis.client.api.Property;
import org.apache.chemistry.opencmis.client.api.SecondaryType;
import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.client.runtime.ItemImpl;
import org.apache.chemistry.opencmis.client.runtime.PolicyImpl;
import org.apache.chemistry.opencmis.client.runtime.RelationshipImpl;
import org.apache.chemistry.opencmis.client.runtime.SessionImpl;
@@ -51,6 +53,7 @@
import org.apache.chemistry.opencmis.commons.data.PropertyData;
import
org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition;
import
org.apache.chemistry.opencmis.commons.definitions.FolderTypeDefinition;
+import
org.apache.chemistry.opencmis.commons.definitions.ItemTypeDefinition;
import
org.apache.chemistry.opencmis.commons.definitions.PolicyTypeDefinition;
import
org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
import
org.apache.chemistry.opencmis.commons.definitions.RelationshipTypeDefinition;
@@ -98,6 +101,10 @@
{
ret = new AlfrescoSecondaryType(this.session,
(SecondaryTypeDefinition) typeDefinition);
}
+ else if (typeDefinition instanceof ItemTypeDefinition)
+ {
+ ret = new AlfrescoItemType(this.session, (ItemTypeDefinition)
typeDefinition);
+ }
else
{
throw new CmisRuntimeException("Unknown base type!");
@@ -402,6 +409,8 @@
return new PolicyImpl((SessionImpl) this.session, type,
objectData, context);
case CMIS_RELATIONSHIP:
return new RelationshipImpl((SessionImpl) this.session,
type, objectData, context);
+ case CMIS_ITEM:
+ return new ItemImpl((SessionImpl) this.session, type,
objectData, context);
default:
throw new CmisRuntimeException("unsupported type: " +
objectData.getBaseTypeId());
}