cancel
Showing results for 
Search instead for 
Did you mean: 

Changing custom types?

a_p
Champ in-the-making
Champ in-the-making
Dear Community,
I intend to implement a custom content model for our institution and everything worked mostly fine til now.
But we have a problem with the fact, that a custom type isn't modifiable no longer once it is set. I know, that this is how it is intended to work, but I would like to know how other users deal with that problem. What about the imaginable scenario, that an end-user notices too late, that he has chosen the wrong type? How to communicate the necessity of a re-upload in that case?
Or, is there any possibility to change it anyway? Does anyone have some clues how to minimize that inconvenience for the end-user?

I would be very thankful for your advice :-).

Thank you in advance and best regards,

Anne
6 REPLIES 6

mitpatoliya
Star Collaborator
Star Collaborator
For custom content types you can change content types but you can only convert it in to one of its child content type. That is very obvious because if you go from child type to parent type you are likley to loose the information without any clue and that is the reason Alfresco does not provide that feature. Check this out for more details

http://blog.arvixe.com/change-type-of-document-in-alfresco/


Work Around:

Download content in local file system,
Delete content from alfresco
Upload that again with right content type.

mrogers
Star Contributor
Star Contributor
Changing a type (in any system, not just alfresco) requires a data migration.   Usually you would just run a script of some sort or use some sort of tool.   The actual details depend upon the details of your data change.

You may like to look at the implementations of some of the patches within alfresco.

ddelapasse
Champ in-the-making
Champ in-the-making
For this reason we will not use types in our custom model.  We have types and we'll programmatically assign the type's aspects when the type is selected via our UI without actually applying the type (we have a text field where we put the type's name).  I was too afraid of being locked into a situation like the one you describe!

It seems that you can never really get rid of types (even if no docs use them).  You can remove them from the content model, but Alfresco continues to WARN during startup that the type is missing.

Hi,

I have had a similar problem with models that are no longer in use and Alfresco seemed to still look for them.
What I later realized was that the content model definition still existed with the indexes AlfrescoModels folder, so on start up Alfresco would look to find the definition; therefore returning a warning since it could not find it. You need to remove the content model index reference and the warning will go away.

ddelapasse
Champ in-the-making
Champ in-the-making
^DarkRedd, Can you provide steps to do that?  I started trying once and something bad happened so I backed out.  I hate all the warnings and would love to clean up!

Hi,

You need to locate both alfrescoModels folder in the alf_data (this is based on a local install of solr):
1. <tomcat_home>/alf_data/solr/archive-SpacesStore/alfrescoModels/
2. <tomcat_home>/alf_data/solr/archive-SpacesStore/alfrescoModels/

In both these folders look for a xml files that defines your models, they will start with the prefix of you model uri (e.g. psa.documentTypes.xml).
Remove both these files, and then deploy the content model definition file, everything should work and the warning should go away.