5 Replies Latest reply: Oct 11, 2012 10:34 AM by Dolf Dijkstra-Oracle RSS

    Publishing from management syatem to Delivery system by Custom Code.

    ar*918953*su
      Hi,
      We have a requirement to publish one asset and it's associated pages and template to delivery system from management system from our custom JAVA code. Currently I am using ICS.mirror() API from my custom REST resource. But it's only publishing that particular asset alongwith it's page where the asset is associated but it doesn't publish the template of the page through which it get's rendered. Can you please give some idea about how to publish all the related template so that we can view the page in delibery system as well.

      Can we invoke any out of box CSElement which does the publishing in fatwire/webcenter sites from my code ? If yes then that can also fulfil my requirement. Please let me know the CSElement name which I need to call.

      Thanks,
      Krishnendu

      Edited by: Arijit Basu on Oct 9, 2012 11:03 PM
        • 1. Re: Publishing from management syatem to Delivery system by Custom Code.
          Dolf Dijkstra-Oracle
          Krishnendu,

          What you are trying to do will not work for several reasons:
          - you cannot miiror assets, you need to publish them
          - you cannot publish assets without approving them
          - there is not OOTB REST support for publishing and approving

          Mirroring is used to copyl database rows (and associated files from url columns) from one server to the other.

          To approve your asset the easiest way (probably) is to call the ApproveAssets element (you need to look for the complete path, don't know it from the top of my head). In your code you would need to handle the responses, this might be a real challenge.
          To publish you would need to call PublishApproveAssets to create a publish session.
          You can call these elements by using ics.CallElement. Using that method from a custom REST service might be not possible. I just don't know. What will work if you would create a CSElement and a SiteEntry and have your client call those over http. Bu in that case you can't use the auto generate jersey client.

          Now, if we take one step back: what is the underlying requirement that drives you to puiblish the asset programatically?

          Dolf
          • 2. Re: Publishing from management syatem to Delivery system by Custom Code.
            ar*918953*su
            Thanks Dolf for your reply.

            I have already tried with ICS.CallElement("CustomPublishApproveAsset") which is publishing only the approved asset but it couldn't publish any pages where this asset is associated or where it has some dependency. Can you please throw some light on this?

            And I also need the API ICS.CallElement("ApproveAssets") to approve all the assets with it's dependency.

            N.B: CustomPublishApproveAsset is my custom element taking the same code from PublishApprovedAssets.

            Thanks,
            Krishnendu
            • 3. Re: Publishing from management syatem to Delivery system by Custom Code.
              Dolf Dijkstra-Oracle
              Approval works the other way around: it blocks the publishing of assets that have references to assets that are not published. In your case the Page would be blocked if it would reference the article. The article does not know on which page it will show up as it is the page that is looking up the article. On your case you would need to approve the Page too. Not knowing what pages to approve might be a challenge. The larger question is probably: why do you need to approve/publish a page when you insert an article?

              The ApproveAssets element has a recursive option, you may need to call it several times. This is not the easiest part of the product to mock around with, be carefull.

              What is your underlying business requirement?

              Dolf
              • 4. Re: Publishing from management syatem to Delivery system by Custom Code.
                ar*918953*su
                Hi Dolf,

                I have one custom basic asset type 'DMPContent'. I have few asset(say asset1) of type DMPContent Now let's say we have one page 'TestPage' where I have associated one asset(asset1) of type DMPContent. Now while I am trying to publish the asset(i.e asset1) it should also publish the page TestPage along with asset1. And also the template which I need to render the asset that needs to be published - this is our requirement.

                Please suggest some solution in this.

                Thanks,
                Krishnendu
                • 5. Re: Publishing from management syatem to Delivery system by Custom Code.
                  Dolf Dijkstra-Oracle
                  You will need approve your page and template too. For sites it is ok to publish asset1 without the page and the template as the asset can be used on another page or migth be retrieved via sql or a search.

                  Dolf