Unable to change type of document

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

Unable to change type of document

I have two questions about two Custom Content Types I created called my:whitepaper and my:bc:

  • When I try to Change Type on a document and I select my:whitepaper custom type it works but not with my:bc. When I select my:bc It gives me an error message saying: Unable to change type of document 'test.pdf'.

  • In "Manage Rules" -> "Specialse Type" , I can't see my bc type:

The type of 'test.pdf' document is cm:content:

Here's my :

custom-model-context.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>

<!-- Registration of new models -->
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/customModel.xml</value>
</list>
</property>
<property name="labels">
<list>
<value>alfresco/extension/custom-model-messages</value>
</list>
</property>
</bean>
</beans>

custom-model-messages.properties:
type.my_whitepaper= piece Comptable
type.my_whitepaper.title= piece Comptable
type.my_whitepaper.property.my_product= Ecriture Comptable

type.my_bc=bc
type.my_bc.title=bc

customModel.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!-- Definition of new Model -->

<!-- The important part here is the name - Note: the use of the my: namespace
which is defined further on in the document -->
<model name="my:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

<!-- Optional meta-data about the model -->
<description>Example Custom Model</description>
<author>Alfresco Documentation Team</author>
<version>1.0</version>

<!-- Imports are required to allow references to definitions in other models -->
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0"
prefix="d" />
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
</imports>

<!-- Introduction of new namespaces defined by this model -->
<!-- NOTE: The following namespace my.new.model should be changed to reflect
your own namespace -->
<namespaces>
<namespace uri="http://www.mycompany.com/model/content/1.0" prefix="my" />
</namespaces>

<types>
<!-- Enterprise-wide generic document type -->
<type name="my:doc">
<title>MyCompany Generic Document</title>
<parent>cm:content</parent>

</type>


<type name="my:marketingDoc">
<title>MyCompany Marketing Document</title>
<parent>my:doc</parent>
<properties>
<property name="mySmiley Tongueroduct">
<title>écriture comptable</title>
<type>d:text</type>
</property>
<property name="cm:author">
<title>auteur</title>
<type>d:text</type>
</property>
</properties>
</type>
<type name="my:bc">
<title>Bon de commande</title>
<parent>my:marketingDoc</parent>

</type>
<type name="my:whitepaper">
<title>une piece Comptable</title>
<parent>my:marketingDoc</parent>
</type>


</types>
</model>

share-config-custom.xml:

<types>
<type name="cm:content">
<subtype name="smf:smartFolderTemplate" />
<subtype name="my:whitepaper" />
<subtype name="my:bc" />
</type>

<type name="cm:folder">
</type>

<type name="trx:transferTarget">
<subtype name="trx:fileTransferTarget" />
</type>

</types>

<!-- custom content comptable -->
<config evaluator="model-type" condition="my:whitepaper">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="mySmiley Tongueroduct" />
<show id="cm:author" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
<!-- <show id="my:relatedDocuments" />-->
</field-visibility>
</form>
</forms>
</config>


<config evaluator="node-type" condition="my:whitepaper">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="mySmiley Tongueroduct" />
<show id="cm:author" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
<!-- <show id="my:relatedDocuments" /> -->
</field-visibility>
</form>
</forms>
</config>

<!-- custom Bon commande -->

<config evaluator="model-type" condition="my:bc">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="mySmiley Tongueroduct" />
<show id="cm:author" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
<!-- <show id="my:relatedDocuments" />-->
</field-visibility>
</form>
</forms>
</config>


<config evaluator="node-type" condition="my:bc">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="mySmiley Tongueroduct" />
<show id="cm:author" />
<show id="cm:title" force="true" />
<show id="cm:description" force="true" />
<!-- <show id="my:relatedDocuments" /> -->
</field-visibility>
</form>
</forms>
</config>

Logs:

- The logs : alfresco.log and catalina.out don't show anything.

- Browser's Developer tools show this:

4 Replies
cesarista
Customer

Re: Unable to change type of document

Hi:

Are you sure that your content type my:bc is available for dictionary service ? 

You can check in dictionary service if your type is already defined or you did some non-incremental thing in some moment.

How to list and check your custom content models in Alfresco - Checking details about bootstrap cont... 

Hope this helps.

--C.

imanez1
Active Member II

Re: Unable to change type of document

I checked the link you provided and my type my:bc is not available in http://localhost:8080/alfresco/service/api/dictionary  , but my_whitepaper is.

I also tried the following URL, not available:

What do i do? I am new to this and I don't know where to start, any help is appreciated.

cesarista
Customer

Re: Unable to change type of document

Hi:

Probably between your alfresco and solr logs, you may find some incremental change warning on the content model, so it is not deployed / updated correctly.

Regards.

--C.

imanez1
Active Member II

Re: Unable to change type of document

I can't find any warning in the logs