cancel
Showing results for 
Search instead for 
Did you mean: 

How to reassign XML file and HTML

mvlach
Champ in-the-making
Champ in-the-making
I there any possibility to assign a XML and HTML content to the webform ?

Let's imagine:

I have created the news.html from the webform news. 2 files are rendered to the /content directory

news.xml
news.html

When I backup all content (throught cifs) and recreate the webproject (the old contains some unrecoverable error) can I after copy all content reassign the news.xml and news.html to webform news ?

Thanks Mila
3 REPLIES 3

tommorris
Champ in-the-making
Champ in-the-making
1. Just copying the 'Web Forms' folder to the clean target machine won't re-create the meta-data. So, you can perform an export of that folder from the old machine and import that ACP file back into the new machine.

2. After that, copy the XML files and renditions to the new AVM project space.

3. Then, install this AMP: http://wiki.alfresco.com/wiki/Web_Project_Tools and run the analysis tools which will attempt to re-associate the XMLs and renditions to the web-form.

I find managing web-project files between repositories a bit of a nightmare, and the above mentioned tool, isn't perfect.
The same tool also contains reference to a web-project export/import feature, which is yet to be developed but is badly needed.

If you find out a better technique, please share.

Tom

tommorris
Champ in-the-making
Champ in-the-making
Another idea, might be to hand-create an ACP yourself.
Looking at the sample wcm-website bundle provided by alfresco, it seems fairly straight-forward, allow laborious.

1. Export the web-project's folder in the DM repository as an ACP (it looks empty but the attributes are on the folder).

2. Export your web-form folders as ACPs, as before.

3. Zip up the whole AVM web-site (from staging) as a WAR file.

4. Fill the contents of the module.properties file (looks easy)
something like the example one:
# Alfresco WCM Sample Website module properties
module.id=wcm.site.alfresco
module.title=Alfresco WCM Sample Website
module.description=Alfresco WCM Sample Website
module.version=1.1
module.repo.version.min=2.1
module.depends.websitetools=1.0-*

5. Edit the sample module-context.xml file. This references all your web-form ACPs, and your web-project ACP

6. Make sure these files are all put in the correct folder structure (follow the example), then zip it up and rename it '.ACP'.

7. Then try importing it on a destination machine (apparently, that web-project tool I mentioned earlier, does import, just not export). This will also unpack the AVM war file, and perform the re-associations.

I'm not sure what happens if you keep installing the same web-project again and again. Do you think we need to delete the destination web-project first?

Tom

kvc
Champ in-the-making
Champ in-the-making
Guys:


Tom's suggestion for the community contribution - the web project tools - is a good one.

One thing to note, however, is that if you import and XML and attempt to edit, you do have an option of the edit/download page to edit with a Web Form (it's hard to see, look closely at the bottom).  If you click this, it allows you to select a web form and open it up and edit, thus re-associating the XML.

This is fine for onesy-twosy XML associations.  If you want to do a bulk association, absolutely follow Tom's recommendation.

Tom, nice press release on your WCM implementation today, btw!


Kevin