alfresco custom type creation not working

cancel
Showing results for 
Search instead for 
Did you mean: 
Isha
Member II

alfresco custom type creation not working

Jump to solution

We want to create custom type for FOLDER object don’t want to modify OOTB one) that we have done following steps through alfresco share UI:

 

  1. Admin tools - > model-manager - > create model(supplier-portal) - >create custom-type (parent type for creating type is system-folder)
  2. Create property
  3. Clicking on type -> layout manager -> Apply Default layout -> save
  4. Model  -Active
  5. Exported xml for the same

 

Approach 1:

 

  1. Copied supplier-portal.xml to my-alfresco-project -> module directory.
  2. Added entry of same xml in bootstrap-context.xml.
  1. And trying to create new folder with new type by passing the namespace uri:

 

              

Approach :2

 

  1. Clicked on the admintools -> data-dictionary - > models.
  2. Imported models xml’s and activated the same.
  3. Copied the xml files in workspace/alfresco directory and created new bootstarp-context.xml for the same.

 

 

Issue is : We are not able create the folder . Showing error below


02300016 Wrapped Exception (with status template): Type is not handled by this service: {}http://www.steepgraph.org/model/supplierportal/1.0

1 Solution

Accepted Solutions
narkuss
Established Member II

Re: alfresco custom type creation not working

Jump to solution

Ok, you are trying to create nodes by java code. Try switching to nodeService instead of fileFolderService. We always create nodes this way. 

View solution in original post

3 Replies
narkuss
Established Member II

Re: alfresco custom type creation not working

Jump to solution

Maybe you are trying to create new type in approach 1 specifying the full uri? Sorry but you did not paste the url you called. I have always done that by specifying the prefix, try to add a prefix to your namespace in model.xml, and use it instead of full uri.

Also, in approach 1, i think you should deactivate the model you created from share UI.

Look at the logs at startup time too, to see whether there are errors on project startup. 

Hope it helps

Isha
Member II

Re: alfresco custom type creation not working

Jump to solution

Thanks for replying.

I have used below url for creating Qname:

{http://www.steepgraph.org/model/supplierportal/1.0}Part_Number

ans specified prefix as sp.

 

Below is the sample code where I am trying to create folder of new type

QName custom_type = QName.createQName("{http://www.steepgraph.org/model/supplierportal/1.0}Part_Number");
FileInfo folderInfo = serviceRegistry.getFileFolderService().create(parentFolderNodeRef, folderName, custom_type);

narkuss
Established Member II

Re: alfresco custom type creation not working

Jump to solution

Ok, you are trying to create nodes by java code. Try switching to nodeService instead of fileFolderService. We always create nodes this way.