[opencms-dev] Change relations in resources

Paul-Inge Flakstad flakstad at npolar.no
Fri Nov 16 12:27:46 CET 2012


Hi Antonio, 

Glad to hear you found a solution :)

Just to flesh it out a bit more, here's another example, demonstrating the setStringValue method: 
http://www.opencms-wiki.org/wiki/Modify_file_content_programatically

Cheers,
Paul

-----Original Message-----
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Antonio Cordeddu
Sent: 16. november 2012 10:06
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Change relations in resources

I found the solution.

I describe it for anyone who will have the same issue:

browse the xml document (a good example could be found at http://www.opencms-wiki.org/wiki/Reading_various_information_about_a_resource),
retrieve the element you have to change and finally use the method elementValue.setStringValue(CmsObject cms, String value) to set the new value.

Regards
Antonio Cordeddu



On 14/11/2012 16.51, Antonio Cordeddu wrote:
>
> I need to change the targets of relation in many resources: the old 
> target and new target differ only for the path.
> So I tried with Search Management - Source Search and Replace tool; 
> the report show me a successful result  but the change doesn't happen.
> I think OpenCms, after the change,  uses the UUID of the old target 
> and comes back to it.
>
> I think I have to write the code to get my goal. Does anyone 
> approached the same issue?
> Could you suggest me the best way to do it?
>
> Thanks
> Antonio Cordeddu
>
>
>
> _______________________________________
> Coranto informatica di Antonio Cordeddu antoniocordeddu at coranto.it
> Skype: antonio.cordeddu
> http://www.coranto.it
> ___________________________________________
>
>
> _______________________________________________
> 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/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
>
>



_______________________________________________
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/cgi-bin/mailman/listinfo/opencms-dev






More information about the opencms-dev mailing list