cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS Type 'cmis:document,P:cm:titled' is unknown!

lukas
Champ in-the-making
Champ in-the-making
Hi

I'm trying to add some custom files and folders with custom metadata to alfresco.
That didn't worked, so I'm trying to execute the default code from:
http://code.google.com/a/apache-extras.org/p/alfresco-opencmis-extension/

I always got the follwing Error:
Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException:
Type 'cmis:document,P:cm:titled' is unknown!


Thanks for your help!

package Main;

import java.util.HashMap;
import java.util.Map;


import org.apache.chemistry.opencmis.client.api.Document;
import org.apache.chemistry.opencmis.client.api.Session;
import org.apache.chemistry.opencmis.client.api.SessionFactory;
import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
import org.apache.chemistry.opencmis.commons.PropertyIds;
import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.enums.BindingType;
import org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl;


public class Test {

   /**
    * @param args
    */
   public static void main(String[] args) {
      Map<String, String> parameter = new HashMap<String, String>();

      // Set the user credentials
      parameter.put(SessionParameter.USER, "admin");
      parameter.put(SessionParameter.PASSWORD, "admin");

      // Specify the connection settings
      parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/cmisatom");
      parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

      // Set the alfresco object factory
      parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

      // Create a session
      SessionFactory factory = SessionFactoryImpl.newInstance();
      Session session = factory.getRepositories(parameter).get(0).createSession();
      
      
      Map<String, Object> properties = new HashMap<String, Object>();
      properties.put(PropertyIds.NAME, "doc1");
      properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled");
      properties.put("cm:description", "My document");

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

}


used libraries:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
   <classpathentry kind="src" path="src"/>
   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
   <classpathentry kind="lib" path="lib/activation-1.1.jar"/>
   <classpathentry kind="lib" path="lib/alfresco-opencmis-extension-0.3.jar"/>
   <classpathentry kind="lib" path="lib/chemistry-opencmis-client-api-0.9.0.jar"/>
   <classpathentry kind="lib" path="lib/chemistry-opencmis-client-bindings-0.9.0.jar"/>
   <classpathentry kind="lib" path="lib/chemistry-opencmis-client-impl-0.9.0.jar"/>
   <classpathentry kind="lib" path="lib/chemistry-opencmis-commons-api-0.9.0.jar"/>
   <classpathentry kind="lib" path="lib/chemistry-opencmis-commons-impl-0.9.0.jar"/>
   <classpathentry kind="lib" path="lib/chemistry-opencmis-test-tck-0.9.0.jar"/>
   <classpathentry kind="lib" path="lib/chemistry-opencmis-workbench-0.9.0.jar"/>
   <classpathentry kind="lib" path="lib/groovy-all-2.1.3.jar"/>
   <classpathentry kind="lib" path="lib/jaxb-api-2.1.jar"/>
   <classpathentry kind="lib" path="lib/jaxb-impl-2.1.11.jar"/>
   <classpathentry kind="lib" path="lib/jaxws-api-2.1.jar"/>
   <classpathentry kind="lib" path="lib/jaxws-rt-2.1.7.jar"/>
   <classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
   <classpathentry kind="lib" path="lib/mimepull-1.3.jar"/>
   <classpathentry kind="lib" path="lib/resolver-20050927.jar"/>
   <classpathentry kind="lib" path="lib/saaj-api-1.3.jar"/>
   <classpathentry kind="lib" path="lib/saaj-impl-1.3.3.jar"/>
   <classpathentry kind="lib" path="lib/slf4j-api-1.7.5.jar"/>
   <classpathentry kind="lib" path="lib/slf4j-log4j12-1.7.5.jar"/>
   <classpathentry kind="lib" path="lib/sqljdbc4.jar"/>
   <classpathentry kind="lib" path="lib/stax-api-1.0-2.jar"/>
   <classpathentry kind="lib" path="lib/stax-api-1.0.jar"/>
   <classpathentry kind="lib" path="lib/stax-ex-1.2.jar"/>
   <classpathentry kind="lib" path="lib/stax2-api-3.1.1.jar"/>
   <classpathentry kind="lib" path="lib/streambuffer-0.9.jar"/>
   <classpathentry kind="lib" path="lib/woodstox-core-asl-4.2.0.jar"/>
   <classpathentry kind="lib" path="lib/commons-lang3-3.1.jar"/>
   <classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
   <classpathentry kind="lib" path="lib/commons-io-2.4-javadoc.jar"/>
   <classpathentry kind="lib" path="lib/commons-io-2.4-sources.jar"/>
   <classpathentry kind="lib" path="lib/commons-io-2.4-tests.jar"/>
   <classpathentry kind="lib" path="lib/commons-io-2.4-test-sources.jar"/>
   <classpathentry kind="output" path="bin"/>
</classpath>
11 REPLIES 11

gonial
Champ in-the-making
Champ in-the-making
Why put this line?

"properties.put("cmisSmiley SurprisedbjectTypeId", "D:vi:doc");"

imran
Champ on-the-rise
Champ on-the-rise
Could you fix that issue? I am facing the same problem as well.
Any ideas?
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.