[opencms-dev] What is more permanent, Path to resource, Structure UUID or Resource UUID?
Paul-Inge Flakstad
paulflakstad at gmail.com
Tue Jan 31 13:42:01 CET 2017
Hi Asger,
You didn't mention the permalink, which is a good candidate – it's
basically a kind of UUID, viewable via [right click file] -> Advanced ->
Availability
In code, you can use the getPermalink method(s) in
org.opencms.staticexport.CmsLinkManager, e.g.
org.opencms.main.OpenCms.getLinkManager().getPermalink[...]
The permalink should never change. (At least this is the case for XML
content, a.k.a. structured content. Not 100% sure about detail content, but
I suppose so.)
Alternatively, you could use the structure or resource ID, which is unique
per sibling / shared by all siblings (respectively). Both should survive a
file rename.
Or you can bind by path/URI. This will allow replacing existing files with
new ones, and it's easier to make looser bindings – i.e. EXT-SYS-entry-A
has an implicit tie to /opencms/resource/for/entry/A – but as you already
pointed out, it *might* be too likely to break.
Hope this helps! :)
Cheers,
Paul
On Tue, Jan 31, 2017 at 10:30 AM, Asger K. Jensen <akj at tmnet.dk> wrote:
> Hi,
>
>
>
> I am building a system to allow an external e-commerce system to link /
> fetch resources from OpenCMS.
>
>
>
> I would like to know what the best identifier to store in the external
> system would be. My intuition tells me it should be the Structure UUID, but
>
> I am not sure if this identifier gets changed under certain circumstances
> (moving a page, renaming a page, etc etc).
>
>
>
> So, right now my candidates are either
>
>
>
> - Root Path to content (/sites/default/etc/etc/etc/etc) – will
> certainly break if user renames item, or moves it.
>
> - Structure UUID
>
> - Resource UUID (which I presume is a reference to the **physical
> content** rather than the **logical content**, correct?
>
>
>
> Hope someone can offer up some insights.
>
>
>
> Thanks in advance
>
>
> Med venlig hilsen/Best Regards
>
> *Asger Jensen*
> Head of Production
>
> E-mail: akj at tmnet.dk
> Mobile: +45 2630 6502 <+45%2026%2030%2065%2002>
>
>
> Theilgaard Mortensen A/S
> Niels Hemmingsens Gade 9
> 1153 København K | Denmark
> +45 3344 8555 <+45%2033%2044%2085%2055> | www.tmnet.dk
>
>
>
> _______________________________________________
> 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
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20170131/e52a3ea6/attachment.htm>
More information about the opencms-dev
mailing list