10 Replies Latest reply on Jan 30, 2013 10:36 AM by EbodaWill

    Customization - Additional column inserted in Inbox - value not rendered

    EbodaWill Level 1

      Hello,

       

         I have a requirement for customizing the inbox and populating the new inbox column with additional value. I made coding updates and everything looks good but the inbox does not render the new value at all. I made these updates and overrides.

       

       

      1. Added the column name and value in \apps\cq\workflow\components\inbox\list\json.jsp . When I go to http://localhost:4502/libs/cq/workflow/content/inbox/list.json?_dc=1358787785033&start=0&l imit=40, I am able to see the addition variable and value added and displayed in list.json. For e.g. view of list.json

       

                 "payloadPath": "/content/dam/geometrixx-outdoors/articles/a-simple-plan.jpg",

                 "payloadPath_xss": "/content/dam/geometrixx-outdoors/articles/a-simple-plan.jpg",

                 "payloadSummary": {

              "lifestage": "Authored",

                 "payloadTitle": "a-simple-plan.jpg",

                 "payloadType": "dam:Asset",

       

         2.  Override and updated \apps\cq\workflow\extensions\inbox\cols. Added a new column, lifestage.js. Code in that js file is

               

      {

          "header":CQ.I18n.getMessage("LifecycleStage"),

          dataIndex:"lifestage",

          ranking:30

      }

       

          3. The inbox/list.json shows the value lifestage correctly. But still it doesnot populate 'lifestage' value in the inbox column. If I replace the dataIndex:"lifestage" with dataIndex:"currentassignee" or any other thing, the Lifestage column in Inbox is populated with the "CurrentAssignee".

       

      Why is the lifestage value though visible through list.json not visible in Lifestage column? What else needs to be additionally done?

       

      Thanks,

        • 1. Re: Customization - Additional column inserted in Inbox - value not rendered
          Jörg Hoh Adobe Employee

          I used this code to add a new column to the inbox (just a sample, either outputs "DAM" or "page", depending on the path of the payload). If I see it correctly, you need to implement the renderer function appropriately and compute your dataIndex field accordingly (in your case it could be a simple pass-through).

           

          {
              header: CQ.I18n.getMessage("Type"),
              dataIndex: "contentType",
              width:50,
              ranking:31,
              renderer: function (value, p, record) {
                          var contentTypeTpl = new CQ.Ext.XTemplate(
                  '<div class="playload-summary">',
                       '<div class="payload-summary-description"> {contentType} </div>',
                  '</div>');
                  contentTypeTpl.compile();
                      var path = record.get ("payloadPath");
                      var display = "Page";
                      if (path.match ("^\/content\/dam")) {
                          display = "DAM";
                      }
                      return contentTypeTpl.apply ({
                          "contentType": display,
                      });
                 
                  },
          }

           

          Jörg

          • 2. Re: Customization - Additional column inserted in Inbox - value not rendered
            EbodaWill Level 1

            Yes I tried that. But in my implementation

            record.get ("lifestage"); returns undefined.

            Do you know how or where the record gets created? Is there any dataset declaration in record where I need to add it so that I can receive lifestage from record?

            • 3. Re: Customization - Additional column inserted in Inbox - value not rendered
              Jörg Hoh Adobe Employee

              I don't too much of the details any more, I did that for CQ 5.4 a year ago (shouldn't have changed for 5.5). A very good example is /libs/cq/workflow/extensions/inbox/cols/status.js, there you see a more complex render function.

               

              Anyhow, I don't think that the dataindex field has any meaning in terms of picking the data, if you provide a proper render function.

              • 4. Re: Customization - Additional column inserted in Inbox - value not rendered
                EbodaWill Level 1

                Thanks for your response! I looked at the status.js.

                 

                For some reason, lifestage value doesnot get populated in the record. So I can not read it here and doesnot get displayed in inbox.

                 

                I will keep looking and update the post if find something.

                • 5. Re: Customization - Additional column inserted in Inbox - value not rendered
                  Sham HC Level 7

                  Hi EbodaWill,

                   

                  Defining a template and applying renderer method is missing.   For your use case following are the additional things done to get it working.

                   

                  *     At [1](please overlay)  modified as attached in image to define template and renderer logic.

                  *     At [2] modified to use the method defined in step1. The entire content at [3].

                   

                  [1]    /libs/cq/workflow/widgets/source/utils/InboxUtil.js

                  Logic.png

                   

                  [2]   /apps/cq/workflow/extensions/inbox/cols/lifestage.js

                   

                  [3]

                  {

                      "header":CQ.I18n.getMessage("LifecycleStage"),

                      dataIndex:"lifestage",

                      renderer: CQ.workflow.InboxUtil.renderLifestage,

                      ranking:30

                  }

                   

                   

                  Thanks,

                  Sham

                  • 6. Re: Customization - Additional column inserted in Inbox - value not rendered
                    EbodaWill Level 1

                    Sham,

                     

                         I  followed exactly all steps like you mentioned. The value was not rendered. I put the alert messages. Please see the code below.

                     

                    As lifestage is not subpart of payloadSummary, tried both record.get("lifestage") and (record.get("payloadSummary").lifestage but still both alerts shows undefined.I see alerts for 'Inside renderlifestage' but the next alert shows 'undefined'.

                     

                      renderLifestage: function(value, p, record) {

                                alert('Inside renderlifestage');

                                alert(record.get("payloadSummary").lifestage);

                                alert(record.get("lifestage"));

                                return lifestageTpl.apply({

                                   "lifestage": record.get("payloadSummary").lifestage

                                });

                            },

                     

                    Here is the output from inbox/list.json

                    {

                          "item": "/etc/workflow/instances/2013-01-22/model_360104180212070/workItems/node4_etc_workflow_in stances_2013-01-22_model_360104180212070",

                          "title": "Authorship Workflow",

                          "description": "Select author for the authorship workflow.",

                          "dialog": "/apps/lexmark/dialog/authorshipDueDateDialog",

                          "participant": "",

                          "currentAssignee": "Administrator",

                          "startTime": 1358880950665,

                          "metaData": {

                            "workItem": {

                              "historyEntryPath": "/etc/workflow/instances/2013-01-22/model_360104180212070/history/1358880950664"

                            },

                            "instance": {

                              "currentJobs": "",

                              "currentJobs_xss": "",

                              "workflowTitle": "authorship_workflow_test",

                              "workflowTitle_xss": "authorship_workflow_test",

                              "startComment": "authorship_workflow_test",

                              "startComment_xss": "authorship_workflow_test"

                            }

                          },

                          "payload": "/damadmin.html#/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg",

                          "payload_xss": "/damadmin.html#/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg",

                          "payloadPath": "/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg",

                          "payloadPath_xss": "/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg",

                          "payloadSummary": {

                            "icon": "/content/dam/geometrixx-outdoors/articles/downhill-ski-conditioning.jpg/jcr:content/rend itions/cq5dam.thumbnail.48.48.png"

                          },

                          "lifestage": "Authored",

                          "payloadTitle": "downhill-ski-conditioning.jpg",

                          "payloadType": "dam:Asset",

                          "lastModifiedBy": "admin",

                          "lastModified": 1323947520464,

                          "lockedBy": "",

                          "lockedBy": "",

                          "timeUntilValid": 0,

                          "onTime": 0,

                          "offTime": 0,

                          "monthlyHits": 0,

                          "replication": {

                            "numQueued": 0,

                            "publishedBy": null

                          },

                          "scheduledTasks": [

                          ],

                          "inWorkflow": true,

                          "workflows": [{

                              "model": "Authorship_Workflow",

                              "started": 1358880950439,

                              "startedBy": "admin",

                              "suspended": false,

                              "workItems": [{

                                  "item": "Authorship Workflow",

                                  "assignee": "admin"

                                }

                              ]

                            }

                          ],

                          "scheduledTasks": [

                          ],

                          "comment": "authorship_workflow_test",

                          "workflowTitle": "authorship_workflow_test",

                         },

                    • 7. Re: Customization - Additional column inserted in Inbox - value not rendered
                      Sham HC Level 7

                      Hi EbodaWill,

                       

                          Make a friend with firebug breakpoint you can find answer yourself.  From your earlier post it indicates lifestage part of payloadSummary.  Now it seems just part of json. Try with [1]. Attaching copy of the package for your reference [2] inboxextensionsample-1.zip.

                       

                      [1]   record.json.lifestage

                       

                      [2]    https://sendnow.acrobat.com/?i=Gqmd9Nj7*qovFi6C8jNWgw

                       

                      Thanks,

                      Sham

                      • 8. Re: Customization - Additional column inserted in Inbox - value not rendered
                        EbodaWill Level 1

                        It worked! Thanks Sham for your detailed response.! In my existing code I replaced record.get("lifestage"); record.json.lifestage; and it worked. Do you know why record.get("lifestage") should not render the value where as render.json.lifestage does render it correctly?

                        • 9. Re: Customization - Additional column inserted in Inbox - value not rendered
                          Sham HC Level 7

                          If you want to be part of record, define lifestage at inbox list reader [1].

                           

                          [1]   /libs/cq/workflow/widgets/source/widgets/Inbox.List.js

                          1 person found this helpful
                          • 10. Re: Customization - Additional column inserted in Inbox - value not rendered
                            EbodaWill Level 1

                            A bigger thankyou for sharing this information Sham! This is the only information that I was looking from the start but as could not find it, I was messing up with my code(overlaying different files and removing them) and also writing lifestage variable at different places in an attempt to make it work. I could not find this particular piece of info in any documentation and using the Query option in crxde also did not show this js file in any way. I was  searching where this reader was but could not find it by myself.

                             

                            Sincere thanks once again for your assitance and consistency in contributing to this discussion till the resolution was made.