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 2012/02/28 14:57:27 UTC
svn commit: r1294661 - in
/chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis:
client/bindings/spi/atompub/ commons/impl/
Author: fmui
Date: Tue Feb 28 13:57:26 2012
New Revision: 1294661
URL: http://svn.apache.org/viewvc?rev=1294661&view=rev
Log:
Android code update
Modified:
chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.java
chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java
chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubConstants.java
chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java
chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java
chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.java
Modified: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.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/AbstractAtomPubService.java?rev=1294661&r1=1294660&r2=1294661&view=diff
==============================================================================
--- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java (original)
+++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java Tue Feb 28 13:57:26 2012
@@ -18,8 +18,6 @@
*/
package org.apache.chemistry.opencmis.client.bindings.spi.atompub;
-//import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
-
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
@@ -857,17 +855,12 @@ public abstract class AbstractAtomPubSer
UrlBuilder aclUrl = new UrlBuilder(link);
aclUrl.addParameter(Constants.PARAM_ACL_PROPAGATION, aclPropagation);
- // set up object and writer
- // TODO
- // final CmisAccessControlListType aclJaxb = convert(acl);
// update
HttpUtils.Response resp = put(aclUrl, Constants.MEDIATYPE_ACL, new HttpUtils.Output() {
public void write(OutputStream out) throws Exception {
- // TODO
+ // TODO not implemented
AtomEntryWriter.writeACL(out, acl);
- // JaxBHelper.marshal(JaxBHelper.CMIS_OBJECT_FACTORY.createAcl(aclJaxb),
- // out, false);
}
});
Modified: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.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/AtomEntryWriter.java?rev=1294661&r1=1294660&r2=1294661&view=diff
==============================================================================
--- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.java (original)
+++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.java Tue Feb 28 13:57:26 2012
@@ -26,6 +26,12 @@ import static org.apache.chemistry.openc
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CONTENT_MEDIATYPE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ENTRY;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_VALUE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_QUERY;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_QUERY_STATEMENT;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_DEFINITION_ID;
+
+
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -65,10 +71,10 @@ public class AtomEntryWriter {
private static final String PREFIX_ATOM = "atom";
private static final String PREFIX_CMIS = "cmis";
private static final String PREFIX_RESTATOM = "cmisra";
+ private static final String ENCODING = "UTF-8";
private static final int BUFFER_SIZE = 64 * 1024;
- // private final CmisObjectType object;
private final ObjectData object;
private final InputStream stream;
private final String mediaType;
@@ -107,13 +113,11 @@ public class AtomEntryWriter {
* Writes the entry to an output stream.
*/
public void write(OutputStream out) throws Exception {
- // XMLOutputFactory factory = XMLOutputFactory.newInstance();
- // XMLStreamWriter writer = factory.createXMLStreamWriter(out,v);
XmlSerializer writer = Xml.newSerializer();
- writer.setOutput(out, "UTF-8");
+ writer.setOutput(out, ENCODING);
// start doc
- writer.startDocument("UTF-8", false);
+ writer.startDocument(ENCODING, false);
writer.setPrefix(PREFIX_ATOM, Constants.NAMESPACE_ATOM);
writer.setPrefix(PREFIX_CMIS, Constants.NAMESPACE_CMIS);
writer.setPrefix(PREFIX_RESTATOM, Constants.NAMESPACE_RESTATOM);
@@ -148,8 +152,6 @@ public class AtomEntryWriter {
// object
writeObject(writer, object);
- // JaxBHelper.marshal(JaxBHelper.CMIS_EXTRA_OBJECT_FACTORY.createObject(object),
- // writer, true);
// end entry
writer.endTag(Constants.NAMESPACE_ATOM, TAG_ENTRY);
@@ -162,14 +164,14 @@ public class AtomEntryWriter {
public static void writeQuery(OutputStream out, Map<String, String> queryParams) throws Exception {
XmlSerializer writer = Xml.newSerializer();
- writer.setOutput(out, "UTF-8");
+ writer.setOutput(out, ENCODING);
writer.setPrefix(PREFIX_CMIS, Constants.NAMESPACE_CMIS);
- writer.startTag(Constants.NAMESPACE_CMIS, "query");
+ writer.startTag(Constants.NAMESPACE_CMIS, TAG_QUERY);
writer.attribute(null, PREFIX_CMIS, Constants.NAMESPACE_CMIS);
- writer.startTag(Constants.NAMESPACE_CMIS, "statement");
- writer.cdsect(queryParams.get("statement"));
- writer.endTag(Constants.NAMESPACE_CMIS, "statement");
+ writer.startTag(Constants.NAMESPACE_CMIS, TAG_QUERY_STATEMENT);
+ writer.cdsect(queryParams.get(TAG_QUERY_STATEMENT));
+ writer.endTag(Constants.NAMESPACE_CMIS, TAG_QUERY_STATEMENT);
writeTagIfNotNull(writer, Constants.NAMESPACE_CMIS, Constants.PARAM_SEARCH_ALL_VERSIONS,
queryParams.get(Constants.PARAM_SEARCH_ALL_VERSIONS));
writeTagIfNotNull(writer, Constants.NAMESPACE_CMIS, Constants.PARAM_ALLOWABLE_ACTIONS,
@@ -183,21 +185,21 @@ public class AtomEntryWriter {
writeTagIfNotNull(writer, Constants.NAMESPACE_CMIS, Constants.PARAM_SKIP_COUNT,
queryParams.get(Constants.PARAM_SKIP_COUNT));
- writer.endTag(Constants.NAMESPACE_CMIS, "query");
+ writer.endTag(Constants.NAMESPACE_CMIS, TAG_QUERY);
writer.flush();
}
public static void writeACL(OutputStream out, Acl acl) throws Exception {
XmlSerializer writer = Xml.newSerializer();
- writer.setOutput(out, "UTF-8");
+ writer.setOutput(out, ENCODING);
writer.setPrefix(PREFIX_CMIS, Constants.NAMESPACE_CMIS);
writer.startTag(Constants.NAMESPACE_CMIS, "acl");
writer.attribute(null, PREFIX_CMIS, Constants.NAMESPACE_CMIS);
writer.startTag(Constants.NAMESPACE_CMIS, "permission");
- // writeTag(writer, Constants.NAMESPACE_CMIS, "direct",
- // acl.getAces().get(0).)
+ // TODO Implements
+ //writeTag(writer, Constants.NAMESPACE_CMIS, "direct", acl.getAces().get(0).)
writer.endTag(Constants.NAMESPACE_CMIS, "permission");
@@ -276,18 +278,14 @@ public class AtomEntryWriter {
private static void writeProperty(XmlSerializer writer, PropertyData<?> prop) throws Exception {
writer.startTag(Constants.NAMESPACE_CMIS, getPropertyTypeTag(prop));
- // writer.attribute(null, JSON_PROPERTY_QUERYNAME, prop.getQueryName());
- // writer.attribute(null, JSON_PROPERTY_DISPLAYNAME,
- // prop.getDisplayName());
- // writer.attribute(null, JSON_PROPERTY_LOCALNAME, prop.getLocalName());
- writer.attribute(null, "propertyDefinitionId", prop.getId());
+ writer.attribute(null, ATTR_PROPERTY_DEFINITION_ID, prop.getId());
writeValues(writer, prop.getValues());
writer.endTag(Constants.NAMESPACE_CMIS, getPropertyTypeTag(prop));
}
private static void writeValues(XmlSerializer writer, List<?> values) throws Exception {
for (Object value : values) {
- writeTag(writer, Constants.NAMESPACE_CMIS, "value", convertPropertyValue(value));
+ writeTag(writer, Constants.NAMESPACE_CMIS, TAG_VALUE, convertPropertyValue(value));
}
}
Modified: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.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/AtomPubParser.java?rev=1294661&r1=1294660&r2=1294661&view=diff
==============================================================================
--- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java (original)
+++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java Tue Feb 28 13:57:26 2012
@@ -21,12 +21,23 @@ package org.apache.chemistry.opencmis.cl
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_DOCUMENT_TYPE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_FOLDER_TYPE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_POLICY_TYPE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_DISPLAYNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_LOCALNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_QUERYNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_VALUE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_RELATIONSHIP_TYPE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.CONTENT_SRC;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.LINK_HREF;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.LINK_REL;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.LINK_TYPE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACE_PRINCIPAL;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACE_PRINCIPAL_ID;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACL;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_MAPPING_KEY;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_MAPPING_PERMISSION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_PERMISSIONS;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_PERMISSION_DESCRIPTION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_PERMISSION_PERMISSION;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ALLOWABLEACTIONS;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CHILDREN;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_COLLECTION;
@@ -39,6 +50,8 @@ import static org.apache.chemistry.openc
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_OBJECT;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_PATH_SEGMENT;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RELATIVE_PATH_SEGMENT;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_CAPABILITIES;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_CHANGES_ON_TYPE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPOSITORY_INFO;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_SERVICE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_TEMPLATE_TEMPLATE;
@@ -46,10 +59,16 @@ import static org.apache.chemistry.openc
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_TYPE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_URI_TEMPLATE;
import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_WORKSPACE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_DISPLAYNAME;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_LOCALNAME;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_QUERYNAME;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_VALUE;
+
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_DEFINITION_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_ACL;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_MAPPING;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACE_DIRECT;
+
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_PROPERTY;
+
+
import java.io.IOException;
import java.io.InputStream;
@@ -87,7 +106,6 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
import org.apache.chemistry.opencmis.commons.impl.AtomPubConverter;
import org.apache.chemistry.opencmis.commons.impl.Constants;
-import org.apache.chemistry.opencmis.commons.impl.JSONConstants;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlEntryImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlPrincipalDataImpl;
@@ -123,8 +141,6 @@ public class AtomPubParser {
public void parse() throws Exception {
XmlPullParser parser = Xml.newPullParser();
parser.setInput(stream, null);
- // XMLInputFactory factory = XMLInputFactory.newInstance();
- // XmlPullParser parser = factory.createXmlPullParser(stream);
try {
while (true) {
@@ -161,7 +177,6 @@ public class AtomPubParser {
}
}
- // parser.close();
} finally {
// make sure the stream is read and closed in all cases
try {
@@ -344,7 +359,6 @@ public class AtomPubParser {
if (Constants.NAMESPACE_RESTATOM.equals(name.getNamespaceURI())) {
if (TAG_OBJECT.equals(name.getLocalPart())) {
return new AtomElement(name, parseObject(parser));
- // return unmarshalElement(parser, CmisObjectType.class);
} else if (TAG_PATH_SEGMENT.equals(name.getLocalPart())
|| TAG_RELATIVE_PATH_SEGMENT.equals(name.getLocalPart())) {
return parseText(parser);
@@ -353,24 +367,14 @@ public class AtomPubParser {
String typeAttr = parser.getAttributeValue(Constants.NAMESPACE_XSI, "type");
if (typeAttr == null) {
return new AtomElement(name, parseTypeDefinition(parser, null));
- // return unmarshalElement(parser,
- // CmisTypeDefinitionType.class);
} else if (typeAttr.endsWith(ATTR_DOCUMENT_TYPE)) {
return new AtomElement(name, parseTypeDefinition(parser, BaseTypeId.CMIS_DOCUMENT));
- // return unmarshalElement(parser,
- // CmisTypeDocumentDefinitionType.class);
} else if (typeAttr.endsWith(ATTR_FOLDER_TYPE)) {
return new AtomElement(name, parseTypeDefinition(parser, BaseTypeId.CMIS_FOLDER));
- // return unmarshalElement(parser,
- // CmisTypeFolderDefinitionType.class);
} else if (typeAttr.endsWith(ATTR_RELATIONSHIP_TYPE)) {
return new AtomElement(name, parseTypeDefinition(parser, BaseTypeId.CMIS_RELATIONSHIP));
- // return unmarshalElement(parser,
- // CmisTypeRelationshipDefinitionType.class);
} else if (typeAttr.endsWith(ATTR_POLICY_TYPE)) {
return new AtomElement(name, parseTypeDefinition(parser, BaseTypeId.CMIS_POLICY));
- // return unmarshalElement(parser,
- // CmisTypePolicyDefinitionType.class);
}
throw new CmisRuntimeException("Cannot read type definition!");
} else if (TAG_CHILDREN.equals(name.getLocalPart())) {
@@ -391,27 +395,6 @@ public class AtomPubParser {
}
/**
- * Unmarshals a JAXB element.
- */
- private static <T> AtomElement unmarshalElement(XmlPullParser parser, Class<T> cmisType) throws Exception {
- QName name = new QName(parser.getNamespace(), parser.getName());
-
- // Unmarshaller u = JaxBHelper.createUnmarshaller();
- // JAXBElement<T> object = u.unmarshal(parser, cmisType);
-
- // return new AtomElement(name, object.getValue());
-
- // Serializer serializer = new Persister();
- // parser.get
-
- // Example example = serializer.read(CmisRepositoryInfoType.class,
- // parser);
- parser.next();
- return new AtomElement(name, null);
- // return null;
- }
-
- /**
* Parses a children element.
*/
private AtomElement parseChildren(XmlPullParser parser) throws Exception {
@@ -683,10 +666,10 @@ public class AtomPubParser {
while (!(eventType == XmlPullParser.END_TAG && Constants.SELECTOR_REPOSITORY_INFO.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
- if (JSONConstants.JSON_REPINFO_CAPABILITIES.equals(name)) {
+ if (TAG_REPINFO_CAPABILITIES.equals(name)) {
eventType = parser.next();
name = parser.getName();
- while (!(eventType == XmlPullParser.END_TAG && JSONConstants.JSON_REPINFO_CAPABILITIES.equals(name))) {
+ while (!(eventType == XmlPullParser.END_TAG && TAG_REPINFO_CAPABILITIES.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
parser.next();
@@ -696,9 +679,9 @@ public class AtomPubParser {
eventType = parser.next();
name = parser.getName();
}
- } else if ("aclCapability".equals(name)) {
+ } else if (TAG_ACLCAP_ACL.equals(name)) {
aclCapabilities = parseAclCapabilities(parser);
- } else if (JSONConstants.JSON_REPINFO_CHANGES_ON_TYPE.equals(name)) {
+ } else if (TAG_REPINFO_CHANGES_ON_TYPE.equals(name)) {
parser.next();
changesOnType.add(parser.getText());
} else if (Constants.NAMESPACE_CMIS.equals(namespace)) {
@@ -719,8 +702,6 @@ public class AtomPubParser {
aclCapabilities, changesOnType);
}
- public static final String PROPERTY = "property";
-
private static TypeDefinition parseTypeDefinition(XmlPullParser parser, BaseTypeId type) throws Exception {
Map<String, String> definitionRawValues = new HashMap<String, String>(15);
List<PropertyDefinition<?>> propertyDefinitionList = new ArrayList<PropertyDefinition<?>>(10);
@@ -729,10 +710,10 @@ public class AtomPubParser {
String name = parser.getName();
String namespace = parser.getNamespace();
- while (!(eventType == XmlPullParser.END_TAG && CmisAtomPubConstants.TAG_TEMPLATE_TYPE.equals(name))) {
+ while (!(eventType == XmlPullParser.END_TAG && TAG_TEMPLATE_TYPE.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
- if (name.startsWith(PROPERTY)) {
+ if (name.startsWith(TAG_PROPERTY)) {
propertyDefinitionList.add(parsePropertyDefinition(parser));
} else if (Constants.NAMESPACE_CMIS.equals(namespace)) {
parser.next();
@@ -788,7 +769,7 @@ public class AtomPubParser {
while (!(eventType == XmlPullParser.END_TAG && Constants.SELECTOR_OBJECT.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
- if (name.startsWith(PROPERTY)) {
+ if (name.startsWith(TAG_PROPERTY)) {
properties = parseProperties(parser);
} else if (Constants.SELECTOR_ALLOWABLEACTIONS.equals(name)) {
allowableActions = parseAllowableActions(parser);
@@ -852,13 +833,13 @@ public class AtomPubParser {
paramName = null;
for (int i = 0; i < countParam; i++) {
paramName = parser.getAttributeName(i);
- if (JSON_PROPERTY_DISPLAYNAME.equals(paramName)) {
+ if (ATTR_PROPERTY_DISPLAYNAME.equals(paramName)) {
displayName = parser.getAttributeValue(i);
- } else if (JSON_PROPERTY_QUERYNAME.equals(paramName)) {
+ } else if (ATTR_PROPERTY_QUERYNAME.equals(paramName)) {
queryName = parser.getAttributeValue(i);
- } else if (JSON_PROPERTY_LOCALNAME.equals(paramName)) {
+ } else if (ATTR_PROPERTY_LOCALNAME.equals(paramName)) {
localName = parser.getAttributeValue(i);
- } else if ("propertyDefinitionId".equals(paramName)) {
+ } else if (ATTR_PROPERTY_DEFINITION_ID.equals(paramName)) {
id = parser.getAttributeValue(i);
}
}
@@ -868,7 +849,7 @@ public class AtomPubParser {
while (!(eventType == XmlPullParser.END_TAG && tag.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
- if (JSON_PROPERTY_VALUE.equals(name)) {
+ if (ATTR_PROPERTY_VALUE.equals(name)) {
parser.next();
values.add(parser.getText());
}
@@ -896,7 +877,7 @@ public class AtomPubParser {
String name = parser.getName();
String namespace = parser.getNamespace();
- while (!(eventType == XmlPullParser.END_TAG && "rendition".equals(name))) {
+ while (!(eventType == XmlPullParser.END_TAG && TAG_RENDITION.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
if (Constants.NAMESPACE_CMIS.equals(namespace)) {
@@ -945,22 +926,22 @@ public class AtomPubParser {
String name = parser.getName();
String namespace = parser.getNamespace();
- while (!(eventType == XmlPullParser.END_TAG && "aclCapability".equals(name))) {
+ while (!(eventType == XmlPullParser.END_TAG && TAG_ACLCAP_ACL.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
- if (Constants.NAMESPACE_CMIS.equals(namespace) && JSONConstants.JSON_ACLCAP_PERMISSIONS.equals(name)) {
+ if (Constants.NAMESPACE_CMIS.equals(namespace) && TAG_ACLCAP_PERMISSIONS.equals(name)) {
String permission = null, description = null;
// Permissions
- while (!(eventType == XmlPullParser.END_TAG && JSONConstants.JSON_ACLCAP_PERMISSIONS.equals(name))) {
+ while (!(eventType == XmlPullParser.END_TAG && TAG_ACLCAP_PERMISSIONS.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
if (Constants.NAMESPACE_CMIS.equals(namespace)
- && JSONConstants.JSON_ACLCAP_PERMISSION_PERMISSION.equals(name)) {
+ && TAG_ACLCAP_PERMISSION_PERMISSION.equals(name)) {
parser.next();
permission = parser.getText();
} else if (Constants.NAMESPACE_CMIS.equals(namespace)
- && JSONConstants.JSON_ACLCAP_PERMISSION_DESCRIPTION.equals(name)) {
+ && TAG_ACLCAP_PERMISSION_DESCRIPTION.equals(name)) {
parser.next();
description = parser.getText();
}
@@ -978,20 +959,20 @@ public class AtomPubParser {
permissionDefinitionList.add(permDef);
- } else if (Constants.NAMESPACE_CMIS.equals(namespace) && "mapping".equals(name)) {
+ } else if (Constants.NAMESPACE_CMIS.equals(namespace) && TAG_ACLCAP_MAPPING.equals(name)) {
String key = null;
List<String> permList = new ArrayList<String>();
// MAPPINGS
- while (!(eventType == XmlPullParser.END_TAG && "mapping".equals(name))) {
+ while (!(eventType == XmlPullParser.END_TAG && TAG_ACLCAP_MAPPING.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
if (Constants.NAMESPACE_CMIS.equals(namespace)
- && JSONConstants.JSON_ACLCAP_MAPPING_KEY.equals(name)) {
+ && TAG_ACLCAP_MAPPING_KEY.equals(name)) {
parser.next();
key = parser.getText();
} else if (Constants.NAMESPACE_CMIS.equals(namespace)
- && JSONConstants.JSON_ACLCAP_PERMISSION_PERMISSION.equals(name)) {
+ && TAG_ACLCAP_MAPPING_PERMISSION.equals(name)) {
parser.next();
permList.add(parser.getText());
}
@@ -1036,7 +1017,7 @@ public class AtomPubParser {
switch (eventType) {
case XmlPullParser.START_TAG:
if (Constants.NAMESPACE_CMIS.equals(namespace)
- && JSONConstants.JSON_ACLCAP_PERMISSION_PERMISSION.equals(name)) {
+ && TAG_ACLCAP_PERMISSION_PERMISSION.equals(name)) {
if (isPermissionRootTag == false) {
isPermissionRootTag = true;
permissions = new ArrayList<String>();
@@ -1046,13 +1027,13 @@ public class AtomPubParser {
permissions.add(parser.getText());
parser.next();
}
- } else if (Constants.NAMESPACE_CMIS.equals(namespace) && JSONConstants.JSON_ACE_PRINCIPAL.equals(name)) {
+ } else if (Constants.NAMESPACE_CMIS.equals(namespace) && TAG_ACE_PRINCIPAL.equals(name)) {
AccessControlPrincipalDataImpl principal = null;
- while (!(eventType == XmlPullParser.END_TAG && JSONConstants.JSON_ACE_PRINCIPAL.equals(name))) {
+ while (!(eventType == XmlPullParser.END_TAG && TAG_ACE_PRINCIPAL.equals(name))) {
switch (eventType) {
case XmlPullParser.START_TAG:
if (Constants.NAMESPACE_CMIS.equals(namespace)
- && JSONConstants.JSON_ACE_PRINCIPAL_ID.equals(name)) {
+ && TAG_ACE_PRINCIPAL_ID.equals(name)) {
parser.next();
principal = new AccessControlPrincipalDataImpl();
principal.setPrincipalId(parser.getText());
@@ -1066,7 +1047,7 @@ public class AtomPubParser {
// convertExtension(jsonPrincipal, principal,
// PRINCIPAL_KEYS);
ace.setPrincipal(principal);
- } else if (Constants.NAMESPACE_CMIS.equals(namespace) && "direct".equals(name)) {
+ } else if (Constants.NAMESPACE_CMIS.equals(namespace) && TAG_ACE_DIRECT.equals(name)) {
parser.next();
Boolean isDirect = Boolean.parseBoolean(parser.getText());
ace.setDirect(isDirect != null ? isDirect.booleanValue() : true);
@@ -1074,7 +1055,7 @@ public class AtomPubParser {
break;
case XmlPullParser.END_TAG:
if (Constants.NAMESPACE_CMIS.equals(namespace)
- && JSONConstants.JSON_ACLCAP_PERMISSION_PERMISSION.equals(name)) {
+ && TAG_ACLCAP_PERMISSION_PERMISSION.equals(name)) {
isPermissionRootTag = false;
ace.setPermissions(permissions);
aces.add(ace);
Modified: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubConstants.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/CmisAtomPubConstants.java?rev=1294661&r1=1294660&r2=1294661&view=diff
==============================================================================
--- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubConstants.java (original)
+++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubConstants.java Tue Feb 28 13:57:26 2012
@@ -57,10 +57,10 @@ public final class CmisAtomPubConstants
public static final String TAG_CONTENT_MEDIATYPE = "mediatype";
public static final String TAG_CONTENT_BASE64 = "base64";
- public static final String ATTR_DOCUMENT_TYPE = "cmisTypeDocumentDefinitionType";// CmisTypeDocumentDefinitionType.class.getAnnotation(XmlType.class).name();
- public static final String ATTR_FOLDER_TYPE = "cmisTypeFolderDefinitionType";// CmisTypeFolderDefinitionType.class.getAnnotation(XmlType.class).name();
- public static final String ATTR_RELATIONSHIP_TYPE = "cmisTypeRelationshipDefinitionType"; // CmisTypeRelationshipDefinitionType.class.getAnnotation(XmlType.class).name();
- public static final String ATTR_POLICY_TYPE = "cmisTypePolicyDefinitionType"; // CmisTypePolicyDefinitionType.class.getAnnotation(XmlType.class).name();
+ public static final String ATTR_DOCUMENT_TYPE = "cmisTypeDocumentDefinitionType";
+ public static final String ATTR_FOLDER_TYPE = "cmisTypeFolderDefinitionType";
+ public static final String ATTR_RELATIONSHIP_TYPE = "cmisTypeRelationshipDefinitionType";
+ public static final String ATTR_POLICY_TYPE = "cmisTypePolicyDefinitionType";
// allowable actions
public static final String TAG_ALLOWABLEACTIONS = "allowableActions";
@@ -73,5 +73,125 @@ public final class CmisAtomPubConstants
public static final String LINK_HREF = "href";
public static final String LINK_TYPE = "type";
public static final String CONTENT_SRC = "src";
+
+ //Android Parser Specific
+ public static final String TAG_PROPERTY = "property";
+ public static final String ATTR__PROPERTY_ID = "id";
+ public static final String ATTR_PROPERTY_LOCALNAME = "localName";
+ public static final String ATTR_PROPERTY_DISPLAYNAME = "displayName";
+ public static final String ATTR_PROPERTY_QUERYNAME = "queryName";
+ public static final String ATTR_PROPERTY_VALUE = "value";
+ public static final String ATTR_PROPERTY_DATATYPE = "type";
+ public static final String ATTR_PROPERTY_CARDINALITY = "cardinality";
+
+ public static final String TAG_REPINFO_ID = "repositoryId";
+ public static final String TAG_REPINFO_NAME = "repositoryName";
+ public static final String TAG_REPINFO_DESCRIPTION = "repositoryDescription";
+ public static final String TAG_REPINFO_VENDOR = "vendorName";
+ public static final String TAG_REPINFO_PRODUCT = "productName";
+ public static final String TAG_REPINFO_PRODUCT_VERSION = "productVersion";
+ public static final String TAG_REPINFO_ROOT_FOLDER_ID = "rootFolderId";
+ public static final String TAG_REPINFO_REPOSITORY_URL = "repositoryUrl";
+ public static final String TAG_REPINFO_ROOT_FOLDER_URL = "rootFolderUrl";
+ public static final String TAG_REPINFO_CAPABILITIES = "capabilities";
+ public static final String TAG_REPINFO_ACL_CAPABILITIES = "aclCapabilities";
+ public static final String TAG_REPINFO_CHANGE_LOCK_TOKEN = "latestChangeLogToken";
+ public static final String TAG_REPINFO_CMIS_VERSION_SUPPORTED = "cmisVersionSupported";
+ public static final String TAG_REPINFO_THIN_CLIENT_URI = "thinClientURI";
+ public static final String TAG_REPINFO_CHANGES_INCOMPLETE = "changesIncomplete";
+ public static final String TAG_REPINFO_CHANGES_ON_TYPE = "changesOnType";
+ public static final String TAG_REPINFO_PRINCIPAL_ID_ANONYMOUS = "principalIdAnonymous";
+ public static final String TAG_REPINFO_PRINCIPAL_ID_ANYONE = "principalIdAnyone";
+
+ public static final String TAG_ACLCAP_ACL = "aclCapability";
+ public static final String TAG_ACLCAP_ACL_PROPAGATION = "propagation";
+ public static final String TAG_ACLCAP_SUPPORTED_PERMISSIONS = "supportedPermissions";
+ public static final String TAG_ACLCAP_PERMISSIONS = "permissions";
+ public static final String TAG_ACLCAP_PERMISSION_PERMISSION = "permission";
+ public static final String TAG_ACLCAP_PERMISSION_DESCRIPTION = "description";
+ public static final String TAG_ACLCAP_MAPPING = "mapping";
+ public static final String TAG_ACLCAP_MAPPING_KEY = "key";
+ public static final String TAG_ACLCAP_MAPPING_PERMISSION = "permission";
+ public static final String TAG_ACLCAP_DIRECT = "direct";
+
+
+ public static final String TAG_CAP_CONTENT_STREAM_UPDATES = "capabilityContentStreamUpdatability";
+ public static final String TAG_CAP_CHANGES = "capabilityChanges";
+ public static final String TAG_CAP_RENDITIONS = "capabilityRenditions";
+ public static final String TAG_CAP_GET_DESCENDANTS = "capabilityGetDescendants";
+ public static final String TAG_CAP_GET_FOLDER_TREE = "capabilityGetFolderTree";
+ public static final String TAG_CAP_MULTIFILING = "capabilityMultifiling";
+ public static final String TAG_CAP_UNFILING = "capabilityUnfiling";
+ public static final String TAG_CAP_VERSION_SPECIFIC_FILING = "capabilityVersionSpecificFiling";
+ public static final String TAG_CAP_PWC_SEARCHABLE = "capabilityPWCSearchable";
+ public static final String TAG_CAP_PWC_UPDATABLE = "capabilityPWCUpdatable";
+ public static final String TAG_CAP_ALL_VERSIONS_SEARCHABLE = "capabilityAllVersionsSearchable";
+ public static final String TAG_CAP_QUERY = "capabilityQuery";
+ public static final String TAG_CAP_JOIN = "capabilityJoin";
+ public static final String TAG_CAP_ACL = "capabilityACL";
+
+ public static final String ATTR_PROPERTY_TYPE_ID = "id";
+ public static final String ATTR_PROPERTY_DEFINITION_ID = "propertyDefinitionId";
+ public static final String ATTR_PROPERTY_TYPE_LOCALNAME = "localName";
+ public static final String ATTR_PROPERTY_TYPE_LOCALNAMESPACE = "localNamespace";
+ public static final String ATTR_PROPERTY_TYPE_DISPLAYNAME = "displayName";
+ public static final String ATTR_PROPERTY_TYPE_QUERYNAME = "queryName";
+ public static final String ATTR_PROPERTY_TYPE_DESCRIPTION = "description";
+ public static final String ATTR_PROPERTY_TYPE_PROPERTY_TYPE = "propertyType";
+ public static final String ATTR_PROPERTY_TYPE_CARDINALITY = "cardinality";
+ public static final String ATTR_PROPERTY_TYPE_UPDATABILITY = "updatability";
+ public static final String ATTR_PROPERTY_TYPE_INHERITED = "inherited";
+ public static final String ATTR_PROPERTY_TYPE_REQUIRED = "required";
+ public static final String ATTR_PROPERTY_TYPE_QUERYABLE = "queryable";
+ public static final String ATTR_PROPERTY_TYPE_ORDERABLE = "orderable";
+ public static final String ATTR_PROPERTY_TYPE_OPENCHOICE = "openChoice";
+
+ public static final String ATTR_PROPERTY_TYPE_MAX_LENGTH = "maxLength";
+ public static final String ATTR_PROPERTY_TYPE_MIN_VALUE = "minValue";
+ public static final String ATTR_PROPERTY_TYPE_MAX_VALUE = "maxValue";
+ public static final String ATTR_PROPERTY_TYPE_PRECISION = "precision";
+ public static final String ATTR_PROPERTY_TYPE_RESOLUTION = "resolution";
+
+ public static final String TAG_RENDITION = "rendition";
+ public static final String TAG_RENDITION_STREAM_ID = "streamId";
+ public static final String TAG_RENDITION_MIMETYPE = "mimeType";
+ public static final String TAG_RENDITION_LENGTH = "length";
+ public static final String TAG_RENDITION_KIND = "kind";
+ public static final String TAG_RENDITION_TITLE = "title";
+ public static final String TAG_RENDITION_HEIGHT = "height";
+ public static final String TAG_RENDITION_WIDTH = "width";
+ public static final String TAG_RENDITION_DOCUMENT_ID = "renditionDocumentId";
+
+
+ public static final String TAG_ACE_PRINCIPAL = "principal";
+ public static final String TAG_ACE_PRINCIPAL_ID = "principalId";
+ public static final String TAG_ACE_DIRECT = "direct";
+
+
+ public static final String TYPE_ID = "id";
+ public static final String TYPE_LOCALNAME = "localName";
+ public static final String TYPE_LOCALNAMESPACE = "localNamespace";
+ public static final String TYPE_DISPLAYNAME = "displayName";
+ public static final String TYPE_QUERYNAME = "queryName";
+ public static final String TYPE_DESCRIPTION = "description";
+ public static final String TYPE_BASE_ID = "baseId";
+ public static final String TYPE_PARENT_ID = "parentId";
+ public static final String TYPE_CREATABLE = "creatable";
+ public static final String TYPE_FILEABLE = "fileable";
+ public static final String TYPE_QUERYABLE = "queryable";
+ public static final String TYPE_FULLTEXT_INDEXED = "fulltextIndexed";
+ public static final String TYPE_INCLUDE_IN_SUPERTYPE_QUERY = "includedInSupertypeQuery";
+ public static final String TYPE_CONTROLABLE_POLICY = "controllablePolicy";
+ public static final String TYPE_CONTROLABLE_ACL = "controllableACL";
+ public static final String TYPE_PROPERTY_DEFINITIONS = "propertyDefinitions";
+ public static final String TYPE_CONTENTSTREAM_ALLOWED = "contentStreamAllowed"; // document
+ public static final String TYPE_VERSIONABLE = "versionable"; // document
+
+
+ public static final String TAG_VALUE = "value";
+ public static final String TAG_QUERY = "query";
+ public static final String TAG_QUERY_STATEMENT = "statement";
+
+
}
Modified: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.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/CmisAtomPubSpi.java?rev=1294661&r1=1294660&r2=1294661&view=diff
==============================================================================
--- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java (original)
+++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java Tue Feb 28 13:57:26 2012
@@ -29,12 +29,16 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.spi.RelationshipService;
import org.apache.chemistry.opencmis.commons.spi.RepositoryService;
import org.apache.chemistry.opencmis.commons.spi.VersioningService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* CMIS AtomPub SPI implementation.
*/
public class CmisAtomPubSpi implements CmisSpi {
+ private static final Logger log = LoggerFactory.getLogger(CmisAtomPubSpi.class);
+
private final BindingSession session;
private final RepositoryService repositoryService;
@@ -51,6 +55,9 @@ public class CmisAtomPubSpi implements C
* Constructor.
*/
public CmisAtomPubSpi(BindingSession session) {
+ if (log.isDebugEnabled()) {
+ log.debug("Initializing AtomPub SPI...");
+ }
this.session = session;
Modified: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.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/DiscoveryServiceImpl.java?rev=1294661&r1=1294660&r2=1294661&view=diff
==============================================================================
--- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java (original)
+++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java Tue Feb 28 13:57:26 2012
@@ -18,7 +18,6 @@
*/
package org.apache.chemistry.opencmis.client.bindings.spi.atompub;
-//import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
import java.io.OutputStream;
import java.math.BigInteger;
@@ -126,22 +125,11 @@ public class DiscoveryServiceImpl extend
UrlBuilder url = new UrlBuilder(link);
- // compile query request
- // final CmisQueryType query = new CmisQueryType();
- // query.setStatement(statement);
- // query.setSearchAllVersions(searchAllVersions);
- // query.setIncludeAllowableActions(includeAllowableActions);
- // query.setIncludeRelationships(convert(EnumIncludeRelationships.class,
- // includeRelationships));
- // query.setRenditionFilter(renditionFilter);
- // query.setMaxItems(maxItems);
- // query.setSkipCount(skipCount);
-
final Map<String, String> queryParameters = new HashMap<String, String>(6);
- queryParameters.put("statement", statement);
- queryParameters.put(Constants.PARAM_ALLOWABLE_ACTIONS, searchAllVersions.toString());
- // queryParameters.put(Constants.PARAM_RELATIONSHIPS,
- // searchAllVersions);
+ queryParameters.put(CmisAtomPubConstants.TAG_QUERY_STATEMENT, statement);
+ queryParameters.put(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions.toString());
+ queryParameters.put(Constants.PARAM_ALL_VERSIONS, searchAllVersions.toString());
+ queryParameters.put(Constants.PARAM_RELATIONSHIPS, includeRelationships.toString());
queryParameters.put(Constants.PARAM_RENDITION_FILTER, renditionFilter);
queryParameters.put(Constants.PARAM_MAX_ITEMS, maxItems.toString());
queryParameters.put(Constants.PARAM_SKIP_COUNT, skipCount.toString());
@@ -149,9 +137,6 @@ public class DiscoveryServiceImpl extend
// post the query and parse results
HttpUtils.Response resp = post(url, Constants.MEDIATYPE_QUERY, new HttpUtils.Output() {
public void write(OutputStream out) throws Exception {
- // TODO
- // JaxBHelper.marshal(JaxBHelper.CMIS_OBJECT_FACTORY.createQuery(query),
- // out, false);
AtomEntryWriter.writeQuery(out, queryParameters);
}
});
Modified: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.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/ObjectServiceImpl.java?rev=1294661&r1=1294660&r2=1294661&view=diff
==============================================================================
--- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java (original)
+++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java Tue Feb 28 13:57:26 2012
@@ -106,6 +106,7 @@ public class ObjectServiceImpl extends A
// set up object and writer
ObjectDataImpl object = new ObjectDataImpl();
object.setProperties(properties);
+ //TODO
// object.setPolicyIds(convertPolicyIds(policies));
String mediaType = null;
@@ -156,8 +157,7 @@ public class ObjectServiceImpl extends A
// set up object and writer
ObjectDataImpl object = new ObjectDataImpl();
object.setProperties(properties);
- // CmisObjectType object = new CmisObjectType();
- // object.setProperties(convert(properties));
+ //TODO
// object.setPolicyIds(convertPolicyIds(policies));
final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
@@ -208,8 +208,7 @@ public class ObjectServiceImpl extends A
// set up object and writer
ObjectDataImpl object = new ObjectDataImpl();
object.setProperties(properties);
- // CmisObjectType object = new CmisObjectType();
- // object.setProperties(convert(properties));
+ //TODO
// object.setPolicyIds(convertPolicyIds(policies));
final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
@@ -257,8 +256,7 @@ public class ObjectServiceImpl extends A
// set up object and writer
ObjectDataImpl object = new ObjectDataImpl();
object.setProperties(properties);
- // CmisObjectType object = new CmisObjectType();
- // object.setProperties(convert(properties));
+ //TODO
// object.setPolicyIds(convertPolicyIds(policies));
final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
@@ -300,8 +298,7 @@ public class ObjectServiceImpl extends A
// set up object and writer
ObjectDataImpl object = new ObjectDataImpl();
object.setProperties(properties);
- // CmisObjectType object = new CmisObjectType();
- // object.setProperties(convert(properties));
+ //TODO
// object.setPolicyIds(convertPolicyIds(policies));
final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
@@ -704,7 +701,6 @@ public class ObjectServiceImpl extends A
// extract current ACL
ObjectData object = (ObjectData) element.getObject();
originalAces = object.getAcl();
- // originalAces = convert(object.getAcl(), object.isExactACL());
break;
}
Modified: chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.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/impl/AtomPubConverter.java?rev=1294661&r1=1294660&r2=1294661&view=diff
==============================================================================
--- chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.java (original)
+++ chemistry/opencmis/branches/android/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.java Tue Feb 28 13:57:26 2012
@@ -1,62 +1,77 @@
package org.apache.chemistry.opencmis.commons.impl;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_ACLCAP_ACL_PROPAGATION;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_ACLCAP_SUPPORTED_PERMISSIONS;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_ACL;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_ALL_VERSIONS_SEARCHABLE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_CHANGES;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_CONTENT_STREAM_UPDATES;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_GET_DESCENDANTS;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_GET_FOLDER_TREE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_JOIN;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_MULTIFILING;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_PWC_SEARCHABLE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_PWC_UPDATABLE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_QUERY;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_RENDITIONS;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_UNFILING;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_CAP_VERSION_SPECIFIC_FILING;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_CARDINALITY;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_DESCRIPTION;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_DISPLAYNAME;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_INHERITED;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_LOCALNAME;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_LOCALNAMESPACE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_MAX_LENGTH;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_MAX_VALUE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_MIN_VALUE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_OPENCHOICE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_ORDERABLE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_PRECISION;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_QUERYABLE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_QUERYNAME;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_REQUIRED;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_RESOLUTION;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_PROPERTY_TYPE_UPDATABILITY;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_RENDITION_DOCUMENT_ID;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_RENDITION_HEIGHT;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_RENDITION_KIND;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_RENDITION_LENGTH;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_RENDITION_MIMETYPE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_RENDITION_STREAM_ID;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_RENDITION_TITLE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_RENDITION_WIDTH;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_CHANGES_INCOMPLETE;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_CHANGE_LOCK_TOKEN;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_CMIS_VERSION_SUPPORTED;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_DESCRIPTION;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_ID;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_NAME;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_PRODUCT;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_PRODUCT_VERSION;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_REPOSITORY_URL;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_ROOT_FOLDER_ID;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_ROOT_FOLDER_URL;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_THIN_CLIENT_URI;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_REPINFO_VENDOR;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_TYPE_CONTENTSTREAM_ALLOWED;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_TYPE_PARENT_ID;
-import static org.apache.chemistry.opencmis.commons.impl.JSONConstants.JSON_TYPE_VERSIONABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_CARDINALITY;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_DESCRIPTION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_DISPLAYNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_INHERITED;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_LOCALNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_LOCALNAMESPACE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_MAX_LENGTH;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_MAX_VALUE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_MIN_VALUE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_OPENCHOICE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_ORDERABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_PRECISION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_QUERYABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_QUERYNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_REQUIRED;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_RESOLUTION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.ATTR_PROPERTY_TYPE_UPDATABILITY;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_ACL_PROPAGATION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_ACLCAP_SUPPORTED_PERMISSIONS;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_ACL;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_ALL_VERSIONS_SEARCHABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_CHANGES;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_CONTENT_STREAM_UPDATES;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_GET_DESCENDANTS;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_GET_FOLDER_TREE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_JOIN;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_MULTIFILING;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_PWC_SEARCHABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_PWC_UPDATABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_QUERY;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_RENDITIONS;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_UNFILING;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_CAP_VERSION_SPECIFIC_FILING;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION_DOCUMENT_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION_HEIGHT;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION_KIND;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION_LENGTH;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION_MIMETYPE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION_STREAM_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION_TITLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_RENDITION_WIDTH;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_CHANGES_INCOMPLETE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_CHANGE_LOCK_TOKEN;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_CMIS_VERSION_SUPPORTED;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_DESCRIPTION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_NAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_PRODUCT;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_PRODUCT_VERSION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_REPOSITORY_URL;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_ROOT_FOLDER_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_ROOT_FOLDER_URL;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_THIN_CLIENT_URI;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TAG_REPINFO_VENDOR;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_BASE_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_CONTENTSTREAM_ALLOWED;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_CONTROLABLE_ACL;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_CONTROLABLE_POLICY;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_CREATABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_DESCRIPTION;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_DISPLAYNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_FILEABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_FULLTEXT_INDEXED;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_INCLUDE_IN_SUPERTYPE_QUERY;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_LOCALNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_LOCALNAMESPACE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_PARENT_ID;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_QUERYABLE;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_QUERYNAME;
+import static org.apache.chemistry.opencmis.client.bindings.spi.atompub.CmisAtomPubConstants.TYPE_VERSIONABLE;
import java.lang.reflect.Method;
import java.math.BigDecimal;
@@ -133,7 +148,6 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.impl.dataobjects.RenditionDataImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryCapabilitiesImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryInfoBrowserBindingImpl;
-import org.xmlpull.v1.XmlPullParser;
public class AtomPubConverter {
@@ -146,21 +160,21 @@ public class AtomPubConverter {
RepositoryInfoBrowserBindingImpl result = new RepositoryInfoBrowserBindingImpl();
- result.setId(getString(repositoryInfoRawValues, JSON_REPINFO_ID));
- result.setName(getString(repositoryInfoRawValues, JSON_REPINFO_NAME));
- result.setDescription(getString(repositoryInfoRawValues, JSON_REPINFO_DESCRIPTION));
- result.setVendorName(getString(repositoryInfoRawValues, JSON_REPINFO_VENDOR));
- result.setProductName(getString(repositoryInfoRawValues, JSON_REPINFO_PRODUCT));
- result.setProductVersion(getString(repositoryInfoRawValues, JSON_REPINFO_PRODUCT_VERSION));
- result.setRootFolder(getString(repositoryInfoRawValues, JSON_REPINFO_ROOT_FOLDER_ID));
- result.setRepositoryUrl(getString(repositoryInfoRawValues, JSON_REPINFO_REPOSITORY_URL));
- result.setRootUrl(getString(repositoryInfoRawValues, JSON_REPINFO_ROOT_FOLDER_URL));
+ result.setId(getString(repositoryInfoRawValues, TAG_REPINFO_ID));
+ result.setName(getString(repositoryInfoRawValues, TAG_REPINFO_NAME));
+ result.setDescription(getString(repositoryInfoRawValues, TAG_REPINFO_DESCRIPTION));
+ result.setVendorName(getString(repositoryInfoRawValues, TAG_REPINFO_VENDOR));
+ result.setProductName(getString(repositoryInfoRawValues, TAG_REPINFO_PRODUCT));
+ result.setProductVersion(getString(repositoryInfoRawValues, TAG_REPINFO_PRODUCT_VERSION));
+ result.setRootFolder(getString(repositoryInfoRawValues, TAG_REPINFO_ROOT_FOLDER_ID));
+ result.setRepositoryUrl(getString(repositoryInfoRawValues, TAG_REPINFO_REPOSITORY_URL));
+ result.setRootUrl(getString(repositoryInfoRawValues, TAG_REPINFO_ROOT_FOLDER_URL));
result.setCapabilities(convertRepositoryCapabilities(repositoryCapabilitiesRawValues));
result.setAclCapabilities(aclCapabilities);
- result.setLatestChangeLogToken(getString(repositoryInfoRawValues, JSON_REPINFO_CHANGE_LOCK_TOKEN));
- result.setCmisVersionSupported(getString(repositoryInfoRawValues, JSON_REPINFO_CMIS_VERSION_SUPPORTED));
- result.setThinClientUri(getString(repositoryInfoRawValues, JSON_REPINFO_THIN_CLIENT_URI));
- result.setChangesIncomplete(getBoolean(repositoryInfoRawValues, JSON_REPINFO_CHANGES_INCOMPLETE));
+ result.setLatestChangeLogToken(getString(repositoryInfoRawValues, TAG_REPINFO_CHANGE_LOCK_TOKEN));
+ result.setCmisVersionSupported(getString(repositoryInfoRawValues, TAG_REPINFO_CMIS_VERSION_SUPPORTED));
+ result.setThinClientUri(getString(repositoryInfoRawValues, TAG_REPINFO_THIN_CLIENT_URI));
+ result.setChangesIncomplete(getBoolean(repositoryInfoRawValues, TAG_REPINFO_CHANGES_INCOMPLETE));
List<BaseTypeId> types = new ArrayList<BaseTypeId>();
if (changesOnType != null) {
@@ -188,21 +202,21 @@ public class AtomPubConverter {
RepositoryCapabilitiesImpl result = new RepositoryCapabilitiesImpl();
- result.setCapabilityContentStreamUpdates(getEnum(values, JSON_CAP_CONTENT_STREAM_UPDATES,
+ result.setCapabilityContentStreamUpdates(getEnum(values, TAG_CAP_CONTENT_STREAM_UPDATES,
CapabilityContentStreamUpdates.class));
- result.setCapabilityChanges(getEnum(values, JSON_CAP_CHANGES, CapabilityChanges.class));
- result.setCapabilityRendition(getEnum(values, JSON_CAP_RENDITIONS, CapabilityRenditions.class));
- result.setSupportsGetDescendants(getBoolean(values, JSON_CAP_GET_DESCENDANTS));
- result.setSupportsGetFolderTree(getBoolean(values, JSON_CAP_GET_FOLDER_TREE));
- result.setSupportsMultifiling(getBoolean(values, JSON_CAP_MULTIFILING));
- result.setSupportsUnfiling(getBoolean(values, JSON_CAP_UNFILING));
- result.setSupportsVersionSpecificFiling(getBoolean(values, JSON_CAP_VERSION_SPECIFIC_FILING));
- result.setIsPwcSearchable(getBoolean(values, JSON_CAP_PWC_SEARCHABLE));
- result.setIsPwcUpdatable(getBoolean(values, JSON_CAP_PWC_UPDATABLE));
- result.setAllVersionsSearchable(getBoolean(values, JSON_CAP_ALL_VERSIONS_SEARCHABLE));
- result.setCapabilityQuery(getEnum(values, JSON_CAP_QUERY, CapabilityQuery.class));
- result.setCapabilityJoin(getEnum(values, JSON_CAP_JOIN, CapabilityJoin.class));
- result.setCapabilityAcl(getEnum(values, JSON_CAP_ACL, CapabilityAcl.class));
+ result.setCapabilityChanges(getEnum(values, TAG_CAP_CHANGES, CapabilityChanges.class));
+ result.setCapabilityRendition(getEnum(values, TAG_CAP_RENDITIONS, CapabilityRenditions.class));
+ result.setSupportsGetDescendants(getBoolean(values, TAG_CAP_GET_DESCENDANTS));
+ result.setSupportsGetFolderTree(getBoolean(values, TAG_CAP_GET_FOLDER_TREE));
+ result.setSupportsMultifiling(getBoolean(values, TAG_CAP_MULTIFILING));
+ result.setSupportsUnfiling(getBoolean(values, TAG_CAP_UNFILING));
+ result.setSupportsVersionSpecificFiling(getBoolean(values, TAG_CAP_VERSION_SPECIFIC_FILING));
+ result.setIsPwcSearchable(getBoolean(values, TAG_CAP_PWC_SEARCHABLE));
+ result.setIsPwcUpdatable(getBoolean(values, TAG_CAP_PWC_UPDATABLE));
+ result.setAllVersionsSearchable(getBoolean(values, TAG_CAP_ALL_VERSIONS_SEARCHABLE));
+ result.setCapabilityQuery(getEnum(values, TAG_CAP_QUERY, CapabilityQuery.class));
+ result.setCapabilityJoin(getEnum(values, TAG_CAP_JOIN, CapabilityJoin.class));
+ result.setCapabilityAcl(getEnum(values, TAG_CAP_ACL, CapabilityAcl.class));
// handle extensions
// convertExtension(values, result, CAP_KEYS);
@@ -219,9 +233,9 @@ public class AtomPubConverter {
AclCapabilitiesDataImpl result = new AclCapabilitiesDataImpl();
- result.setSupportedPermissions(getEnum(AclCapabilitiesRawValue, JSON_ACLCAP_SUPPORTED_PERMISSIONS,
+ result.setSupportedPermissions(getEnum(AclCapabilitiesRawValue, TAG_ACLCAP_SUPPORTED_PERMISSIONS,
SupportedPermissions.class));
- result.setAclPropagation(getEnum(AclCapabilitiesRawValue, JSON_ACLCAP_ACL_PROPAGATION, AclPropagation.class));
+ result.setAclPropagation(getEnum(AclCapabilitiesRawValue, TAG_ACLCAP_ACL_PROPAGATION, AclPropagation.class));
if (permissionDefinitionList != null) {
result.setPermissionDefinitionData(permissionDefinitionList);
@@ -575,14 +589,14 @@ public class AtomPubConverter {
RenditionDataImpl result = new RenditionDataImpl();
- result.setBigHeight(getInteger(json, JSON_RENDITION_HEIGHT));
- result.setKind(getString(json, JSON_RENDITION_KIND));
- result.setBigLength(getInteger(json, JSON_RENDITION_LENGTH));
- result.setMimeType(getString(json, JSON_RENDITION_MIMETYPE));
- result.setRenditionDocumentId(getString(json, JSON_RENDITION_DOCUMENT_ID));
- result.setStreamId(getString(json, JSON_RENDITION_STREAM_ID));
- result.setTitle(getString(json, JSON_RENDITION_TITLE));
- result.setBigWidth(getInteger(json, JSON_RENDITION_WIDTH));
+ result.setBigHeight(getInteger(json, TAG_RENDITION_HEIGHT));
+ result.setKind(getString(json, TAG_RENDITION_KIND));
+ result.setBigLength(getInteger(json, TAG_RENDITION_LENGTH));
+ result.setMimeType(getString(json, TAG_RENDITION_MIMETYPE));
+ result.setRenditionDocumentId(getString(json, TAG_RENDITION_DOCUMENT_ID));
+ result.setStreamId(getString(json, TAG_RENDITION_STREAM_ID));
+ result.setTitle(getString(json, TAG_RENDITION_TITLE));
+ result.setBigWidth(getInteger(json, TAG_RENDITION_WIDTH));
// convertExtension(json, result, RENDITION_KEYS);
@@ -605,9 +619,9 @@ public class AtomPubConverter {
case CMIS_DOCUMENT:
result = new DocumentTypeDefinitionImpl();
((DocumentTypeDefinitionImpl) result).setContentStreamAllowed(getEnum(definitionRawValues,
- JSON_TYPE_CONTENTSTREAM_ALLOWED, ContentStreamAllowed.class));
+ TYPE_CONTENTSTREAM_ALLOWED, ContentStreamAllowed.class));
((DocumentTypeDefinitionImpl) result).setIsVersionable(getBoolean(definitionRawValues,
- JSON_TYPE_VERSIONABLE));
+ TYPE_VERSIONABLE));
break;
case CMIS_RELATIONSHIP:
result = new RelationshipTypeDefinitionImpl();
@@ -640,22 +654,22 @@ public class AtomPubConverter {
throw new CmisRuntimeException("Type '" + baseType + "' does not match a base type!");
}
- result.setId(getString(definitionRawValues, JSONConstants.JSON_TYPE_ID));
- result.setLocalName(getString(definitionRawValues, JSONConstants.JSON_TYPE_LOCALNAME));
- result.setLocalNamespace(getString(definitionRawValues, JSONConstants.JSON_TYPE_LOCALNAMESPACE));
- result.setDisplayName(getString(definitionRawValues, JSONConstants.JSON_TYPE_DISPLAYNAME));
- result.setQueryName(getString(definitionRawValues, JSONConstants.JSON_TYPE_QUERYNAME));
- result.setDescription(getString(definitionRawValues, JSONConstants.JSON_TYPE_DESCRIPTION));
- result.setBaseTypeId(getEnum(definitionRawValues, JSONConstants.JSON_TYPE_BASE_ID, BaseTypeId.class));
- result.setIsCreatable(getBoolean(definitionRawValues, JSONConstants.JSON_TYPE_CREATABLE));
- result.setIsFileable(getBoolean(definitionRawValues, JSONConstants.JSON_TYPE_FILEABLE));
- result.setIsQueryable(getBoolean(definitionRawValues, JSONConstants.JSON_TYPE_QUERYABLE));
- result.setIsFulltextIndexed(getBoolean(definitionRawValues, JSONConstants.JSON_TYPE_FULLTEXT_INDEXED));
+ result.setId(getString(definitionRawValues, TYPE_ID));
+ result.setLocalName(getString(definitionRawValues, TYPE_LOCALNAME));
+ result.setLocalNamespace(getString(definitionRawValues, TYPE_LOCALNAMESPACE));
+ result.setDisplayName(getString(definitionRawValues, TYPE_DISPLAYNAME));
+ result.setQueryName(getString(definitionRawValues, TYPE_QUERYNAME));
+ result.setDescription(getString(definitionRawValues, TYPE_DESCRIPTION));
+ result.setBaseTypeId(getEnum(definitionRawValues, TYPE_BASE_ID, BaseTypeId.class));
+ result.setIsCreatable(getBoolean(definitionRawValues, TYPE_CREATABLE));
+ result.setIsFileable(getBoolean(definitionRawValues, TYPE_FILEABLE));
+ result.setIsQueryable(getBoolean(definitionRawValues, TYPE_QUERYABLE));
+ result.setIsFulltextIndexed(getBoolean(definitionRawValues, TYPE_FULLTEXT_INDEXED));
result.setIsIncludedInSupertypeQuery(getBoolean(definitionRawValues,
- JSONConstants.JSON_TYPE_INCLUDE_IN_SUPERTYPE_QUERY));
- result.setIsControllablePolicy(getBoolean(definitionRawValues, JSONConstants.JSON_TYPE_CONTROLABLE_POLICY));
- result.setIsControllableAcl(getBoolean(definitionRawValues, JSONConstants.JSON_TYPE_CONTROLABLE_ACL));
- result.setParentTypeId(getString(definitionRawValues, JSON_TYPE_PARENT_ID));
+ TYPE_INCLUDE_IN_SUPERTYPE_QUERY));
+ result.setIsControllablePolicy(getBoolean(definitionRawValues, TYPE_CONTROLABLE_POLICY));
+ result.setIsControllableAcl(getBoolean(definitionRawValues, TYPE_CONTROLABLE_ACL));
+ result.setParentTypeId(getString(definitionRawValues, TYPE_PARENT_ID));
if (propertyDefinitionList != null) {
for (PropertyDefinition<?> propertyDefinition : propertyDefinitionList) {
@@ -685,7 +699,7 @@ public class AtomPubConverter {
}
// find
- Cardinality cardinality = getEnum(propertyTypeRawValues, JSON_PROPERTY_TYPE_CARDINALITY, Cardinality.class);
+ Cardinality cardinality = getEnum(propertyTypeRawValues, ATTR_PROPERTY_TYPE_CARDINALITY, Cardinality.class);
if (cardinality == null) {
throw new CmisRuntimeException("Invalid property type '" + id + "'! Cardinality not set!");
}
@@ -694,7 +708,7 @@ public class AtomPubConverter {
case STRING:
result = new PropertyStringDefinitionImpl();
((PropertyStringDefinitionImpl) result).setMaxLength(getInteger(propertyTypeRawValues,
- JSON_PROPERTY_TYPE_MAX_LENGTH));
+ ATTR_PROPERTY_TYPE_MAX_LENGTH));
// ((PropertyStringDefinitionImpl)
// result).setChoices(convertChoicesString(json.get(JSON_PROPERTY_TYPE_CHOICE)));
break;
@@ -711,27 +725,27 @@ public class AtomPubConverter {
case INTEGER:
result = new PropertyIntegerDefinitionImpl();
((PropertyIntegerDefinitionImpl) result).setMinValue(getInteger(propertyTypeRawValues,
- JSON_PROPERTY_TYPE_MIN_VALUE));
+ ATTR_PROPERTY_TYPE_MIN_VALUE));
((PropertyIntegerDefinitionImpl) result).setMaxValue(getInteger(propertyTypeRawValues,
- JSON_PROPERTY_TYPE_MAX_VALUE));
+ ATTR_PROPERTY_TYPE_MAX_VALUE));
// ((PropertyIntegerDefinitionImpl)
// result).setChoices(convertChoicesInteger(json.get(JSON_PROPERTY_TYPE_CHOICE)));
break;
case DATETIME:
result = new PropertyDateTimeDefinitionImpl();
((PropertyDateTimeDefinitionImpl) result).setDateTimeResolution(getEnum(propertyTypeRawValues,
- JSON_PROPERTY_TYPE_RESOLUTION, DateTimeResolution.class));
+ ATTR_PROPERTY_TYPE_RESOLUTION, DateTimeResolution.class));
// ((PropertyDateTimeDefinitionImpl)
// result).setChoices(convertChoicesDateTime(json.get(JSON_PROPERTY_TYPE_CHOICE)));
break;
case DECIMAL:
result = new PropertyDecimalDefinitionImpl();
((PropertyDecimalDefinitionImpl) result).setMinValue(getDecimal(propertyTypeRawValues,
- JSON_PROPERTY_TYPE_MIN_VALUE));
+ ATTR_PROPERTY_TYPE_MIN_VALUE));
((PropertyDecimalDefinitionImpl) result).setMaxValue(getDecimal(propertyTypeRawValues,
- JSON_PROPERTY_TYPE_MAX_VALUE));
+ ATTR_PROPERTY_TYPE_MAX_VALUE));
((PropertyDecimalDefinitionImpl) result).setPrecision(getEnum(propertyTypeRawValues,
- JSON_PROPERTY_TYPE_PRECISION, DecimalPrecision.class));
+ ATTR_PROPERTY_TYPE_PRECISION, DecimalPrecision.class));
// ((PropertyDecimalDefinitionImpl)
// result).setChoices(convertChoicesDecimal(json.get(JSON_PROPERTY_TYPE_CHOICE)));
break;
@@ -762,20 +776,20 @@ public class AtomPubConverter {
*/
// generic
- result.setId(getString(propertyTypeRawValues, JSONConstants.JSON_PROPERTY_TYPE_ID));
+ result.setId(getString(propertyTypeRawValues, ATTR_PROPERTY_TYPE_ID));
result.setPropertyType(propertyType);
result.setCardinality(cardinality);
- result.setLocalName(getString(propertyTypeRawValues, JSON_PROPERTY_TYPE_LOCALNAME));
- result.setLocalNamespace(getString(propertyTypeRawValues, JSON_PROPERTY_TYPE_LOCALNAMESPACE));
- result.setQueryName(getString(propertyTypeRawValues, JSON_PROPERTY_TYPE_QUERYNAME));
- result.setDescription(getString(propertyTypeRawValues, JSON_PROPERTY_TYPE_DESCRIPTION));
- result.setDisplayName(getString(propertyTypeRawValues, JSON_PROPERTY_TYPE_DISPLAYNAME));
- result.setIsInherited(getBoolean(propertyTypeRawValues, JSON_PROPERTY_TYPE_INHERITED));
- result.setIsOpenChoice(getBoolean(propertyTypeRawValues, JSON_PROPERTY_TYPE_OPENCHOICE));
- result.setIsOrderable(getBoolean(propertyTypeRawValues, JSON_PROPERTY_TYPE_ORDERABLE));
- result.setIsQueryable(getBoolean(propertyTypeRawValues, JSON_PROPERTY_TYPE_QUERYABLE));
- result.setIsRequired(getBoolean(propertyTypeRawValues, JSON_PROPERTY_TYPE_REQUIRED));
- result.setUpdatability(getEnum(propertyTypeRawValues, JSON_PROPERTY_TYPE_UPDATABILITY, Updatability.class));
+ result.setLocalName(getString(propertyTypeRawValues, ATTR_PROPERTY_TYPE_LOCALNAME));
+ result.setLocalNamespace(getString(propertyTypeRawValues, ATTR_PROPERTY_TYPE_LOCALNAMESPACE));
+ result.setQueryName(getString(propertyTypeRawValues, ATTR_PROPERTY_TYPE_QUERYNAME));
+ result.setDescription(getString(propertyTypeRawValues, ATTR_PROPERTY_TYPE_DESCRIPTION));
+ result.setDisplayName(getString(propertyTypeRawValues, ATTR_PROPERTY_TYPE_DISPLAYNAME));
+ result.setIsInherited(getBoolean(propertyTypeRawValues, ATTR_PROPERTY_TYPE_INHERITED));
+ result.setIsOpenChoice(getBoolean(propertyTypeRawValues, ATTR_PROPERTY_TYPE_OPENCHOICE));
+ result.setIsOrderable(getBoolean(propertyTypeRawValues, ATTR_PROPERTY_TYPE_ORDERABLE));
+ result.setIsQueryable(getBoolean(propertyTypeRawValues, ATTR_PROPERTY_TYPE_QUERYABLE));
+ result.setIsRequired(getBoolean(propertyTypeRawValues, ATTR_PROPERTY_TYPE_REQUIRED));
+ result.setUpdatability(getEnum(propertyTypeRawValues, ATTR_PROPERTY_TYPE_UPDATABILITY, Updatability.class));
// handle extensions
// convertExtension(json, result, PROPERTY_TYPE_KEYS);
@@ -856,7 +870,6 @@ public class AtomPubConverter {
private static Date parseAtomPubDate(String atomPubDate) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
- // sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
sdf.setLenient(true);
Date d = null;
@@ -877,29 +890,4 @@ public class AtomPubConverter {
}
return d;
}
-
- /**
- * Skips a tag or subtree.
- */
- private static void skip(XmlPullParser parser) throws Exception {
- int level = 1;
- while (next(parser)) {
- int event = parser.getEventType();
- if (event == XmlPullParser.START_TAG) {
- level++;
- } else if (event == XmlPullParser.END_TAG) {
- level--;
- if (level == 0) {
- break;
- }
- }
- }
-
- next(parser);
- }
-
- private static boolean next(XmlPullParser parser) throws Exception {
- parser.next();
- return true;
- }
}