Search code examples
javapythonimportexportalfresco

Edit content of acp in python/java


I exported my documents from Alfresco 4.x and now i need to import them to Alfreco 5.1, however i had different content models. So only think i need is to rewrite types and base url, i have similar types in my new Alfresco, but not the same name and prefix, url. So my question is:

How to rewrite metadata which is stored in ACP file in python or maybe java?

I tried to use zipFile in python, but it gives me only errors and keep convincing me that i dont have zip file. I can't open it in notepad++ because it is not readable. I tried to just read content of file but python give blank line when i try to print it.

EDIT: Here is a link to my file that i need to open and edit. DELETED no need for this anymore.


Solution

  • If it is a single archive your best bet is to unpack the acp (just a normal zip file, so any zip tool will work) and manipulate the .XML file inside it, which contains all the metadata, types, associations... You could then use an XSLT to change the XML file and types and properties inside and rezip it with the rest of the content package.

    Another approach can be to add the missing properties and aspects in a new 'legacy'-content model and add it to Alfresco 5.1. Once it is imported you can write a script to transfer the properties to the new model.

    Once you are sure everything is copied you can remove the old model.