Note:

Extension of the classes in this package is prohibited unless otherwise documented. Similarly, extension or implementation of the interfaces in this package is prohibited except as documented.

Package com.sas.services.information.metadata.favorites


@CodeSet("sas.platform") @SASScope("ALL") package com.sas.services.information.metadata.favorites
Manages favorites folders and their contents.

Overview

Favorites folders are a new object type added to SAS 9.3 to save a list of favorite objects. A favorites folder enables users to collect objects of interest into a common view or maybe be used by an application to implement features like favorites or history.

The API supports the following capabilities:

  • Creation of new favorites folders
  • Creation and retrieval of application specific favorites folders to support favorites and history features
  • Listing contents
  • Adding and removing favorites
  • Creating and removing subgroups, typically used for organizing a collection of favorites (known as "favorites groups")
  • Setting the maximum capacity of the favorites folder, used by a History feature (i.e. store only the last 10 viewed objects)

Usage

The FavoritesFactory should be used to create new favorites folders and favorites groups, or to retrieve an application specific favorites folders.

Example - Creating a favorites folder

Create a new favorites folder under the user's My Folder location.
  SessionContextInterface session;  //where "session" is a valid session context instance
  ServerInterface server; //where "server" is a valid server instance
  
  FolderInterface myFolder = server.getHomeFolder(null, UserFolderType.FOLDERTYPE_MYFOLDER, null);
  FavoritesFactory factory = FavoritesFactory.getInstance(session);
  FavoritesFolder favorites = factory.createFavoritesFolder("Favorites", myFolder);
  if (favorites != null)
  {
     //persist the changes to the server
     favorites.update();
  }
 

Example - Creating a favorites group

Under the favorites folder just created, create a new subgroup named "Reports".
  FavoritesGroup group = factory.createFavoritesGroup("Reports", favorites);
  if (group != null)
  {
     //persist the changes to the server
     group.update();
  }
 
Since:
9.3
  • Class
    Description
    Base interface used for any favorites container object, such as a FavoritesFolder or a FavoritesGroup.
    Factory class used for creating new favorites folders.
    Interface representing the FavoritesFolder public object.
    Interface representing the FavoritesGroup public object.