close

Filter

loading table of contents...

Studio Developer Manual / Version 2107

Table Of Contents

7.8.2 Providing default Search Folders

The middle section of the CoreMedia Studio's favorites toolbar is made up of the component FavoritesToolbarUserItemsArea which contains user-defined search folders. When you click a search folder, the collection view opens up in search mode showing the results of a predefined query. The user can create custom search folders via the Save Search button of the Studio library toolbar in search mode. Users can also modify existing search folders, change their order, rename them, or delete them altogether.

As a developer, you can provide a default set of search folders to your first-time users, so that the middle section won't appear empty on a user's first login to Studio.

Warning

Warning

Note that the configuration option shown below explains solely the default set of search folders that users will see on their first login. When Studio detects that there are no custom search folders defined yet for the user logging in, this default set will be copied to this user's settings - from then on, management of the search folder section is completely up to the user, and your configuration will be ignored. If you want to permanently add buttons (including buttons representing search folders) to the Favorites Toolbar, please refer to Section 7.8.1, “Adding buttons to the Favorites Toolbar” above.

You can add default search folders by using the AddArrayItemsPlugin on the FavoritesToolbarUserItemsArea. Each array item has to include the relevant search parameters that you want to pass to the library on opening. These parameters are modularized in terms of the different parts of the collection view in search mode. Thus, each array item is a nested JavaScript object literal that itself contains possibly multiple objects for the various parameter parts. These embedded objects can be accessed via unique keys (see below). In addition, each array item is given a unique name that will also be used as the display text for the resulting search folder in the favorites toolbar.

By default, the different search parameters of the collection view are divided into the following parts:

  • The main part (key _main), featuring the search parameters searchText, contentType, mode, view, folder, orderBy, and limit.

    Note that for the folder property, it is possible to use both of the following notations:

    1. folder: {$Ref: "content/9"} (Rest URI path)

    2. folder: {path: "/Sites/Media"} (content repository path)

  • The status filter (key status), featuring the search parameters inProduction, editedByMe, editedByOthers, notEdited, approved, published and deleted.

  • The last edited filter (key lastEdited), featuring the search parameter lastEditedBy.

Further possible parameters may arise due to plugged in additional filters (c.f. Section 7.12.5, “Adding Search Filters”) where each of them makes up its own part of search parameters. In the source code example below, a default search folder is plugged in that shows all documents under the content repository path folder /Sites/Media that were last edited by the user. You can see that the array item is composed of two of the three parts listed above and has been given a name.

<editor:StudioPlugin ...>
  <fx:Metadata>
    ...
  </fx:Metadata>
  <fx:Script><![CDATA[
    ...
  ]]></fx:Script>
  <local:rules>
    <editor:FavoritesToolbarUserItemsArea>
      <editor:plugins>
        <ui:AddArrayItemsPlugin arrayProperty=
              "{favoritesToolbarUserItemsArea.DEFAULT_ITEMS}"
          items='{[
            {_main:{contentType: "Document_",
                    folder: {path: "/Sites/Media"},
                    mode: "search",
                    view: "list",
                    limit: 50},
             lastEdited: {lastEditedBy: "me"},
             _name: "Last edited"}
          ]}'/>
      </editor:plugins>
    </editor:FavoritesToolbarUserItemsArea>
  </local:rules>
</editor:studioPlugin>

Example 7.41. Adding a custom search folder


If in doubt about the actual format for a default search folder entry, you can always customize a search manually in CoreMedia Studio, save it and have a look at the user's preferences where they get saved.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.