[opencms-dev] when links are moving

Johnny Xue | SYSVISION johnny.xue at sysvision.com
Mon Jun 15 08:32:16 CEST 2009


Hi, actually you can find answer in class org.opencms.relations.CmsLink,
check the method "checkConsistency(CmsObject cms)".

It looks up structure_id (UUID) firstly, and then will looks up "target"
path if fail to look up UUID.
I think "target" will also use for other purpose, such as filter
(CmsRelationFilter)



Mathias Lin | SYSVISION wrote:
> 
> I am wondering, what is the purpose of the "target" tag in an URI? 
> Like in this example, where the attachment is part of a structured content
> element, let's say the file is named test.html:
> 
> <Attachment>
>       <URI>
>         <link internal="true" type="WEAK">
>          
> <target><![CDATA[/sites/com.company.www/_test/downloads/abc.pdf]]></target>
>           <uuid>072408c8-4dcd-11de-a07e-00304895511a</uuid>
>         </link>
>       </URI>
> </Attachment>
> 
> It seems that the path to the document isn't actually read from the value
> of the "target" tag but looked up from somewhere else using the UUID as
> parameter?
> 
> Because I found that when I move the abc.pdf to another folder, the value
> in the "target" tag of the attachment in my test.html is not updated
> automatically. But when I open the test.html in the browser and have the
> attachment being displayed, the link is displayed correctly.
> 
> For example, if I would move the abc.pdf up one folder level and out of
> the downloads folder to /sites/com.company.www/_test/abc.pdf, the target
> value in my test.html control code still remains
> /sites/com.company.www/_test/downloads/abc.pdf, but when viewing the page
> in the browser, it will link to the abc.pdf correctly with
> /sites/com.company.www/_test/abc.pdf
> (Only when I would open test.html in the editor, then save, the target
> value would update to the right URL).
> 
> So actually everything works fine here, but I am just wondering about the
> purpose of the "target" tag then? I also found that I cannot edit the
> target value in the control code - when I do, it will always be reverted
> to the previous value after I save.
> 
> 
> 


-----
Johnny Xue
SYSVISION Ltd., China
http://www.sysvision.com
-- 
View this message in context: http://www.nabble.com/when-links-are-moving-tp23883650p24029407.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list