1 Reply Latest reply on Aug 13, 2012 2:10 AM by seboehs

    How to implement a simple paragraph system in CQ




      I have some problems in implementing a paragraph system in CQ.


      I have to implement it in CQ 4.2.


      Does any one explain it to me in simple words?


      Thanks a lot in advance, Seboeh

        • 1. Re: How to implement a simple paragraph system in CQ
          seboehs Level 1

          I found the solution.


          I could implement a paragraph system now.


          I shortly describe the most important things.



          1. the spooler script should not have any carriage return

          2. for a component the spooling works only with following link.

          <img src='<% cc.getPage().getHandle() + ".spool." + cc.getQualident() + ".jsp" %>' width=200px>
          Further on, in the "Component Definitions" for this script only "spool" should be written as globbing. Not "*spool" or "spool*".

          This is also the reason, why we have cc.getQualident() after spool in the img-tag.


          3. Further on it is important for a paragraph system to include the following initialization.


          Style actstyle = null;


          <cfc:initComponent cellId="body" componentId="/libs/Components/body">

          <% actstyle = componentContext.getStyle(); %>


          <cfc:includeComponent cellId="body" componentId="/libs/Components/body" />



          <cfc:includeComponent cellId="parsys"

                                  componentId="/apps/emb/Components/parsys" />


          4. in side the spooler script, you get the atom by:

                                  String[] selectors = cqReq.getSelectors();

                                  String qualident = selectors[1] + "." + selectors[2];

                                  Container local = (Container) actpage.getElement(qualident);

                                Atom atom = local.getAtom("myImageSrc");

          where "myImageSrc" is the atom.xml content definition.

          The selcorts[2] is either "Single" or somthing like "parsys.0001".


          5. In simple components, you need also this kind of code to initialize a edit bar.


          ComponentContext cc = (ComponentContext) request.getAttribute("componentContext");

          ComponentInfo ci = cc.getComponentInfo();




                                  parName="<%= cc.getContainerList() %>"

                                  parNum="<%= cc.getContainerLabel() %>"

                                  storagePre="<%= cc.getStoragePre() %>"

                                  dialogAny="<%= ci.getContentDialog() %>"



          I hope this could help you creating the paragraph system.
          Kind regards, Seboeh@web.de