Adding collections

Collections (formerly called Smart Folders) are virtual containers of lists of items found by doing a specialized search.

See the later section of the manual Using Listings & Queries (Collections)

*** Settings ***

Resource  plone/app/robotframework/server.robot
Resource  plone/app/robotframework/keywords.robot
Resource  Selenium2Screenshots/keywords.robot

Library  OperatingSystem

Suite Setup  Run keywords  Suite Setup  Test Setup
Suite Teardown  Run keywords  Test teardown  Suite Teardown

*** Variables ***

${FIXTURE}  plone.app.robotframework.PLONE_ROBOT_TESTING
@{DIMENSIONS}  1024  768
@{APPLY_PROFILES}  plone.app.contenttypes:plone-content


*** Keywords ***

Suite Setup
    Run keyword if  not sys.argv[0].startswith('bin/robot')
    ...             Setup Plone site  ${FIXTURE}
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Open test browser
    Run keyword and ignore error  Set window size  @{DIMENSIONS}

Test Setup
    Import library  Remote  ${PLONE_URL}/RobotRemote

    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Remote ZODB SetUp  ${FIXTURE}

    ${language} =  Get environment variable  LANGUAGE  'en'
    Set default language  ${language}

    Enable autologin as  Manager
    ${user_id} =  Translate  user_id
    ...  default=jane-doe
    ${user_fullname} =  Translate  user_fullname
    ...  default=Jane Doe
    Create user  ${user_id}  Member  fullname=${user_fullname}
    Set autologin username  ${user_id}

Test Teardown
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Remote ZODB TearDown  ${FIXTURE}

Suite Teardown
    Run keyword if  not sys.argv[0].startswith('bin/robot')
    ...             Teardown Plone Site
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Close all browsers

Choose “Collection” in the Add new... menu for a folder to start defining your collection:

add new collection menu image

Select Collection from the drop-down menu, and you’ll see the Add Collection panel:

collection form

Apart from the usual fields, the interesting part starts with the Search terms

You can pick all meta-data that Plone has on content items as criteria. By combining more criteria, you can create sophisticated queries, which will be automatically updated.

Your collection can search for all items of types Page and News Item that have a Tag of Sport, created in the last 3 months. Or all Events that have a Start date in the next month.

The possibilities are endless, and Plone will always show the results according to the criteria.

If you create a new content item later with the tag of “Sport”, it will automatically show up in the collection you have just defined.

History

Collections have been around under various names. They used to be called “Smart Folders” in earlier versions of Plone, and you may find references to that in older documentation. It may even be that your site has so-called “Old Style collections” enabled as well.

See the later section of the manual Using Listings & Queries (Collections)