How List all assets (of a type) from Webcenter Sites

2.4k Views Asked by At

I want print or export all Pages that haven't fill a concrete attribute, but I want make a "debug" CSElement that print all elements of indicate type (in this case -> Page) with all attributes, any can help me with this?

3

There are 3 best solutions below

0
On BEST ANSWER

You can query the table Page and PageAttribute to get what you want. Use tag ics:sql like this for example:

 <%
 String your_query = "select * from Page,PageAttribute";
 String result_list= "";
 %>
 <ics:sql sql='<%= your_query %>' table="Page,PageAttribute" listname="result_list"/> 

 <ics:if condition='<%=ics.GetList("result_list")!=null && ics.GetList("result_list").hasData()%>'><ics:then>
        <ics:listloop listname="result_list">
              <ics:listget listname="result_list" fieldname="name" output="result"/>
              <% result_list+= " '"+ics.GetVar("result")+"' ,"; %>
        </ics:listloop>
</ics:then></ics:if>
1
On

You can use the below code to get all details of the asset. click here for code load the asset by using asset load tag scatter the asset by using Enumeration you can get all the details of that asset. you can find the detail code in attached image.

0
On

Although this question is answered, but I will suggest to use WebCenter Sites tag or Asset API to fetch values. To get all attributes for an asset, check the following blog post: http://fatwirecode.blogspot.in/2015/07/get-full-asset-details.html

Furthermore, if you want to restrict, then may be you can first find all Page assets using SQL as mentioned, then loop through each pages and then use the tag or asset api as mentioned in above link to display all info.