Dependency Management is part of the CSSDK API, so yes you can write a script to set those dependencies. However, you'll have to write something custom to read the page files (or DCRs) to figure out what it's dependent on. Meaning, there's a csFile.addAssociation(csTargetFile); but there's no csFile.refreshDependencies();
How about iw_Migrate_Dependencies.ipl? should that do it? We did run that but got a bunch of errors and didn't do anything. According the Autonomy Documentation that should do it?
I thought that was for 6.X to 7.X, so it would not apply in your case. What does find related files do ? One other thing you could try is to get latest components on a page and submit it, see if the dependencies get fixed. Long shot, but that is easy to run in a batch mode. How many pages are we talking ?
Thats how we are doing by opening the page and update components. we have around 1000 pages at least
nipper was referring to the CCPro menu option, that allows you to bulk-update pages. I'm not sure if that will update the dependencies, but it's worth a shot for sure..
Hello,
has anyone found a way to do that as a script, something more subtile than parsing the .page and finding the associated DCRs then adding manually the associations?
The Save action on a .page does that perfectly, so can we not trigger that save using Cssdk, and enforce the same backend action that is done ? By maybe change some EAs to enforce and action?
Thanks in advance to let us know if there is a solution to that thread.
Did the dependency migrate worked in your case?
Cheers
As I was curious to see if there could be another way than the CSSDK using tricks, I will reply to my own question as it could help someone out there with same issue.
The way I did it:
Removing all existing broken dependencies (this will also remove all extended attributes and Tags)
- copy through Y drive all the .pages in a temp folder (plain xml files with no EAs)
- Re-copy through to the Y drive same files from temp folder to the workarea, that will mark all pages as modified
- Change the view in Teamsite to see all modified files from site/app
- delete them all in teamsite
- submit all deleted files
- Re-copy again through to the Y drive same files from temp folder to the workarea, that will re-create the files without any broken links and no EAs
Script to automatically re-add the correct dependencies and Sitepublisher EAs
the idea here is to call for each page, the Preview and Save page URL methods
- Created a simple html file, placed on the teamsite/httpd/iw folder
- Add a simple link to a Jquery we were already having stored there too, to use Ajax features later
- Create a simple javascript, looping through an array of URLs (you can create them the way you want, you could even create a JSP page fetching all the desired .pages based on criterias you want to get your list to the client javascript. Here I kept it as a one off)
I noticed that doing a preview of the file and then saving the .page was re-applying everything we want
so I did just a small loop calling preview first, then save in this order as save won't work if you didn't preview before.
and JS code would be something like that
var previewPrefix = '<yourfulldomainserverhere>/iw-cc/command/iw.group.preview_file?vpath=';var savePrefix = '<yourfulldomainserverhere>/iw-cc/Site/Page/Edit.do?method=savePage&isTemplate=false&vpath=';var pages = [...list of pages vpath...];pages.forEach(function(page) { $.get(previewPrefix + page).done(function() { console.log("Preview " + page); $.get(savePrefix + page).done(function() { console.log("Save " + page); }); });});
you run that and all your associations are back as they should.
I'm sure you could probably bypass the annoying step of page deletion/submit that removes the broken ones. I tried couple of other ways, broken links were remaining if not submitting the deletion to Staging.
Happy to hear if others found some fun ways to deal with that, without CSSDK