cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS 1.1 atom binding

pdigumarthi
Champ in-the-making
Champ in-the-making
Hi,

I am trying to create a document using the cmis 1.1 services

I have used the following URL and doing a http POST request  { I am trying to do this from Advance rest client }

http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/children

and using the following atom.xml

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908">
<title>sample-a.doc</title>
<summary>A sample whitepaper named Sample A</summary>
<content type="application/msword">
UEsDBBQABgAIAAAAIQAJJIeCg   …….   …=
</content>
<cmisraSmiley Surprisedbject>
<cmisSmiley Tongueroperties>
<cmisSmiley TongueropertyId propertyDefinitionId="cmisSmiley SurprisedbjectTypeId"><cmis:value>cmis:document</cmis:value></cmisSmiley TongueropertyId>
<cmisSmiley TongueropertyId propertyDefinitionId="cmis:name"><cmis:value>xgyy.doc</cmis:value></cmisSmiley TongueropertyId>
</cmisSmiley Tongueroperties>
</cmisraSmiley Surprisedbject>
</entry>


I am getting the following error.

<html><head><title>Apache Chemistry OpenCMIS - invalidArgument error</title><style><!–H1 {font-size:24px;line-height:normal;font-weight:bold;background-color:#f0f0f0;color:#003366;border-bottom:1px solid #3c78b5;padding:2px;} BODY {font-family:Verdana,arial,sans-serif;color:black;font-size:14px;} HR {color:#3c78b5;height:1px;}–></style></head><body><h1>HTTP Status 400 - <!–exception–>invalidArgument<!–/exception–></h1><p><!–message–>Properties must be set!<!–/message–></p><hr noshade='noshade'/><!–stacktrace–><pre>
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Properties must be set!
   at org.apache.chemistry.opencmis.server.support.CmisServiceWrapper.checkProperties(CmisServiceWrapper.java:210)
   at org.apache.chemistry.opencmis.server.support.CmisServiceWrapper.create(CmisServiceWrapper.java:698)
   at org.apache.chemistry.opencmis.server.impl.atompub.ObjectService$Create.serve(ObjectService.java:102)
   at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:88)
   at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:225)
   at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.service(CmisAtomPubServlet.java:172)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
   at org.alfresco.opencmis.CMISServletDispatcher.execute(CMISServletDispatcher.java:173)
   at org.alfresco.opencmis.CMISWebScript.execute(CMISWebScript.java:51)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:377)
   at org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:45)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341)
   at uorg.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:26)
   at org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:81)
   at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119)
   at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88)
   at org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:77)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
   at org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:74)
   at org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:53)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)




Also please let me know how can  I figure out what is the structure of Atom or JASON for different requets, say create folder , get Document etc.

The need here is we dont want to use the Java API , instead just call the CMIS rest API's
2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator
Please write your atom xml like following

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:alf="http://www.alfresco.org">
   <author>
      <name>admin</name>
   </author>
   <summary>Presentation.</summary>
   <title>test_add_node</title>
   <cmisra:object>
      <cmis:properties>
         <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
            <cmis:value>D:ca:customContent</cmis:value>
         </cmis:propertyId>
         <cmis:propertyInteger propertyDefinitionId="cmis:contentStreamLength" displayName="Content Stream Length" queryName="cmis:contentStreamLength">
            <cmis:value>98495335</cmis:value>
         </cmis:propertyInteger>
         <cmis:propertyString propertyDefinitionId="cmis:description" displayName="Titre" queryName="cmis:description">
            <cmis:value>cmis:description</cmis:value>
         </cmis:propertyString>
         <cmis:propertyString propertyDefinitionId="ca:anotherText2" displayName="ca:anotherText2" queryName="ca:anotherText2">
            <cmis:value>another text</cmis:value>
         </cmis:propertyString>
      </cmis:properties>
   </cmisra:object>
   <cmisra:content>
      <cmisra:mediatype>text/plain</cmisra:mediatype>
      <cmisra:base64>VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4=</cmisra:base64>
   </cmisra:content>
</entry>

jpotts
World-Class Innovator
World-Class Innovator
You appear to be attempting to use the browser binding but are instead sending XML, which doesn't work. If you want to send and receive Atom XML, use the AtomPub binding. If you want to send HTML forms and receive JSON, use the browser binding.

Because the browser binding is the same across all implementations, you can get full documentation on what to send and receive by reading <a href="http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/CMIS-v1.1-cs01.pdf">the spec</a>, <a href="http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/schema/">the schema</a>, and <a href="http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/examples/">the JSON examples</a>.

Jeff

Jeff
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.