AVEVA OMI Software Developer Kit
Navigation Hierarchy API

This Navigation API is exposed to retrieve content, based on a set of filter options. FilterOptions is the class you can use to specify search criteria.

FilterOptions Class
Copy Code
    /// <summary>
    This class holds the filter options applied to a specific navigation item.
    /// </summary>       
    public class FilterOptions

    {
       /// <summary>
       /// Gets or sets option Levels of Search.
       /// Provides the levels of search performed on the hierarchy of a navigation path.
       /// </summary>
       public LevelsOfSearch LevelsOfSearch { get; set; }

       /// <summary>
       /// Gets or sets the option NavigationSearchMode.
       /// Provides the navigation search mode for the given navigation path.
       /// </summary>
       public NavigationSearchMode NavigationSearchMode { get; set; }

       /// <summary>
       /// Gets or sets SortOrder option.
       /// SortOrder controls how items are sorted after they are returned to you
       public SortOrder SortOrder { get; set; }

       /// <summary>
       /// Gets or sets option ContentType
       /// 1) This field should be one of the content types in the system
       /// 2) This field is ignored if the value is empty.
       /// </summary>
       public IEnumerable<string> ContentType { get; set; }
    }

FilterOptions Search Options

FilterOptions can be applied to searches and include the following:

  • ContentName
  • ContentTypes
  • SortOrder
  • NavigationSearchMode
  • ContentData (Return Type)

ContentName

The ContentName option specifies the name of the content that you are searching for on a particular navigation hierarchy path.

  • The value of ContentName must be the partial or exact name of the content.
  • Wildcard characters can be used.
  • The value of ContentName is ignored if it is empty.

ContentTypes

The ContentTypes option specifies the type of content that you are searching for on a particular navigation hierarchy path.

  • The assigned value of ContentTypes must be the exact content type of the content.
  • The value of ContentTypes is ignored if it is empty.
  • If more than one ContentTypes is specified, it is supported as an array.
ContentType
Copy Code
    // This example gets content with the ContentType of "faceplate."
    searchResult = navModel.GetContentInHierarchy(@"\\Home\Root1", new FilterOptions() { ContentName = "*",
       ContentTypes = new string [] { "faceplate" }, LevelsOfSearch = LevelsOfSearch.SearchesOneLevel,
       NavigationSearchMode = NavigationSearchMode.ChildrenAlone });

    // This example gets content with the ContentType of "faceplate" or "overview."
    searchResult = navModel.GetContentInHierarchy(@"\\Home\Root1", new FilterOptions() { ContentName = "*",
       ContentTypes = new string[] { "faceplate", "Overview" }, LevelsOfSearch = LevelsOfSearch.SearchesOneLevel,
       NavigationSearchMode = NavigationSearchMode.ChildrenAlone });

    // This example ignores ContentTypes.
    searchResult = navModel.GetContentInHierarchy(@"\\Home\Root1", new FilterOptions() { ContentName = "*",
       ContentTypes = null, LevelsOfSearch = LevelsOfSearch.SearchesOneLevel,
       NavigationSearchMode = NavigationSearchMode.ChildrenAlone });

    // This example ignores ContentTypes while searching child nodes.
    searchResult = navModel.GetContentInHierarchy(@"\\Home\Root1", new FilterOptions()
       { ContentName = "*", LevelsOfSearch = LevelsOfSearch.SearchesOneLevel,
       NavigationSearchMode = NavigationSearchMode.ChildrenAlone });

    // This example searches for any ContentType.
    searchResult = navModel.GetContentInHierarchy(@"\\Home\Root1", new FilterOptions()
       { ContentName = "*", ContentTypes = new string[] { "Any" }, LevelsOfSearch = LevelsOfSearch.SearchesOneLevel,
       NavigationSearchMode = NavigationSearchMode.ChildrenAlone });

    // This example searches content with no ContentType.
    searchResult = navModel.GetContentInHierarchy(@"\\Home\Root1", new FilterOptions()
       { ContentName = "*", ContentTypes = new string[] { }, LevelsOfSearch = LevelsOfSearch.SearchesOneLevel,
       NavigationSearchMode = NavigationSearchMode.ChildrenAlone });

SortOrder

The SortOder option specifies the sorting method that is to be applied to content searches.

SortOrder
Copy Code
    /// <summary>
    /// This option controls how content searches are sorted from the API
    /// </summary>
    public enum SortOrder
    {
        /// <summary>
       /// This is the default option, which fills the control based on the order in which it finds the content.
       /// This is similar to depth-first search
       /// </summary>
       None = 0,

       /// <summary>
       /// Sorts content based on name in ascending (A-Z) alphabetic order.
       /// </summary>
       Alphabetical
   }

NavigationSearchMode

The NavigationSearchMode option specifies the navigation search mode that determines which navigation path hierarchy is considered at the API level.

NavigationSearchMode
Copy Code
    /// <summary>
    /// This option provides the different navigation search modes that system allows .
    /// </summary>
    public enum NavigationSearchMode
    {
       /// <summary>
       /// In FixedLocation mode, a search starts from a specific navigation path node provided by the user.
       /// </summary>
       FixedLocation = 0,
        /// <summary>
       /// In CurrentPath mode, a search starts from the current navigation path node selected by the user.
       /// This is same path as MyViewApp.Navigation.CurrentPath
       /// </summary>
       CurrentNav CurrentPath,
        /// <summary>
       /// In ChildrenAlone mode, a search starts from the child navigation nodes of a parent.
       /// Node specified by the user.
       /// </summary>
       ChildrenAlone
    }

LevelsOfSearch

The LevelsOfSearch option specifies the levels of search to be performed on a specified navigation path hierarchy.

LevelsOfSearch
Copy Code
    /// <summary>
    /// This option provides the different levels of search that the system allows.
    /// </summary>
    public enum LevelsOfSearch
    {
       /// <summary>
       /// Searches all levels of a navigation hierarchy.
       /// </summary>
       All = 0,

       /// <summary>
       /// Searches only one level of a navigation hierarchy.
       /// </summary>
       SearchesOneLevel,

       /// <summary>
       /// Searches two levels of a navigation hierarchy
       /// </summary>
       SearchesTwoLevels,

       /// <summary>
       /// Searches three levels of a navigation hierarchy
       /// </summary>
       SearchesThreeLevels
   }

ContentData (Return Type)

The return type of the API is an array of the ContentData. The ContentData array contains information such as the name of the content and its owning object.

ContentData
Copy Code
    /// <summary>
    /// This class holds content information, such as name and owning object.     /// </summary>
    public class ContentData
    {

       /// <summary>
       /// Gets the name of the content.
       /// </summary>
       public string ContentName { get; }

       /// <summary>
       /// Gets the owning object of the content.
       /// </summary>
       public string OwningObject { get; }
   }