Forum Stats

  • 3,875,708 Users
  • 2,266,953 Discussions
  • 7,912,310 Comments

Discussions

Content presenter template - Multiple items

User_QUFP4
User_QUFP4 Member Posts: 176 Red Ribbon
edited Apr 17, 2018 12:34AM in WebCenter Portal

Hello,

I am trying to create Content presenter template for multiple content items for WCP 12c.

The below code works - It is listing out all the content items in a folder. (Including Documents and Folder)

But when I click on the folder hyperlink, I'm not getting the folder contents instead I am getting the same page.

   <dt:contentListTemplateDef var="nodes">

      <af:panelGroupLayout layout="scroll"    id="nodeListPanel"   valign="middle"

                           rendered="#{not empty nodes}">

          <af:iterator rows="0" var="node" varStatus="iterator"    value="#{nodes}"     id="it0" >

       <dt:contentTemplate node="#{node}"

                                view="oracle.webcenter.content.templates.default.list.item"

                                nodesHint="#{nodes}"

                                id="ct0"/>

          </af:iterator>

</af:panelGroupLayout>

</dt:contentListTemplateDef>

I saw #{node.isFolder} returns a boolen value if the node is a folder.. but I am not sure how to use it here. Please advise.

Thanks as always!

Best Answer

«13

Answers

  • User_QUFP4
    User_QUFP4 Member Posts: 176 Red Ribbon
    edited Apr 5, 2018 4:23PM

    Adding to this, tried the below code -

       <af:iterator rows="0" var="node" varStatus="iterator"

                          value="#{nodes}"

                          id="it0" >

                    <af:link text="#{node.isFolder   ? node.name : node.propertyMap['dDocTitle'].value}" id="l1"

                    destination = "#{node.isFolder ? ' '    : node.url.renderUrl}"/>

                  

            </af:iterator>

    In the list of folder contents, including both documents and a sub-folder.. I could open all the documents..

    I do not know the EL to retrieve the sub-folder contents. Please help..

  • Dinil Mithra
    Dinil Mithra Member Posts: 351 Bronze Badge
    edited Apr 7, 2018 9:22AM

    Hello User,

    Can you try Content manager instead of Content presenter? 

    Kind Regards,

    DM

  • User_QUFP4
    User_QUFP4 Member Posts: 176 Red Ribbon
    edited Apr 8, 2018 8:55PM

    Thanks a lot for your reply!

    I tried to use Content manager in my page instead of content presenter.

    But how do I customize the content manager..

    Because I do not want the user to upload any documents into the library and just I would have to display the folder structure..

    Thanks as always!

  • Daniel Merchán
    Daniel Merchán Enterprise Achitect Member Posts: 2,192 Gold Trophy
    edited Apr 9, 2018 3:47AM

    Hi.

    If you want to achieve it by using Content Presenter only then you can rely on the legacy cmfn tag library. It is still working in 12c, but I do not know for how long it is going to be supported.

    It contains useful operations such as getNodeById, getNodeByPath or searchNodes capabilities using CMIS Queries.

    Sample code of a search

    xmlns:cmfn="http://xmlns.oracle.com/webcenter/content/functions"<af:iterator rows="4" var="node" varStatus="iterator" value="#{nodes}"                                                        id="it0">                                                <c:set var="searchExpression"                                                      value="SELECT * FROM cmis:document WHERE IN_TREE('/WebCenterSpaces-ucm/IDC:Folder/${node.propertyMap['fFolderGUID'].value}')"/>                                                <c:set var="myNodes"                                                      value="#{cmfn:searchNodes('WebCenterSpaces-ucm',searchExpression,1)}"/>                                                <div class="hero-main" style="cursor: pointer; max-width:50%;"                                                    onclick="window.location='/webcenter/portal/myportal/pages_internal/imagegallerydetail?xparentfolders=${node.propertyMap['fFolderGUID'].value}';">                                                    <div class="main-img"                                                        style="background-image: url('#{myNodes[0].renditionsMap['web:url']}')"/>                                                    <div class="main-overlay"/>                                                    <div class="main-title">${node.propertyMap['fFolderName'].value}</div>                                                </div>                                            </af:iterator>

    Use the information returned by your nodes of Content Presenter for making sub-queries to the subfolders if required using searchNodes.

    Note: Instead of using WebCenterSpaces-ucm as connection name use the #{documentService.defaultConnectionName} to make the connection name dynamic based on how you have configured the WCP - WCC connection.

    I hope this information helps.


    Kind regards.

    User_QUFP4
  • Daniel Merchán
    Daniel Merchán Enterprise Achitect Member Posts: 2,192 Gold Trophy
    edited Apr 9, 2018 4:00AM

    In addition to my above comment: Some old discussions about cmfn tag

    Webcenter Spaces : Content Presenter Display Template for Image Gallery

  • Dinil Mithra
    Dinil Mithra Member Posts: 351 Bronze Badge
    edited Apr 9, 2018 5:26AM

    You can hide document manager's upload button using taskflow customization or custom css. Please refer the below documentation for task flow customization details.

    http://www.oracle.com/technetwork/middleware/webcenter/learnmore/wcptaskflowcustomization12c-2994486.pdf

    Also plese let us know your WCP version

    Kind Regards,

    DM

  • Sreedhar-Oracle
    Sreedhar-Oracle Member Posts: 476 Employee
    edited Apr 9, 2018 5:53AM

    Hi,

    Please see the below document.

    How to Customize the Content Manager Task flow in WebCenter Portal 12c? (Doc ID 2331126.1) and this document mentions that there is no specific/supported documentation on customizing the "Content Manager Task Flow" in 12c.

    The below document can assist to customize the seeded Task flows in WCP 12c.

    Note: 2299942.1 Customizing Seeded Task Flows in WebCenter Portal 12c


    An Enhancement Request is already filed to address this issue:

    Bug 24815430 : Possibility to customize the Content Manager Task flow

  • User_QUFP4
    User_QUFP4 Member Posts: 176 Red Ribbon
    edited Apr 11, 2018 12:00AM

    Thanks a lot for your reply..!

    I'm still working on this.. I got the folders listed by using cmfn.searchNodes(#connection_name,searchExp,1)..

    But it is not working when I use it as a sub-query to retrieve the sub folder content items/sub sub-folders..

    I'm trying to add this to the onclick event.. because when I click the folder hyperlink, it should display the selected folder contents (including sub-folders). I am not sure if I'm using it right.. Please advise..

    And got the content items (Documents) by using this -

    <af:iterator rows="0" var="node" varStatus="iterator"

                          value="#{nodes}"

                          id="it0" >

                <dt:contentTemplate node="#{node}"

                                    view="oracle.webcenter.content.templates.default.list.item"

                                    nodesHint="#{nodes}"

                                    id="ct0"/>

             </af:iterator>

    Thanks as always!

  • User_QUFP4
    User_QUFP4 Member Posts: 176 Red Ribbon
    edited Apr 11, 2018 12:01AM

    Thanks for your reply... I'm using WCP 12c..

  • Daniel Merchán
    Daniel Merchán Enterprise Achitect Member Posts: 2,192 Gold Trophy
    edited Apr 11, 2018 2:30AM

    Hi,

    I did not read the entire thread. Apologies.


    So you are trying to achieve a File Explorer by only using content presenter right?.

    Have you tried any of the following alternatives?

    • Setup Content Presenter Query retrieving the folder dynamically? I mean, create a Page Attribute which will take the URL parameter or a default value if the URL parameter is empty.
    • Setup Content Presenter Query for retrieving the base folder content and when clicking a specific folder then scope a variable with the folder information for making a searchNodes and make PPR within the same Content Presenter.

    If I have time I will do a POC for you .

    Kind regards.

    User_QUFP4
This discussion has been closed.