Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 01E039744 for ; Fri, 24 Feb 2012 21:47:21 +0000 (UTC) Received: (qmail 80584 invoked by uid 500); 24 Feb 2012 21:47:20 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 80549 invoked by uid 500); 24 Feb 2012 21:47:20 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 80540 invoked by uid 99); 24 Feb 2012 21:47:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 21:47:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 21:47:17 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5E2AC2388A3D; Fri, 24 Feb 2012 21:46:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1293440 [4/5] - in /chemistry/opencmis/branches/android: ./ chemistry-opencmis-android/ chemistry-opencmis-android/chemistry-opencmis-android-client/ chemistry-opencmis-android/chemistry-opencmis-android-client/src/ chemistry-opencmis-andr... Date: Fri, 24 Feb 2012 21:46:55 -0000 To: commits@chemistry.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120224214657.5E2AC2388A3D@eris.apache.org> Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,302 @@ +/* + * 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.bindings.spi.atompub; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; + +import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession; +import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomElement; +import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry; +import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed; +import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink; +import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils; +import org.apache.chemistry.opencmis.commons.data.Acl; +import org.apache.chemistry.opencmis.commons.data.ContentStream; +import org.apache.chemistry.opencmis.commons.data.ExtensionsData; +import org.apache.chemistry.opencmis.commons.data.ObjectData; +import org.apache.chemistry.opencmis.commons.data.Properties; +import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships; +import org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException; +import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException; +import org.apache.chemistry.opencmis.commons.impl.Constants; +import org.apache.chemistry.opencmis.commons.impl.ReturnVersion; +import org.apache.chemistry.opencmis.commons.impl.UrlBuilder; +import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectDataImpl; +import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl; +import org.apache.chemistry.opencmis.commons.spi.Holder; +import org.apache.chemistry.opencmis.commons.spi.VersioningService; + +/** + * Versioning Service AtomPub client. + */ +public class VersioningServiceImpl extends AbstractAtomPubService implements VersioningService { + + /** + * Constructor. + */ + public VersioningServiceImpl(BindingSession session) { + setSession(session); + } + + public void checkOut(String repositoryId, Holder objectId, ExtensionsData extension, + Holder contentCopied) { + if ((objectId == null) || (objectId.getValue() == null) || (objectId.getValue().length() == 0)) { + throw new CmisInvalidArgumentException("Object id must be set!"); + } + + // find the link + String link = loadCollection(repositoryId, Constants.COLLECTION_CHECKEDOUT); + + if (link == null) { + throw new CmisObjectNotFoundException("Unknown repository or checkedout collection not supported!"); + } + + UrlBuilder url = new UrlBuilder(link); + + // set up object and writer + final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId.getValue())); + + // post move request + HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() { + public void write(OutputStream out) throws Exception { + entryWriter.write(out); + } + }); + + // parse the response + AtomEntry entry = parse(resp.getStream(), AtomEntry.class); + + objectId.setValue(entry.getId()); + + lockLinks(); + try { + // clean up cache + removeLinks(repositoryId, entry.getId()); + + // walk through the entry + for (AtomElement element : entry.getElements()) { + if (element.getObject() instanceof AtomLink) { + addLink(repositoryId, entry.getId(), (AtomLink) element.getObject()); + } + } + } finally { + unlockLinks(); + } + + if (contentCopied != null) { + contentCopied.setValue(null); + } + } + + public void cancelCheckOut(String repositoryId, String objectId, ExtensionsData extension) { + // find the link + String link = loadLink(repositoryId, objectId, Constants.REL_SELF, Constants.MEDIATYPE_ENTRY); + + if (link == null) { + throwLinkException(repositoryId, objectId, Constants.REL_SELF, Constants.MEDIATYPE_ENTRY); + } + + // prefer working copy link if available + // (workaround for non-compliant repositories) + String wcLink = getLink(repositoryId, objectId, Constants.REL_WORKINGCOPY, Constants.MEDIATYPE_ENTRY); + if (wcLink != null) { + link = wcLink; + } + + delete(new UrlBuilder(link)); + } + + public void checkIn(String repositoryId, Holder objectId, Boolean major, Properties properties, + ContentStream contentStream, String checkinComment, List policies, Acl addAces, Acl removeAces, + ExtensionsData extension) { + // we need an object id + if ((objectId == null) || (objectId.getValue() == null) || (objectId.getValue().length() == 0)) { + throw new CmisInvalidArgumentException("Object id must be set!"); + } + + // find the link + String link = loadLink(repositoryId, objectId.getValue(), Constants.REL_SELF, Constants.MEDIATYPE_ENTRY); + + if (link == null) { + throwLinkException(repositoryId, objectId.getValue(), Constants.REL_SELF, Constants.MEDIATYPE_ENTRY); + } + + // prefer working copy link if available + // (workaround for non-compliant repositories) + String wcLink = getLink(repositoryId, objectId.getValue(), Constants.REL_WORKINGCOPY, Constants.MEDIATYPE_ENTRY); + if (wcLink != null) { + link = wcLink; + } + + UrlBuilder url = new UrlBuilder(link); + url.addParameter(Constants.PARAM_CHECKIN_COMMENT, checkinComment); + url.addParameter(Constants.PARAM_MAJOR, major); + url.addParameter(Constants.PARAM_CHECK_IN, "true"); + + // set up object and writer + ObjectDataImpl object = new ObjectDataImpl(); + object.setProperties(properties); + // object.setPolicyIds(convertPolicyIds(policies)); + + if (object.getProperties() == null) { + object.setProperties(new PropertiesImpl()); + } + + String mediaType = null; + InputStream stream = null; + + if (contentStream != null) { + mediaType = contentStream.getMimeType(); + stream = contentStream.getStream(); + } + + final AtomEntryWriter entryWriter = new AtomEntryWriter(object, mediaType, stream); + + // update + HttpUtils.Response resp = put(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() { + public void write(OutputStream out) throws Exception { + entryWriter.write(out); + } + }); + + // parse new entry + AtomEntry entry = parse(resp.getStream(), AtomEntry.class); + + // we expect a CMIS entry + if (entry.getId() == null) { + throw new CmisConnectionException("Received Atom entry is not a CMIS entry!"); + } + + // set object id + objectId.setValue(entry.getId()); + + Acl originalAces = null; + + lockLinks(); + try { + // clean up cache + removeLinks(repositoryId, entry.getId()); + + // walk through the entry + for (AtomElement element : entry.getElements()) { + if (element.getObject() instanceof AtomLink) { + addLink(repositoryId, entry.getId(), (AtomLink) element.getObject()); + } else if (element.getObject() instanceof ObjectData) { + // extract current ACL + // TODO + object = (ObjectDataImpl) element.getObject(); + // originalAces = convert(object.getAcl(), + // object.isExactACL()); + } + } + } finally { + unlockLinks(); + } + + // handle ACL modifications + if ((originalAces != null) && (isAclMergeRequired(addAces, removeAces))) { + // merge and update ACL + Acl newACL = mergeAcls(originalAces, addAces, removeAces); + if (newACL != null) { + updateAcl(repositoryId, entry.getId(), newACL, null); + } + } + } + + public List getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter, + Boolean includeAllowableActions, ExtensionsData extension) { + List result = new ArrayList(); + + // find the link + String link = loadLink(repositoryId, objectId, Constants.REL_VERSIONHISTORY, Constants.MEDIATYPE_FEED); + + if (link == null) { + throwLinkException(repositoryId, objectId, Constants.REL_VERSIONHISTORY, Constants.MEDIATYPE_FEED); + } + + UrlBuilder url = new UrlBuilder(link); + url.addParameter(Constants.PARAM_FILTER, filter); + url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions); + + // read and parse + HttpUtils.Response resp = read(url); + AtomFeed feed = parse(resp.getStream(), AtomFeed.class); + + // get the versions + if (!feed.getEntries().isEmpty()) { + for (AtomEntry entry : feed.getEntries()) { + ObjectData version = null; + + lockLinks(); + try { + // clean up cache + removeLinks(repositoryId, entry.getId()); + + // walk through the entry + for (AtomElement element : entry.getElements()) { + if (element.getObject() instanceof AtomLink) { + addLink(repositoryId, entry.getId(), (AtomLink) element.getObject()); + } else if (element.getObject() instanceof ObjectData) { + version = (ObjectData) element.getObject(); + } + } + } finally { + unlockLinks(); + } + + if (version != null) { + result.add(version); + } + } + } + + return result; + } + + public ObjectData getObjectOfLatestVersion(String repositoryId, String objectId, String versionSeriesId, + Boolean major, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships, + String renditionFilter, Boolean includePolicyIds, Boolean includeACL, ExtensionsData extension) { + + ReturnVersion returnVersion = ReturnVersion.LATEST; + if ((major != null) && (major.booleanValue())) { + returnVersion = ReturnVersion.LASTESTMAJOR; + } + + return getObjectInternal(repositoryId, IdentifierType.ID, objectId, returnVersion, filter, + includeAllowableActions, includeRelationships, renditionFilter, includePolicyIds, includeACL, extension); + } + + public Properties getPropertiesOfLatestVersion(String repositoryId, String objectId, String versionSeriesId, + Boolean major, String filter, ExtensionsData extension) { + + ReturnVersion returnVersion = ReturnVersion.LATEST; + if ((major != null) && (major.booleanValue())) { + returnVersion = ReturnVersion.LASTESTMAJOR; + } + + ObjectData object = getObjectInternal(repositoryId, IdentifierType.ID, objectId, returnVersion, filter, + Boolean.FALSE, IncludeRelationships.NONE, "cmis:none", Boolean.FALSE, Boolean.FALSE, extension); + + return object.getProperties(); + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAcl.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAcl.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAcl.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAcl.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,53 @@ +/* + * 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.bindings.spi.atompub.objects; + +import org.apache.chemistry.opencmis.commons.data.Acl; + +/** + * AtomAcl. + */ +public class AtomAcl extends AtomBase { + + private static final long serialVersionUID = 1L; + + private Acl acl; + + public AtomAcl() { + super(); + } + + public AtomAcl(Acl acl) { + this(); + setACL(acl); + } + + @Override + public String getType() { + return "ACL"; + } + + public Acl getACL() { + return acl; + } + + public void setACL(Acl acl) { + this.acl = acl; + } +} \ No newline at end of file Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAcl.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAllowableActions.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAllowableActions.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAllowableActions.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAllowableActions.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,53 @@ +/* + * 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.bindings.spi.atompub.objects; + +import org.apache.chemistry.opencmis.commons.data.AllowableActions; + +/** + * AtomAllowableActions. + */ +public class AtomAllowableActions extends AtomBase { + + private static final long serialVersionUID = 1L; + + private AllowableActions allowableActions; + + public AtomAllowableActions() { + super(); + } + + public AtomAllowableActions(AllowableActions allowableActions) { + this(); + setAllowableActions(allowableActions); + } + + @Override + public String getType() { + return "Allowable Actions"; + } + + public AllowableActions getAllowableActions() { + return allowableActions; + } + + public void setAllowableActions(AllowableActions allowableActions) { + this.allowableActions = allowableActions; + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomAllowableActions.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomBase.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomBase.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomBase.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomBase.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,49 @@ +/* + * 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.bindings.spi.atompub.objects; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Florian Müller + * + */ +public abstract class AtomBase implements Serializable { + + private static final long serialVersionUID = 1L; + + private final List fElements = new ArrayList(); + + protected AtomBase() { + } + + public abstract String getType(); + + public List getElements() { + return fElements; + } + + public void addElement(AtomElement element) { + if (element != null) { + fElements.add(element); + } + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomBase.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomElement.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomElement.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomElement.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomElement.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,53 @@ +/* + * 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.bindings.spi.atompub.objects; + +import java.io.Serializable; + +import javax.xml.namespace.QName; + +/** + * @author Florian Müller + * + */ +public class AtomElement implements Serializable { + + private static final long serialVersionUID = 1L; + + private final QName fName; + private final Object fObject; + + public AtomElement(QName name, Object object) { + fName = name; + fObject = object; + } + + public QName getName() { + return fName; + } + + public Object getObject() { + return fObject; + } + + @Override + public String toString() { + return fName + ": " + fObject; + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomElement.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomEntry.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomEntry.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomEntry.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomEntry.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,59 @@ +/* + * 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.bindings.spi.atompub.objects; + +/** + * @author Florian Müller + * + */ +public class AtomEntry extends AtomBase { + + private static final long serialVersionUID = 1L; + + private String fId; + + public AtomEntry() { + super(); + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.opencmis.client.provider.spi.atompub.objects.AtomBase#getType + * () + */ + @Override + public String getType() { + return "Atom Entry"; + } + + public String getId() { + return fId; + } + + public void setId(String id) { + fId = id; + } + + @Override + public String toString() { + return "Entry \"" + fId + "\": " + getElements(); + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomEntry.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomFeed.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomFeed.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomFeed.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomFeed.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,63 @@ +/* + * 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.bindings.spi.atompub.objects; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Florian Müller + * + */ +public class AtomFeed extends AtomBase { + + private static final long serialVersionUID = 1L; + + private final List fEntries = new ArrayList(); + + public AtomFeed() { + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.opencmis.client.provider.spi.atompub.objects.AtomBase#getType + * () + */ + @Override + public String getType() { + return "Atom Feed"; + } + + public List getEntries() { + return fEntries; + } + + public void addEntry(AtomEntry entry) { + if (entry != null) { + fEntries.add(entry); + } + } + + @Override + public String toString() { + return "Feed : " + getElements() + " " + fEntries; + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomFeed.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomLink.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomLink.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomLink.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomLink.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,66 @@ +/* + * 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.bindings.spi.atompub.objects; + +import java.io.Serializable; + +/** + * @author Florian Müller + * + */ +public class AtomLink implements Serializable { + + private static final long serialVersionUID = 1L; + + private String fRel; + private String fType; + private String fHref; + + public AtomLink() { + } + + public String getRel() { + return fRel; + } + + public void setRel(String rel) { + fRel = rel; + } + + public String getType() { + return fType; + } + + public void setType(String type) { + fType = type; + } + + public String getHref() { + return fHref; + } + + public void setHref(String href) { + fHref = href; + } + + @Override + public String toString() { + return "Link: rel=\"" + fRel + "\" type=\"" + fType + "\" href=\"" + fHref + "\""; + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/AtomLink.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/RepositoryWorkspace.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/RepositoryWorkspace.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/RepositoryWorkspace.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/RepositoryWorkspace.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,58 @@ +/* + * 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.bindings.spi.atompub.objects; + +/** + * @author Florian Müller + * + */ +public class RepositoryWorkspace extends AtomBase { + + private static final long serialVersionUID = 1L; + + private String fId; + + public RepositoryWorkspace() { + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.opencmis.client.provider.spi.atompub.objects.AtomBase#getType + * () + */ + @Override + public String getType() { + return "Repository Workspace"; + } + + public String getId() { + return fId; + } + + public void setId(String id) { + fId = id; + } + + @Override + public String toString() { + return "Workspace \"" + fId + "\": " + getElements(); + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/RepositoryWorkspace.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/ServiceDoc.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/ServiceDoc.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/ServiceDoc.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/ServiceDoc.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,63 @@ +/* + * 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.bindings.spi.atompub.objects; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Florian Müller + * + */ +public class ServiceDoc extends AtomBase { + + private static final long serialVersionUID = 1L; + + private final List fWorkspaces = new ArrayList(); + + public ServiceDoc() { + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.opencmis.client.provider.spi.atompub.objects.AtomBase#getType + * () + */ + @Override + public String getType() { + return "Service Document"; + } + + public List getWorkspaces() { + return fWorkspaces; + } + + public void addWorkspace(RepositoryWorkspace ws) { + if (ws != null) { + fWorkspaces.add(ws); + } + } + + @Override + public String toString() { + return "Service Doc: " + fWorkspaces; + } +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/objects/ServiceDoc.java ------------------------------------------------------------------------------ svn:eol-style = native Added: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/enums/AtomPropertyType.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/enums/AtomPropertyType.java?rev=1293440&view=auto ============================================================================== --- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/enums/AtomPropertyType.java (added) +++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/enums/AtomPropertyType.java Fri Feb 24 21:46:54 2012 @@ -0,0 +1,50 @@ +/* + * 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.commons.enums; + +/** + * Atom Property Type Enum. + * + * @author JM.PASCAL + * + */ +public enum AtomPropertyType { + + BOOLEAN("propertyBoolean"), ID("propertyId"), INTEGER("propertyInteger"), DATETIME("propertyDateTime"), DECIMAL( + "propertyDecimal"), HTML("propertyHtml"), STRING("propertyString"), URI("propertyUri"); + private final String value; + + AtomPropertyType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static AtomPropertyType fromValue(String v) { + for (AtomPropertyType c : AtomPropertyType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} Propchange: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/enums/AtomPropertyType.java ------------------------------------------------------------------------------ svn:eol-style = native