Provides access to the contents of a folder in an SQL content repository:

Class Name

atg.droplet.ContentFolderView

Component

Not provided

Required Input Parameters

repository

The repository whose contents you wish to retrieve.

Optional Input Parameters

folder

Sets the folder to view within the specified repository. If this parameter is omitted, the servlet bean starts execution at the repository’s root folder.

getContent

If set to true, sets the contentItems parameter to an array of content items within the current folder. The default setting is false.

Output Parameters

contentItems

An array of content items in the current repository folder; set only if the input parameter getcontent is set to true.

subFolders

An array of the subfolder paths beneath the current folder. Paths start from the folder specified by the input parameter folder; otherwise, paths start from the repository’s root folder.

Open Parameters

output

Renders output for the current repository folder.

Usage Notes

ContentFolderView provides access to the items and subfolders of an SQL content repository. You can use this servlet bean to iterate over a hierarchy of repository folders, starting from the folder specified by the input parameter folder. If this parameter is omitted, execution begins at the repository’s root folder.

You can also use this servlet bean with ContentDroplet to obtain the data of repository content items.

You must create the properties file for ContentFolderView in <atg9dir>/home/localconfig/atg/dynamo/droplet and set it as follows:

$class=atg.droplet.ContentFolderView

Example

The following JSP fragment can be included in a JSP that supplies page parameters that are used to set the ContentFolderView input parameters repository and folder.

<%@ taglib prefix="dsp" uri="http://www.atg.com/taglibs/daf/dspjspELTaglib1_0" %>
<% /* page takes two parameters, repositoryName and startFolder
      If startFolder is null, the servlet bean starts execution at the
      repository's root folder */ %>

<dsp:droplet name="/atg/dynamo/droplet/ContentFolderView">
  <dsp:param name="repository" param="repositoryName "/>
  <dsp:param name="folder" param="startFolder"/>
  <dsp:param name="getContent" value="true"/>
  <dsp:oparam name="output">
    <dsp:droplet name="/atg/dynamo/droplet/ForEach">
      <dsp:param name="array" param="contentItems"/>
      <dsp:oparam name="output">
        <dsp:valueof param="element.path"/><br>
        <dsp:droplet name="/atg/dynamo/droplet/ContentDroplet">
          <dsp:param name="repository" param="repositoryName"/>
          <dsp:param name="item" param="element"/>
        </dsp:droplet><br>
      </dsp:oparam>
    </dsp:droplet>
    <dsp:droplet name="/atg/dynamo/droplet/ForEach">
      <dsp:param name="array" param="subFolders"/>
      <dsp:oparam name="output">
        <dsp:valueof param="element.path"/><br>
        <dsp:include page="folder.jsp">
          <dsp:param name="testFolder" param="element"/>
        </dsp:include>
      </dsp:oparam>
    </dsp:droplet>
  </dsp:oparam>
</dsp:droplet>

Given the following content repository folder hierarchy:

Execution of the JSP extract yields the following output:

/Reports
/Reports/2007
/Reports/2007/Annual
/Reports/2007/Annual/R07.txt
  ##text from R07.txt
/Reports/2007/Qtly
/Reports/2007/Qtly/RQ1.txt
  ##text from RQ1.txt
/Reports/2007/Qtly/RQ2.txt
  ##text from RQ2.txt
/Reports/2007/Qtly/RQ3.txt
  ##text from RQ3.txt
/Reports/2007/Qtly/RQ4.txt
  ##text from RQ4.txt
/Reports/2008
/Reports/2008/Annual
...
 
loading table of contents...