cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Title and Description when adding a document

michaelloveusa
Champ on-the-rise
Champ on-the-rise
Hi there - I am trying to use the CMIS Object Service to create a document and have it set the cm:title and cm:description properties. When I use the discovery service, I see that they are stored as an aspect property, but I cannot figure out how to get them in there. I keep getting variations of the following error:

   <soap:Body>
      <soap:Fault>
         <faultcode>soapSmiley Frustratederver</faultcode>
         <faultstring>Property cmis:title not found for type D:srv:devServices in CMIS Dictionary</faultstring>
         <detail>
            <cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns3="http://www.alfresco.org">
               <type>invalidArgument</type>
              
400

               <message>Property cmis:title not found for type D:srv:devServices in CMIS Dictionary</message>
            </cmisFault>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

Can someone guide me?

Thanks, Mike
18 REPLIES 18

michaelloveusa
Champ on-the-rise
Champ on-the-rise
Hi Jeff - I am going down the CMIS Workbench path and have run into some issues.

1. What url are you supposed to put in on the basic connection page? I used webservices and put the url of the repository service there.
2. When I add the following to the expert tab:
org.apache.chemistry.opencmis.objectfactory.classname=org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl
is that all I need? Or am I supposed to add the url to the end like the other items in the list as such:

org.apache.chemistry.opencmis.binding.webservices.PolicyService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl

This seems like it may be a problem with the url as all the services are now pointing to RepositoryService?wsdl

Anyway - at current state, I am able to load the repository, but unable to login. I get the following error:
Cannot initialize Web Services service object [org.apache.chemistry.opencmis.binding.webservices.ObjectService]: {http://docs.oasis-open.org/ns/cmis/ws/200908/}ObjectService is not a valid service. Valid services are:  {http://docs.oasis-open.org/ns/cmis/ws/200908/}RepositoryService

Here is what the expert page looks like:
org.apache.chemistry.opencmis.binding.spi.type=webservices
org.apache.chemistry.opencmis.binding.webservices.RepositoryService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.NavigationService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.ObjectService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.VersioningService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.DiscoveryService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.MultiFilingService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.RelationshipService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.ACLService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.PolicyService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.objectfactory.classname=org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl
org.apache.chemistry.opencmis.user=************
org.apache.chemistry.opencmis.password=**********
org.apache.chemistry.opencmis.binding.compression=true

I have added the jar location to the class path, so I think that part is fine.

Ideas on what is wrong?

Thanks! Mike

michaelloveusa
Champ on-the-rise
Champ on-the-rise
Actually, I got past that by setting the services correctly in the expert page as such:

org.apache.chemistry.opencmis.binding.spi.type=webservices
org.apache.chemistry.opencmis.binding.webservices.RepositoryService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RepositoryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.NavigationService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/NavigationService?wsdl
org.apache.chemistry.opencmis.binding.webservices.ObjectService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/ObjectService?wsdl
org.apache.chemistry.opencmis.binding.webservices.VersioningService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/VersioningService?wsdl
org.apache.chemistry.opencmis.binding.webservices.DiscoveryService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/DiscoveryService?wsdl
org.apache.chemistry.opencmis.binding.webservices.MultiFilingService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/MultiFilingService?wsdl
org.apache.chemistry.opencmis.binding.webservices.RelationshipService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/RelationshipService?wsdl
org.apache.chemistry.opencmis.binding.webservices.ACLService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/ACLService?wsdl
org.apache.chemistry.opencmis.binding.webservices.PolicyService=http://govecmapq01.gov.dnvr:8080/alfresco/soap/PolicyService?wsdl
org.apache.chemistry.opencmis.objectfactory.classname=org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl

I am not sure how to get that correct via the url on the basic page though.

jpotts
World-Class Innovator
World-Class Innovator
The URL to specify for the web services binding is:
http://localhost:8080/alfresco/cmisws/RepositoryService?wsdl

For others who may need it, the URL to specify for the ATOM Pub binding is:
http://localhost:8080/alfresco/cmisatom

Jeff

michaelloveusa
Champ on-the-rise
Champ on-the-rise
Obviously, those are if you are running the server locally. You should be able to point that anywhere. I have mine pointed to our QA environment. My next question is this: I am able to browse around the repository and create documents, but I cannot see a way to set attributes in the aspects via the UI. It looks like it is possible to create a document via the Groovy Console. Are there examples of how to do that with aspect attributes?

Mike

michaelloveusa
Champ on-the-rise
Champ on-the-rise
Sorry, this is a work in progress. I was able to create a document via the groovy console as such:

import org.apache.chemistry.opencmis.commons.*
import org.apache.chemistry.opencmis.commons.data.*
import org.apache.chemistry.opencmis.commons.enums.*
import org.apache.chemistry.opencmis.client.api.*

// def cmis = new scripts.CMIS(session)
// println session.repositoryInfo.name
// cmis.printObjectSummary "/"
  Map<String, Object> properties = new HashMap<String, Object>();
  properties.put(PropertyIds.NAME, "doc123");
  properties.put(PropertyIds.OBJECT_TYPE_ID, "D:srv:devServices,P:cm:titled");
  properties.put("cm:description", "My document");
  properties.put("cm:title", "My title");

  Document doc = session.getRootFolder().createDocument(properties, null, null);

Just enter your document type in place of the above bolded text. Next step, WireShark!

michaelloveusa
Champ on-the-rise
Champ on-the-rise
Victory!

The object type id is as you would expect:

<ns1Smiley TongueropertyId propertyDefinitionId="cmisSmiley SurprisedbjectTypeId" localName="cmisSmiley SurprisedbjectTypeId" displayName="cmisSmiley SurprisedbjectTypeId" queryName="cmisSmiley SurprisedbjectTypeId">
   <ns1:value>D:srv:devServices</ns1:value>
</ns1Smiley TongueropertyId>

The aspect properties are in the create request like this:

<setAspects:setAspects xmlns:setAspects="http://www.alfresco.org" xmlns="http://www.alfresco.org">
   <aspectsToAdd>P:cm:titled</aspectsToAdd>
   <properties>
      <propertyString xmlns:ns0="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" propertyDefinitionId="cm:description">
         <value>Mydocument</value>
      </propertyString>
      <propertyString xmlns:ns0="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" propertyDefinitionId="cm:title">
         <value>Mytitle</value>
      </propertyString>
   </properties>
</setAspects:setAspects>

sindhu
Champ in-the-making
Champ in-the-making
Hi Jeff!!
I could not create a document using cm:titled.I am using alfresco 4.2 using dotcmis. Please help!!

jpotts
World-Class Innovator
World-Class Innovator
I don't know if there is an extension for dotcmis like there is for OpenCMIS and for cmislib that lets you work with aspects. Aspects are not part of the CMIS 1.0 spec, so it may not be possible with dotcmis.

Jeff

sindhu
Champ in-the-making
Champ in-the-making
Hi Jeff!!

Then what could be the way for using P:cm:titled to set  cm:title and cm:description. I need to set those values while creating a document. I am using dotcmis and Alfresco community edition 4.2