2 Replies Latest reply: Dec 11, 2012 10:47 AM by Bunty RSS

    customizing hcsp file.

    879338
      Hi,
      We are creating site-studio content using contentwizard.hcsp file. We are launching https://<server-name>/cs/resources/wcm/custom/sitestudio/contentwizard/webcenter/contentwizard.hcsp?dSecurityGroup=Public&cpRegDef=REL3_UPDATE_REG_DEF&cpIframe=true

      It shows a web page, which allow us to fill content metadata. We want to customize fields of this form. Our requirement is
      1. Hide few fields
      2. Show some custom fields
      3. Default values of few custom fields

      I have created profile for above requirement but I am not sure how to trigger profile while calling this page. I tried passing xIdcProfile, dbTriggerValue but no success.
      I opened contentwizard.hcsp file and found that it only accepts very few parameter. It has idoc script like

      var dmd = '';
      [!--$if dSecurityGroup and regexMatches(dSecurityGroup, "[^'<>;]+")--]
      dmd += 'dSecurityGroup=' + '[!--$dSecurityGroup--]'
      [!--$endif--]
      [!--$if dDocType and regexMatches(dDocType, "[^'<>;]+")--]
      dmd += '&dDocType=' + '[!--$dDocType--]'
      [!--$endif--]
      [!--$if xCollectionID and regexMatches(xCollectionID, "[0-9]+")--]
      dmd += '&xCollectionID=' + '[!--$xCollectionID--]'
      [!--$endif--]

      I want to add more parameters here. I changed it to pick xIdcProfile, dpTriggerValue as
      var dmd = '';
      [!--$if dSecurityGroup and regexMatches(dSecurityGroup, "[^'<>;]+")--]
      dmd += 'dSecurityGroup=' + '[!--$dSecurityGroup--]'
      [!--$endif--]
      [!--$if dDocType and regexMatches(dDocType, "[^'<>;]+")--]
      dmd += '&dDocType=' + '[!--$dDocType--]'
      [!--$endif--]
      [!--$if xCollectionID and regexMatches(xCollectionID, "[0-9]+")--]
      dmd += '&xCollectionID=' + '[!--$xCollectionID--]'
      [!--$endif--]
      [!--$if xIdcProfile and regexMatches(xIdcProfile, "[^'<>;]+")--]
      dmd += '&xIdcProfile=' + '[!--$xIdcProfile--]'
      [!--$if dpTriggerValue and regexMatches(dpTriggerValue, "[^'<>;]+")--]
      dmd += '&dpTriggerValue=' + '[!--$dpTriggerValue--]'
      [!--$endif--]

      But still when I launch contentwizard.hcsp, it does not pick values of xIdcProfile from url parameter. Is there anything other than this I need to do.

      I am new to customization of hcsp so it would be great if I can get a document, which describes how to customize hcsp files.
      Few of my questions are.
      1. How can I debug hcsp code?
      2. Is there any way to print variable values in log?
      3. After changing file should I restart the UCM server. I restarted UCM server in above case but still it does not pick my changes.

      Thanks
      Sanjeev.
        • 1. Re: customizing hcsp file.
          Jiri.Machotka-Oracle
          Sanjeev,

          I'd recommend you to get a copy of this book http://www.amazon.com/Definitive-Stellent-Content-Server-Development/dp/1590596846
          You could also take a training Customizing Content Server by Oracle University.
          Chapters 2-5 explain what you need to know - it is a bit too much for a forum post, but in a nutshell: when you get familiar with idocScript you will understand that your script contains hardcoded list of metadata. If you want to use profiles you will have to redesign it to use includes used in check-in form template. Alternatively, you could hardcode logic of your profile to your script.

          Either way, you will need to study a bit to get the basics (at least!)
          • 2. Re: customizing hcsp file.
            Bunty
            here is my reply for second part of your query..

            1. How can I debug hcsp code?
            a. throw some javascript alerts. (or)
            b. print to trace and view it in System output
            2. Is there any way to print variable values in log?
            <!--$trace("your text " & variable ,"#console","<any value from active section in system audit page...like applet, workflow...>")-->
            to view the output...you need ot save the active section with the above value and access your test page.
            3. After changing file should I restart the UCM server. I restarted UCM server in above case but still it does not pick my changes.
            - as far as I know, modifying hcsp files do not need a restart but, the code is effective only when the hcsp content item is released.

            Edited by: Bunty on Dec 11, 2012 8:47 AM