Interface IDfSmartList

All Superinterfaces:
IDfPersistentObject, IDfSysObject, IDfTypedObject

public interface IDfSmartList extends IDfSysObject
An IDfSmartList is the BOF object representing a saved search.
This interface provides access to smart list-related data stored in dm_smart_list objects.
Here is an example of how to create an IDfSmartList:
          IDfClient localClient = DfClient.getLocalClient();
          IDfSessionManager sessionManager = localClient.newSessionManager();
          // Setup session information
          // ...

         // Obtain a query manager that will be used to create query definitions
         IDfSearchService searchService = localClient.newSearchService(sessionManager, "MYDOCBASE");
         IDfQueryManager queryManager = searchService.newQueryMgr();

         // Build the query
         IDfQueryBuilder queryBuilder = queryManager.newQueryBuilder();

         // Set the type to search
         queryBuilder.setObjectType("dm_document");

         // Set the docbase and folder location
         queryBuilder.addSelectedSource("MYDOCBASE");
         queryBuilder.addLocationScope("MYDOCBASE", "/MyFolder", true);

         // Set the search constraints
         IDfExpressionSet searchExpression = queryBuilder.getRootExpressionSet();
         searchExpression.addFullTextExpression("test");
         searchExpression.addSimpleAttrExpression("title", IDfAttr.DM_STRING, IDfSearchOperation.SEARCH_OP_CONTAINS, false, false, "mytitle");

         // Create an IDfSmartListDefinition (query + custom properties), the definition to be stored in the docbase
         IDfSmartListDefinition definition = queryManager.newSmartListDefinition();
         definition.setQueryDefinition(queryBuilder);

         // Create the persistent object
         IDfSession session = sessionManager.getSession("MYDOCBASE");
         IDfSmartList smartList = (IDfSmartList) session.newObject("dm_smart_list");

         // Store the definition
         smartList.setSmartListDefinition(definition);
         smartList.save();
         sessionManager.release(session);
 
Alternatively, you can also use IDfSearchStoreService to create IDfSmartList objects.
  • Field Details

  • Method Details

    • getSmartListDefinition

      IDfSmartListDefinition getSmartListDefinition(IDfSearchService searchService) throws DfException, IOException
      Gets the IDfSmartListDefinition associated to this dm_smart_list. Handles automatically the conversion of legacy smart lists.
      Parameters:
      searchService - The search service used to handle query definitions.
      Returns:
      An IDfSmartListDefinition instance.
      Throws:
      DfException - If the content is not a valid dm_smart_list.
      IOException - If an I/O error occurs.
    • setSmartListDefinition

      void setSmartListDefinition(IDfSmartListDefinition smartList) throws DfException
      Sets the content of this dm_smart_list.
      Parameters:
      smartList - The new smart list definition.
      Throws:
      DfException
    • isLegacy

      boolean isLegacy() throws DfException
      Indicates whether this smart list is an old format.
      Returns:
      true, if this smart list is a legacy format; false, otherwise.
      Throws:
      DfException - If a server error occurs.
    • save

      String save(String location, boolean withResults, boolean isPrivate) throws DfException
      Stores this search.
      Parameters:
      location -
      withResults - true, to save the result set with the search.
      isPrivate - true, to save the search as a private search.
      Returns:
      The saved object ID.
      Throws:
      DfException
    • getQueryStatus

      IDfQueryStatus getQueryStatus() throws DfException
      Gets the IDfQueryStatus.
      Returns:
      IDfQueryStatus
      Throws:
      DfException
      Since:
      6.0
    • setQueryStatus

      void setQueryStatus(IDfQueryStatus queryStatus)
      Sets the IDfQueryStatus.
      Parameters:
      queryStatus - IDfQueryStatus
      Since:
      6.0
    • getResultsCount

      int getResultsCount() throws DfException
      Gets the number of results for the search.
      Returns:
      int The number of results.
      Throws:
      DfException
      Since:
      6.0
    • getResultsSet

      IDfResultsSet getResultsSet() throws DfException
      Gets the IDfResultsSet.
      Returns:
      IDfResultsSet
      Throws:
      DfException
      Since:
      6.0
    • areResultsSaved

      boolean areResultsSaved() throws DfException
      Checks whether results are saved or not with the search.
      Returns:
      true, if results are saved; false, otherwise.
      Throws:
      DfException
      Since:
      6.0
    • setResultsSaved

      void setResultsSaved(boolean areResultsSaved)
      Sets if results are saved or not into the object.
      Parameters:
      areResultsSaved -
      Since:
      6.0
    • setResultsSet

      void setResultsSet(IDfResultsSet resultSet) throws DfException
      Sets the IDfResultsSet.
      Parameters:
      resultSet - IDfResultsSet
      Throws:
      DfException
      Since:
      6.0
    • getQueryDefinitionType

      String getQueryDefinitionType() throws DfException
      Gets the Query definition type. Possible values are: IDfSmartList.TYPE_PASS_THROUGH_QUERY or IDfSmartList.TYPE_QUERY_BUILDER
      Returns:
      The Query definition type.
      Throws:
      DfException