Quantcast
Channel: Adobe Community : Popular Discussions - CQ5 (read only)
Viewing all articles
Browse latest Browse all 12476

Can any one explain the below code flow?

$
0
0

Can any one explain the below code flow?

 

I am doing this example by property predication..

 

Especially can any one give me the description to below points,

 

1)CQ.shared.XSS.getXSSValue() method

2).As an argument of above method "values.meta(..)" what's happening here, What is 'values' here?

3).Where is the CSS classes will be placed.

4). articles are my child nodes I am able to access and display child nodes information but I am unable to access parent node details while displaying child nodes info. Can any one suggest me How to perform node traversing to access all nodes information available in a package.

 

 

Below is the code snippet,

 

<script type="text/javascript">

 

    CQ.Ext.onLoad(function() {

        var config = {

            "xtype": "dataviewlens",

            "text": "<%= xssAPI.encodeForJSString(name) %>",

            "renderButtonTo": "lens-list-button-wrapper-<%= time %>",

            "overflow": "visible",

            "proxyConfig": {

                "url": "/bin/wcm/contentfinder/view.json/content/dam"

            },

            "storeConfig": {

                "baseParams": {

                    "mimeType": "image"

                }

            },

            "items": {

                "cls": "lens-dataview list",

                "tpl":

                    '<table><tbody>' +

                        '<tpl for=".">' +

                            '<tr class="item" ' +

                                ' ondblclick="CQ.search.Util.resultDblClick(event, \'{[CQ.shared.XSS.getXSSValue(values.id)]}\',\'{[CQ.shared.XSS.getXSSValue(values.path)]} \');"' +

                                ' qtip="{[CQ.shared.XSS.getXSSValue(values.shortPath)]}<br/>' +

                                '{[CQ.shared.XSS.getXSSValue(values.name)]}"' +

                                '>' +

                                '<td class="format-cell"><div>{[CQ.shared.XSS.getXSSValue(values.meta["zno:articleTitle"] ? values.meta["zno:articleTitle"].replace("application/", "") : "")]}</div></td>' +

 

 

                                '<td>Topic</td>' +

                                '<td><div>' +

                                    '{[values.imageDimensions ? values.imageDimensions : ""]}' +                                   

                                    // if available show mod date, otherwise creation date

                                    '{[values.modificationDate ? ' +

                                            '"<%= xssAPI.encodeForJSString(xssAPI.encodeForHTML(textModified)) %> " + values.modificationDate.format("<%= xssAPI.encodeForJSString(dateFormat) %>") + "<br/>"' +

                                        ':' +

                                            'values.creationDate ? ' +

                                                    '"<%= xssAPI.encodeForJSString(xssAPI.encodeForHTML(textCreated)) %> " + values.creationDate.format("<%= xssAPI.encodeForJSString(dateFormat) %>") + "<br/>"' +

                                                ':' +

                                            '""]}' +

                                '</div></td>' +                               

                            '</tr>' + 

                            '<tr>'+'<td class="format-cell"><div>Page :{[CQ.shared.XSS.getXSSValue(values.meta["zno:articleStartingPage"] ? values.meta["zno:articleStartingPage"].replace("application/", "") : "")]}</div></td>' +'</tr>'+

 

                        '</tpl>' +                                              

                    '</tbody></table>',

                "itemSelector": ".item"

            },

            "listeners": {

                "afterlayout": function() {

                    var el = this.body || this.el;

                    if(el){

                        el.setOverflow("visible");

                    }

                }

            }

        };

        var lens = CQ.Util.build(config);

        CQ.search.Util.addLens(lens, "list");

    });

</script>


Viewing all articles
Browse latest Browse all 12476

Trending Articles