3

I need to publish a particular info page from each publication (over 250 publications) to a single folder on the file system.

Although page content is different, all pages have the same name so my idea was to use the storage extension to "rename" the pages (based on publication they are coming from) and save these pages to a single folder in alternative location.

I created storage extension and overridden create, update and remove methods. In the create I have changed "relativepath" and page is created in the new folder. But, in the broker DB in the pages table, original location is stored, which is causing problems with remove (when page is unpublished).

Where can I override adding of page info to Broker DB?

2
  • Did you try calling the super.create method in the overridden create method after the name change instead of calling it in the first line? The super.create method is actually responsible for the default behaviour (in your case storing in the broker DB) Aug 17, 2015 at 12:37
  • Hi @PankajGaur, this is the first thing i tried, to pass the new name/path to the super call, and it properly creates file with a new name on the new path, but it seems that super call and passed parameters have no effect on the broker db entry Aug 20, 2015 at 14:58

3 Answers 3

2

I've just been having this same discussion with some colleagues for a requirement they have. Here's the approach we (that's the Royal 'We' - by which I mean 'they') are looking into:

  • We have a page (essentially a dummy page).
  • The TBB generates the stream of output (a SASS JSON setup for AD, JSON config settings for DXA).
  • Then the TBB writes this out as a binary - which can be any filename (e.g. original + last element of Publication Publish Path).

PLUS

  • We use something similar for this client already - in creating a number of SASS files that are put to listening folders for SASS compilation.
  • DXA uses a very similar pattern for config output
  • No Page localization (this is a big plus here)
  • Continue to use the CD Storage config for file placement (if this then changes it's a config change, not a code/deploy challenge)

Not so PLUS

  • Same as the SASS solution we have in place - the output/file is hidden from the editor but these are technical files anyway and the editor role in publish only
  • If memory serves me well - you can't unpublish these files directly (that needs research)
1
  • Also, consider implications if you have a language variant - you may need to append en/es/fr etc. somewhere in the name too. Jun 22, 2017 at 13:18
1

Would it matter if these pages were also published to their regular location as well?

Instead of trying to change the publish location of a specific page and making sure that the broker data is also updated, might it be easier to copy the page to somewhere else on deployment and delete the copy on removal?

1
  • Hi David, if modifying the original deployment/storage process doesn't produce needed results, we will probably switch to this approach Aug 20, 2015 at 15:20
0

You can use different SG path for separate publications (assuming they are all different language publications) like en_US or fr_CA as the root folder. This way you won't need to do a storage extension and it will be consistent in CME and Broker. If you just change the deployment location, you can't change in Broker DB AFAIK.

Update

Since you want to just rename the pages, you can write an event system code to change the page name and use publication name in the pagename. This will mean you have to write a utility to change the pagename for all existing pages and any pages created later will use event system. Also, you can use the one time utility to change the location of the pages.

I will recommend consistency in path where pages are created and page name between CME and Broker DB, that will ensure you don't run into issues with unpublishing etc.

2
  • Hi @Vipin, unfortunately, I already have publication+root sg path that is not acceptable for new location. My idea is to remove this path in the storage extension. Aug 14, 2015 at 10:22
  • updated answer with the other option Aug 14, 2015 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.