Export Relationships and Image Paths

9 views
Skip to first unread message

Lex Medeiros

unread,
Dec 27, 2017, 11:55:01 PM12/27/17
to dot...@googlegroups.com
Hi,

I am upgrading the last remains of legacy files of our dotcms instance.

Is there a way to "export" the relationships of a structure so I can "import them again?

Also, is there a way to "export" all the image field logical paths that a structure has so I can import them back again?

Thanks,

Alex

Chris Falzone

unread,
Dec 28, 2017, 9:23:44 AM12/28/17
to dot...@googlegroups.com
There is no export specifically, but you can use $dotcontent.pullRelated to pull the related content:
 https://dotcms.com/docs/latest/pull-and-display-related-content
From that you can construct your own export of sorts just outputting json or csv as you need.  
I think if you are constructing from the REST API you need to construct the query for it:
 +ContentType:ChildContentType +RelationshipName:$parentCon.identifier
Or the other way around:
+ContentType:ParentContentType +RelationshipName:$childCon.identifier

You can get whatever pathing you need from the content pull.  FileAssetMap has various methods:  
(that's what you get from the content pull)
I think you want either $con.ImageField.getUri() or $con.ImageField.getPath()

Hope that helps get what you need.


--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CABzdpQkWWRvNiL-NcwbDO7bo3ZF9Hz%2BRdutPj%3DE4sLJWB3cHdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Jason Tesser

unread,
Dec 28, 2017, 9:42:00 AM12/28/17
to dot...@googlegroups.com
For the relationships 

So you can use webdav to get the files in.  Then update via the Import/Export functionality. 

Lex Medeiros

unread,
Dec 28, 2017, 10:00:20 AM12/28/17
to dot...@googlegroups.com
Thank you Jason and Chris!

Is there a way to pull all legacy files in a dotcms instance?

I still have files since 1.9 so I would like to pull all legacy files, replace them and update to the latest dotcms version.

Alex

To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+unsubscribe@googlegroups.com.

To post to this group, send email to dot...@googlegroups.com.

Chris Falzone

unread,
Dec 28, 2017, 11:22:08 AM12/28/17
to dot...@googlegroups.com
There *used to be* a JSP in the distro to do this for you. you could use that or use it as a reference on how to look them up, but the only way I know is to use the API.
See:





To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.

To post to this group, send email to dot...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages