You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2010/11/12 15:51:33 UTC
svn commit: r1034410 - in
/incubator/chemistry/opencmis/branches/client-api-refactoring:
chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/
chemistry-opencmis-client/chemistry-opencmis-client...
Author: fmui
Date: Fri Nov 12 14:51:32 2010
New Revision: 1034410
URL: http://svn.apache.org/viewvc?rev=1034410&view=rev
Log:
client API refactoring - second stint - introducing TransientCmisObject
Added:
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientDocument.java (with props)
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java (with props)
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java (with props)
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java (with props)
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java (with props)
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientDocumentImpl.java (with props)
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java (with props)
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java (with props)
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java (with props)
Modified:
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PolicyImpl.java
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.java
incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/AllowableActionsImpl.java
Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java?rev=1034410&r1=1034409&r2=1034410&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java (original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java Fri Nov 12 14:51:32 2010
@@ -18,6 +18,99 @@
*/
package org.apache.chemistry.opencmis.client.api;
-public interface TransientCmisObject extends CmisObjectAdapter {
+import java.util.GregorianCalendar;
+import java.util.List;
+import org.apache.chemistry.opencmis.commons.data.Acl;
+import org.apache.chemistry.opencmis.commons.data.AllowableActions;
+import org.apache.chemistry.opencmis.commons.data.CmisExtensionElement;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.ExtensionLevel;
+
+public interface TransientCmisObject extends CmisObjectAdapter, ObjectId {
+
+ // CMIS properties
+
+ String getName();
+
+ void setName(String name);
+
+ String getCreatedBy();
+
+ GregorianCalendar getCreationDate();
+
+ String getLastModifiedBy();
+
+ GregorianCalendar getLastModificationDate();
+
+ ObjectType getBaseType();
+
+ ObjectType getType();
+
+ BaseTypeId getBaseTypeId();
+
+ String getChangeToken();
+
+ // properties
+
+ List<Property<?>> getProperties();
+
+ <T> Property<T> getProperty(String id);
+
+ <T> T getPropertyValue(String id);
+
+ <T> void setPropertyValue(String id, Object value);
+
+ // read-only
+
+ AllowableActions getAllowableActions();
+
+ List<Relationship> getRelationships();
+
+ List<Rendition> getRenditions();
+
+ // ACL
+
+ void addAce(String principalId, List<String> permissions, AclPropagation aclPropagation);
+
+ void removeAce(String principalId, List<String> permissions, AclPropagation aclPropagation);
+
+ Acl getOriginalAcl();
+
+ // policies
+
+ void applyPolicy(Policy... policyIds);
+
+ void removePolicy(Policy... policyIds);
+
+ List<Policy> getPolicies();
+
+ // delete
+
+ void delete(boolean allVersions);
+
+ // extensions
+
+ List<CmisExtensionElement> getInputExtensions(ExtensionLevel level);
+
+ List<CmisExtensionElement> getOutputExtensions(ExtensionLevel level);
+
+ void setOutputExtensions(ExtensionLevel level, List<CmisExtensionElement> extensions);
+
+ // save
+
+ boolean isMarkedForDelete();
+
+ boolean isModified();
+
+ void reset();
+
+ void refreshAndReset();
+
+ ObjectId save();
+
+ // shared object
+
+ CmisObject getSharedObject();
}
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientDocument.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientDocument.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientDocument.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientDocument.java Fri Nov 12 14:51:32 2010
@@ -0,0 +1,23 @@
+/*
+ * 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.client.api;
+
+public interface TransientDocument extends TransientCmisObject {
+
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientDocument.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java Fri Nov 12 14:51:32 2010
@@ -0,0 +1,23 @@
+/*
+ * 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.client.api;
+
+public interface TransientFolder extends TransientCmisObject {
+
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientFolder.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java Fri Nov 12 14:51:32 2010
@@ -0,0 +1,23 @@
+/*
+ * 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.client.api;
+
+public interface TransientPolicy extends TransientCmisObject {
+
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientPolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java Fri Nov 12 14:51:32 2010
@@ -0,0 +1,23 @@
+/*
+ * 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.client.api;
+
+public interface TransientRelationship extends TransientCmisObject {
+
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientRelationship.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java Fri Nov 12 14:51:32 2010
@@ -0,0 +1,603 @@
+/*
+ * 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.client.runtime;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.client.api.ObjectFactory;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
+import org.apache.chemistry.opencmis.client.api.ObjectType;
+import org.apache.chemistry.opencmis.client.api.Policy;
+import org.apache.chemistry.opencmis.client.api.Property;
+import org.apache.chemistry.opencmis.client.api.Relationship;
+import org.apache.chemistry.opencmis.client.api.Rendition;
+import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.client.api.TransientCmisObject;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.Ace;
+import org.apache.chemistry.opencmis.commons.data.Acl;
+import org.apache.chemistry.opencmis.commons.data.AllowableActions;
+import org.apache.chemistry.opencmis.commons.data.CmisExtensionElement;
+import org.apache.chemistry.opencmis.commons.data.Properties;
+import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.Cardinality;
+import org.apache.chemistry.opencmis.commons.enums.ExtensionLevel;
+import org.apache.chemistry.opencmis.commons.enums.Updatability;
+import org.apache.chemistry.opencmis.commons.spi.CmisBinding;
+import org.apache.chemistry.opencmis.commons.spi.Holder;
+
+import com.sun.xml.internal.txw2.IllegalAnnotationException;
+
+public abstract class AbstractTransientCmisObject implements TransientCmisObject {
+
+ private Session session;
+ private CmisObject object;
+
+ private Map<String, Property<?>> properties;
+ private AllowableActions allowableActions;
+ private List<Rendition> renditions;
+ private Acl acl;
+ private Map<AclPropagation, List<AceChangeHolder>> addAces;
+ private Map<AclPropagation, List<AceChangeHolder>> removeAces;
+ private List<Policy> policies;
+ private Set<String> addPolicies;
+ private Set<String> removePolicies;
+ private List<Relationship> relationships;
+ private Map<ExtensionLevel, List<CmisExtensionElement>> inputExtensions;
+ private Map<ExtensionLevel, List<CmisExtensionElement>> ouputExtensions;
+
+ private boolean isModified;
+ private boolean isPropertyUpdateRequired;
+ private boolean isMarkedForDelete;
+ private boolean deleteAllVersions;
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ protected void initialize(Session session, CmisObject object) {
+ this.session = session;
+ this.object = object;
+
+ ObjectFactory of = getObjectFactory();
+
+ // --- create snapshot ---
+
+ // properties (modifiable)
+ properties = new LinkedHashMap<String, Property<?>>();
+ for (Property<?> property : object.getProperties()) {
+ properties.put(property.getId(),
+ of.createProperty(property.getDefinition(), new ArrayList(property.getValues())));
+ }
+ isPropertyUpdateRequired = false;
+
+ // allowable actions (unmodifiable)
+ allowableActions = object.getAllowableActions();
+
+ // policies (modifiable)
+ policies = new ArrayList<Policy>();
+ if (object.getPolicies() != null) {
+ policies.addAll(object.getPolicies());
+ }
+ addPolicies = new HashSet<String>();
+ removePolicies = new HashSet<String>();
+
+ // ACL (unmodifiable)
+ acl = object.getAcl();
+ addAces = new HashMap<AclPropagation, List<AceChangeHolder>>();
+ removeAces = new HashMap<AclPropagation, List<AceChangeHolder>>();
+
+ // relationships (unmodifiable)
+ relationships = object.getRelationships();
+
+ // renditions (unmodifiable)
+ renditions = object.getRenditions();
+
+ // input extensions (unmodifiable)
+ inputExtensions = new HashMap<ExtensionLevel, List<CmisExtensionElement>>();
+ for (ExtensionLevel level : ExtensionLevel.values()) {
+ List<CmisExtensionElement> extension = object.getExtensions(level);
+ if (extension != null) {
+ inputExtensions.put(level, extension);
+ }
+ }
+
+ // output extensions (modifiable)
+ ouputExtensions = new HashMap<ExtensionLevel, List<CmisExtensionElement>>();
+
+ isModified = false;
+ deleteAllVersions = true;
+ isMarkedForDelete = false;
+ }
+
+ public CmisObject getSharedObject() {
+ return object;
+ }
+
+ /**
+ * Returns the session object.
+ */
+ protected Session getSession() {
+ return this.session;
+ }
+
+ /**
+ * Returns the repository id.
+ */
+ protected String getRepositoryId() {
+ return getSession().getRepositoryInfo().getId();
+ }
+
+ /**
+ * Returns the binding object.
+ */
+ protected CmisBinding getBinding() {
+ return getSession().getBinding();
+ }
+
+ /**
+ * Returns the object factory.
+ */
+ protected ObjectFactory getObjectFactory() {
+ return getSession().getObjectFactory();
+ }
+
+ protected ObjectId getObjectId() {
+ return getSession().createObjectId(getId());
+ }
+
+ public ObjectType getBaseType() {
+ return object.getBaseType();
+ }
+
+ public BaseTypeId getBaseTypeId() {
+ return object.getBaseTypeId();
+ }
+
+ public ObjectType getType() {
+ return object.getType();
+ }
+
+ public String getChangeToken() {
+ return getPropertyValue(PropertyIds.CHANGE_TOKEN);
+ }
+
+ public String getCreatedBy() {
+ return getPropertyValue(PropertyIds.CREATED_BY);
+ }
+
+ public GregorianCalendar getCreationDate() {
+ return getPropertyValue(PropertyIds.CREATION_DATE);
+ }
+
+ public String getId() {
+ return getPropertyValue(PropertyIds.OBJECT_ID);
+ }
+
+ public GregorianCalendar getLastModificationDate() {
+ return getPropertyValue(PropertyIds.LAST_MODIFICATION_DATE);
+ }
+
+ public String getLastModifiedBy() {
+ return getPropertyValue(PropertyIds.LAST_MODIFIED_BY);
+ }
+
+ public String getName() {
+ return getPropertyValue(PropertyIds.NAME);
+ }
+
+ public void setName(String name) {
+ setPropertyValue(PropertyIds.NAME, name);
+ }
+
+ public List<Property<?>> getProperties() {
+ return Collections.unmodifiableList(new ArrayList<Property<?>>(this.properties.values()));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> Property<T> getProperty(String id) {
+ return (Property<T>) this.properties.get(id);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getPropertyValue(String id) {
+ Property<T> property = getProperty(id);
+ if (property == null) {
+ return null;
+ }
+
+ return (T) property.getValue();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> void setPropertyValue(String id, Object value) {
+ PropertyDefinition<T> propertyDefinition = (PropertyDefinition<T>) getType().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 = checkProperty(propertyDefinition, value);
+
+ // create and set property
+ Property<T> newProperty = getObjectFactory().createProperty(propertyDefinition, values);
+ properties.put(id, newProperty);
+
+ isPropertyUpdateRequired = true;
+ isModified = true;
+ }
+
+ public AllowableActions getAllowableActions() {
+ return allowableActions;
+ }
+
+ public List<Relationship> getRelationships() {
+ return relationships;
+ }
+
+ public List<Rendition> getRenditions() {
+ return renditions;
+ }
+
+ public void delete(boolean allVersions) {
+ deleteAllVersions = allVersions;
+ isMarkedForDelete = true;
+ isModified = true;
+ }
+
+ public void applyPolicy(Policy... policyIds) {
+ for (Policy policy : policyIds) {
+ if ((policy != null) && (policy.getId() != null)) {
+ addPolicies.add(policy.getId());
+ addPolicyToPolicyList(policy);
+ }
+ }
+ }
+
+ public void removePolicy(Policy... policyIds) {
+ for (Policy policy : policyIds) {
+ if ((policy != null) && (policy.getId() != null)) {
+ removePolicies.add(policy.getId());
+ removePolicyFromPolicyList(policy);
+ }
+ }
+ }
+
+ public List<Policy> getPolicies() {
+ return policies;
+ }
+
+ private void addPolicyToPolicyList(Policy policy) {
+ for (Policy p : policies) {
+ if (policy.getId().equals(p.getId())) {
+ return;
+ }
+ }
+
+ policies.add(policy);
+ }
+
+ private void removePolicyFromPolicyList(Policy policy) {
+ Iterator<Policy> iter = policies.iterator();
+ while (iter.hasNext()) {
+ Policy p = iter.next();
+ if (policy.getId().equals(p.getId())) {
+ iter.remove();
+ }
+ }
+ }
+
+ public Acl getOriginalAcl() {
+ return acl;
+ }
+
+ public void addAce(String principalId, List<String> permissions, AclPropagation aclPropagation) {
+ AceChangeHolder ach = new AceChangeHolder(principalId, permissions, aclPropagation);
+
+ List<AceChangeHolder> list = addAces.get(aclPropagation);
+ if (list == null) {
+ list = new ArrayList<AbstractTransientCmisObject.AceChangeHolder>();
+ addAces.put(aclPropagation, list);
+ }
+
+ list.add(ach);
+ }
+
+ public void removeAce(String principalId, List<String> permissions, AclPropagation aclPropagation) {
+ AceChangeHolder ach = new AceChangeHolder(principalId, permissions, aclPropagation);
+
+ List<AceChangeHolder> list = removeAces.get(aclPropagation);
+ if (list == null) {
+ list = new ArrayList<AbstractTransientCmisObject.AceChangeHolder>();
+ removeAces.put(aclPropagation, list);
+ }
+
+ list.add(ach);
+ }
+
+ public List<CmisExtensionElement> getInputExtensions(ExtensionLevel level) {
+ return inputExtensions.get(level);
+ }
+
+ public List<CmisExtensionElement> getOutputExtensions(ExtensionLevel level) {
+ return ouputExtensions.get(level);
+ }
+
+ public void setOutputExtensions(ExtensionLevel level, List<CmisExtensionElement> extensions) {
+ ouputExtensions.put(level, extensions);
+ }
+
+ public boolean isMarkedForDelete() {
+ return isMarkedForDelete;
+ }
+
+ public boolean isModified() {
+ return isModified;
+ }
+
+ public void reset() {
+ initialize(session, object);
+ }
+
+ public void refreshAndReset() {
+ object.refresh();
+ reset();
+ }
+
+ public ObjectId save() {
+ if (!isModified) {
+ // nothing has change, so there is nothing to do
+ return getObjectId();
+ }
+
+ String newObjectId = getId();
+
+ newObjectId = saveDelete(newObjectId);
+ if (newObjectId == null) {
+ // object has been deleted, there is nothing else to do
+ // ... and there is no object id anymore
+ return null;
+ }
+
+ newObjectId = saveProperties(newObjectId);
+ newObjectId = savePolicies(newObjectId);
+ newObjectId = saveACL(newObjectId);
+
+ return getSession().createObjectId(newObjectId);
+ }
+
+ protected String saveDelete(String objectId) {
+ if (isMarkedForDelete) {
+ getBinding().getObjectService().deleteObject(getRepositoryId(), objectId, deleteAllVersions, null);
+ return null;
+ }
+
+ return objectId;
+ }
+
+ protected String saveProperties(String objectId) {
+ if (isPropertyUpdateRequired) {
+ Holder<String> objectIdHolder = new Holder<String>(objectId);
+ Holder<String> changeTokenHolder = new Holder<String>(getChangeToken());
+
+ Set<Updatability> updatebility = new HashSet<Updatability>();
+ updatebility.add(Updatability.READWRITE);
+
+ // check if checked out
+ Boolean isCheckedOut = getPropertyValue(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT);
+ if ((isCheckedOut != null) && isCheckedOut.booleanValue()) {
+ updatebility.add(Updatability.WHENCHECKEDOUT);
+ }
+
+ // convert properties
+ Properties props = getObjectFactory().convertProperties(properties, getType(), updatebility);
+
+ // extensions
+ List<CmisExtensionElement> extensions = ouputExtensions.get(ExtensionLevel.PROPERTIES);
+ if (extensions != null) {
+ props.setExtensions(extensions);
+ }
+
+ // it's time to update
+ getBinding().getObjectService().updateProperties(getRepositoryId(), objectIdHolder, changeTokenHolder,
+ props, null);
+
+ if (objectIdHolder.getValue() != null) {
+ return objectIdHolder.getValue();
+ }
+ }
+
+ return objectId;
+ }
+
+ protected String savePolicies(String objectId) {
+ // add policies
+ for (String policyId : addPolicies) {
+ getBinding().getPolicyService().applyPolicy(getRepositoryId(), policyId, objectId, null);
+ }
+
+ // remove policies
+ for (String policyId : removePolicies) {
+ getBinding().getPolicyService().removePolicy(getRepositoryId(), policyId, objectId, null);
+ }
+
+ return objectId;
+ }
+
+ protected String saveACL(String objectId) {
+
+ ObjectFactory of = getObjectFactory();
+
+ for (AclPropagation ap : AclPropagation.values()) {
+ if (!addAces.containsKey(ap) && !removeAces.containsKey(ap)) {
+ continue;
+ }
+
+ Acl addAcl = null;
+ if (addAces.containsKey(ap)) {
+ List<Ace> aces = new ArrayList<Ace>();
+ for (AceChangeHolder ach : addAces.get(ap)) {
+ aces.add(of.createAce(ach.getPrincipalId(), ach.getPermissions()));
+ }
+
+ addAcl = of.createAcl(aces);
+ }
+
+ Acl removeAcl = null;
+ if (removeAces.containsKey(ap)) {
+ List<Ace> aces = new ArrayList<Ace>();
+ for (AceChangeHolder ach : removeAces.get(ap)) {
+ aces.add(of.createAce(ach.getPrincipalId(), ach.getPermissions()));
+ }
+
+ removeAcl = of.createAcl(aces);
+ }
+
+ getBinding().getAclService().applyAcl(getRepositoryId(), objectId, addAcl, removeAcl, ap, null);
+ }
+
+ return objectId;
+ }
+
+ // --- internal ---
+
+ /**
+ * Checks if a value matches a property definition.
+ * <p>
+ * Returns a list of values.
+ */
+ @SuppressWarnings("unchecked")
+ private <T> List<T> checkProperty(PropertyDefinition<T> propertyDefinition, Object value) {
+
+ // null values are ok for updates
+ if (value == null) {
+ return null;
+ }
+
+ // single and multi value check
+ List<T> values = null;
+ if (value instanceof List<?>) {
+ if (propertyDefinition.getCardinality() != Cardinality.MULTI) {
+ throw new IllegalArgumentException("Property '" + propertyDefinition.getId()
+ + "' is not a multi value property!");
+ }
+
+ values = (List<T>) value;
+ if (values.isEmpty()) {
+ return values;
+ }
+ } else {
+ if (propertyDefinition.getCardinality() != Cardinality.SINGLE) {
+ throw new IllegalArgumentException("Property '" + propertyDefinition.getId()
+ + "' is not a single value property!");
+ }
+
+ values = Collections.singletonList((T) value);
+ }
+
+ // check if list contains null values
+ for (Object o : values) {
+ if (o == null) {
+ throw new IllegalArgumentException("Property '" + propertyDefinition.getId()
+ + "' contains null values!");
+ }
+ }
+
+ // take a sample and test the data type
+ boolean typeMatch = false;
+ Object firstValue = values.get(0);
+
+ switch (propertyDefinition.getPropertyType()) {
+ case STRING:
+ case ID:
+ case URI:
+ case HTML:
+ typeMatch = (firstValue instanceof String);
+ break;
+ case INTEGER:
+ typeMatch = (firstValue instanceof BigInteger) || (firstValue instanceof Byte)
+ || (firstValue instanceof Short) || (firstValue instanceof Integer) || (firstValue instanceof Long);
+ break;
+ case DECIMAL:
+ typeMatch = (firstValue instanceof BigDecimal);
+ break;
+ case BOOLEAN:
+ typeMatch = (firstValue instanceof Boolean);
+ break;
+ case DATETIME:
+ typeMatch = (firstValue instanceof GregorianCalendar);
+ break;
+ }
+
+ if (!typeMatch) {
+ throw new IllegalArgumentException("Value of property '" + propertyDefinition.getId()
+ + "' does not match property type!");
+ }
+
+ return values;
+ }
+
+ // --- ACE helper class ---
+
+ public class AceChangeHolder {
+ private String principalId;
+ private List<String> permissions;
+ private AclPropagation aclPropagation;
+
+ public AceChangeHolder(String principalId, List<String> permissions, AclPropagation aclPropagation) {
+ if ((principalId == null) || (principalId.length() == 0)) {
+ throw new IllegalAnnotationException("Principal id must be set!");
+ }
+
+ if ((permissions == null) || (permissions.size() == 0)) {
+ throw new IllegalAnnotationException("Permissions id must be set!");
+ }
+
+ this.principalId = principalId;
+ this.permissions = permissions;
+ this.aclPropagation = aclPropagation;
+ }
+
+ public String getPrincipalId() {
+ return principalId;
+ }
+
+ public List<String> getPermissions() {
+ return permissions;
+ }
+
+ public AclPropagation getAclPropagation() {
+ return aclPropagation;
+ }
+ }
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractTransientCmisObject.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java?rev=1034410&r1=1034409&r2=1034410&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java (original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/DocumentImpl.java Fri Nov 12 14:51:32 2010
@@ -32,6 +32,7 @@ import org.apache.chemistry.opencmis.cli
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.commons.PropertyIds;
import org.apache.chemistry.opencmis.commons.data.Ace;
import org.apache.chemistry.opencmis.commons.data.ContentStream;
@@ -48,11 +49,18 @@ public class DocumentImpl extends Abstra
/**
* Constructor.
*/
- public DocumentImpl(SessionImpl session, ObjectType objectType, ObjectData objectData,
- OperationContext context) {
+ public DocumentImpl(SessionImpl session, ObjectType objectType, ObjectData objectData, OperationContext context) {
initialize(session, objectType, objectData, context);
}
+ @Override
+ protected TransientCmisObject createTransientCmisObject() {
+ TransientDocumentImpl td = new TransientDocumentImpl();
+ td.initialize(getSession(), this);
+
+ return td;
+ }
+
// properties
public String getCheckinComment() {
Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java?rev=1034410&r1=1034409&r2=1034410&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java (original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/FolderImpl.java Fri Nov 12 14:51:32 2010
@@ -30,12 +30,13 @@ import org.apache.chemistry.opencmis.cli
import org.apache.chemistry.opencmis.client.api.Document;
import org.apache.chemistry.opencmis.client.api.FileableCmisObject;
import org.apache.chemistry.opencmis.client.api.Folder;
+import org.apache.chemistry.opencmis.client.api.ItemIterable;
import org.apache.chemistry.opencmis.client.api.ObjectFactory;
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.ItemIterable;
import org.apache.chemistry.opencmis.client.api.Policy;
+import org.apache.chemistry.opencmis.client.api.TransientCmisObject;
import org.apache.chemistry.opencmis.client.api.Tree;
import org.apache.chemistry.opencmis.client.runtime.util.AbstractPageFetcher;
import org.apache.chemistry.opencmis.client.runtime.util.CollectionIterable;
@@ -70,11 +71,18 @@ public class FolderImpl extends Abstract
/**
* Constructor.
*/
- public FolderImpl(SessionImpl session, ObjectType objectType, ObjectData objectData,
- OperationContext context) {
+ public FolderImpl(SessionImpl session, ObjectType objectType, ObjectData objectData, OperationContext context) {
initialize(session, objectType, objectData, context);
}
+ @Override
+ protected TransientCmisObject createTransientCmisObject() {
+ TransientFolderImpl tf = new TransientFolderImpl();
+ tf.initialize(getSession(), this);
+
+ return tf;
+ }
+
public Document createDocument(Map<String, ?> properties, ContentStream contentStream,
VersioningState versioningState, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces,
OperationContext context) {
@@ -252,10 +260,10 @@ public class FolderImpl extends Abstract
protected AbstractPageFetcher.Page<Document> fetchPage(long skipCount) {
// get checked out documents for this folder
- ObjectList checkedOutDocs = navigationService.getCheckedOutDocs(getRepositoryId(), objectId, ctxt
- .getFilterString(), ctxt.getOrderBy(), ctxt.isIncludeAllowableActions(), ctxt
- .getIncludeRelationships(), ctxt.getRenditionFilterString(), BigInteger
- .valueOf(this.maxNumItems), BigInteger.valueOf(skipCount), null);
+ ObjectList checkedOutDocs = navigationService.getCheckedOutDocs(getRepositoryId(), objectId,
+ ctxt.getFilterString(), ctxt.getOrderBy(), ctxt.isIncludeAllowableActions(),
+ ctxt.getIncludeRelationships(), ctxt.getRenditionFilterString(),
+ BigInteger.valueOf(this.maxNumItems), BigInteger.valueOf(skipCount), null);
// convert objects
List<Document> page = new ArrayList<Document>();
@@ -293,9 +301,9 @@ public class FolderImpl extends Abstract
protected AbstractPageFetcher.Page<CmisObject> fetchPage(long skipCount) {
// get the children
- ObjectInFolderList children = navigationService.getChildren(getRepositoryId(), objectId, ctxt
- .getFilterString(), ctxt.getOrderBy(), ctxt.isIncludeAllowableActions(), ctxt
- .getIncludeRelationships(), ctxt.getRenditionFilterString(), ctxt.isIncludePathSegments(),
+ ObjectInFolderList children = navigationService.getChildren(getRepositoryId(), objectId,
+ ctxt.getFilterString(), ctxt.getOrderBy(), ctxt.isIncludeAllowableActions(),
+ ctxt.getIncludeRelationships(), ctxt.getRenditionFilterString(), ctxt.isIncludePathSegments(),
BigInteger.valueOf(this.maxNumItems), BigInteger.valueOf(skipCount), null);
// convert objects
@@ -309,8 +317,7 @@ public class FolderImpl extends Abstract
}
}
- return new AbstractPageFetcher.Page<CmisObject>(page, children.getNumItems(), children
- .hasMoreItems());
+ return new AbstractPageFetcher.Page<CmisObject>(page, children.getNumItems(), children.hasMoreItems());
}
});
}
@@ -445,12 +452,13 @@ public class FolderImpl extends Abstract
public Document createDocument(Map<String, ?> properties, ContentStream contentStream,
VersioningState versioningState) {
- return this.createDocument(properties, contentStream, versioningState, null, null, null, getSession().getDefaultContext());
+ return this.createDocument(properties, contentStream, versioningState, null, null, null, getSession()
+ .getDefaultContext());
}
- public Document createDocumentFromSource(ObjectId source, Map<String, ?> properties,
- VersioningState versioningState) {
- return this.createDocumentFromSource(source, properties, versioningState, null, null, null, getSession().getDefaultContext());
+ public Document createDocumentFromSource(ObjectId source, Map<String, ?> properties, VersioningState versioningState) {
+ return this.createDocumentFromSource(source, properties, versioningState, null, null, null, getSession()
+ .getDefaultContext());
}
public Folder createFolder(Map<String, ?> properties) {
Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PolicyImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PolicyImpl.java?rev=1034410&r1=1034409&r2=1034410&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PolicyImpl.java (original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PolicyImpl.java Fri Nov 12 14:51:32 2010
@@ -21,6 +21,7 @@ package org.apache.chemistry.opencmis.cl
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.commons.PropertyIds;
import org.apache.chemistry.opencmis.commons.data.ObjectData;
@@ -29,11 +30,18 @@ public class PolicyImpl extends Abstract
/**
* Constructor.
*/
- public PolicyImpl(SessionImpl session, ObjectType objectType, ObjectData objectData,
- OperationContext context) {
+ public PolicyImpl(SessionImpl session, ObjectType objectType, ObjectData objectData, OperationContext context) {
initialize(session, objectType, objectData, context);
}
+ @Override
+ protected TransientCmisObject createTransientCmisObject() {
+ TransientPolicyImpl tp = new TransientPolicyImpl();
+ tp.initialize(getSession(), this);
+
+ return tp;
+ }
+
public String getPolicyText() {
return getPropertyValue(PropertyIds.POLICY_TEXT);
}
Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java?rev=1034410&r1=1034409&r2=1034410&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java (original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PropertyImpl.java Fri Nov 12 14:51:32 2010
@@ -19,6 +19,7 @@
package org.apache.chemistry.opencmis.client.runtime;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
@@ -58,6 +59,19 @@ public class PropertyImpl<T> extends Abs
setValues(values);
}
+ /**
+ * Copy constructor.
+ */
+ public PropertyImpl(Property<T> property) {
+ if (property == null) {
+ throw new IllegalArgumentException("Source must be set!");
+ }
+
+ propertyDefinition = property.getDefinition();
+ initialize(property.getDefinition());
+ setValues(new ArrayList<T>(property.getValues()));
+ }
+
public PropertyDefinition<T> getDefinition() {
return propertyDefinition;
}
Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.java?rev=1034410&r1=1034409&r2=1034410&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.java (original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RelationshipImpl.java Fri Nov 12 14:51:32 2010
@@ -23,6 +23,7 @@ import org.apache.chemistry.opencmis.cli
import org.apache.chemistry.opencmis.client.api.ObjectType;
import org.apache.chemistry.opencmis.client.api.OperationContext;
import org.apache.chemistry.opencmis.client.api.Relationship;
+import org.apache.chemistry.opencmis.client.api.TransientCmisObject;
import org.apache.chemistry.opencmis.commons.PropertyIds;
import org.apache.chemistry.opencmis.commons.data.ObjectData;
@@ -31,11 +32,18 @@ public class RelationshipImpl extends Ab
/**
* Constructor.
*/
- public RelationshipImpl(SessionImpl session, ObjectType objectType, ObjectData objectData,
- OperationContext context) {
+ public RelationshipImpl(SessionImpl session, ObjectType objectType, ObjectData objectData, OperationContext context) {
initialize(session, objectType, objectData, context);
}
+ @Override
+ protected TransientCmisObject createTransientCmisObject() {
+ TransientRelationshipImpl tr = new TransientRelationshipImpl();
+ tr.initialize(getSession(), this);
+
+ return tr;
+ }
+
public CmisObject getSource() {
return getSource(getSession().getDefaultContext());
}
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientDocumentImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientDocumentImpl.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientDocumentImpl.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientDocumentImpl.java Fri Nov 12 14:51:32 2010
@@ -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.client.runtime;
+
+import org.apache.chemistry.opencmis.client.api.TransientDocument;
+
+public class TransientDocumentImpl extends AbstractTransientCmisObject implements TransientDocument {
+
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientDocumentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java Fri Nov 12 14:51:32 2010
@@ -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.client.runtime;
+
+import org.apache.chemistry.opencmis.client.api.TransientFolder;
+
+public class TransientFolderImpl extends AbstractTransientCmisObject implements TransientFolder {
+
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientFolderImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java Fri Nov 12 14:51:32 2010
@@ -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.client.runtime;
+
+import org.apache.chemistry.opencmis.client.api.TransientPolicy;
+
+public class TransientPolicyImpl extends AbstractTransientCmisObject implements TransientPolicy {
+
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientPolicyImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java?rev=1034410&view=auto
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java (added)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java Fri Nov 12 14:51:32 2010
@@ -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.client.runtime;
+
+import org.apache.chemistry.opencmis.client.api.TransientRelationship;
+
+public class TransientRelationshipImpl extends AbstractTransientCmisObject implements TransientRelationship {
+
+}
Propchange: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/TransientRelationshipImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/AllowableActionsImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/AllowableActionsImpl.java?rev=1034410&r1=1034409&r2=1034410&view=diff
==============================================================================
--- incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/AllowableActionsImpl.java (original)
+++ incubator/chemistry/opencmis/branches/client-api-refactoring/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/AllowableActionsImpl.java Fri Nov 12 14:51:32 2010
@@ -25,20 +25,12 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.enums.Action;
/**
- * @author <a href="mailto:fmueller@opentext.com">Florian Müller</a>
- *
+ * Allowable Actions.
*/
public class AllowableActionsImpl extends AbstractExtensionData implements AllowableActions {
private Set<Action> allowableActions = new HashSet<Action>();
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.opencmis.client.provider.AllowableActionsData#getAllowableActions
- * ()
- */
public Set<Action> getAllowableActions() {
return allowableActions;
}
@@ -47,11 +39,6 @@ public class AllowableActionsImpl extend
this.allowableActions = allowableActions;
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
@Override
public String toString() {
return "Allowable Actions [allowable actions=" + allowableActions + "]" + super.toString();