[opencms-dev] Mass change types?

Stanczak Group justin at stanczakgroup.com
Tue Apr 17 16:47:35 CEST 2007


I'll give that a shot. I did get the export to work, but it was strange. 
I have to upload my files to the server which showed them as plain text. 
Then export them to a zip file. I opened the zip file and edited the 
manifest.xml file by changing all the types from plain to xmlcontent. I 
then imported it back and that updated them all correctly. I can't see 
doing this regularly but it worked.

Christoph Schönfeld wrote:
> You have to use CmsObject.chtype() to change the resource type.
>
> Recently I had the same problem as you. ZIP upload does not recognize 
> the file type and sets it to plain.
> My solution was to write a JSP page which I now have as a custom admin 
> tool hooked in the administration interface.
>
> The code required to change the resource type is here:
>
>                            cms.lockResource(resource.getRootPath());
>                                cms.chtype(resource.getRootPath(),
>                                        articleResourceTypeId);
>                            cms.unlockResource(resource.getRootPath());
>
> I am not sure if the lock is required for the chtype operation. I run 
> other operations at the same time for which the lock is required.
>
> Best regards,
> Christoph
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please 
> visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>

-- 
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke




More information about the opencms-dev mailing list