public interface NavigationReader
A reader that reads a navigation hierarchy from PublicationTree given a starting node The node could be a Page asset, a SitePlan asset or a Publication. One can specify the level of children they would like the reader to return. The user also have the choice to specify whether it would like to retrieve all parents or not. For the returned nodes in hierarchy tree, one can leave it as default which the id and name of the node would be returned. Or if desired, one can specify an AssetReader
to use to more specifically retrieve the attributes of the asset on the node use NavigationReader.useAssetReader(AssetReader)
method Sample code snippet:
AssetReader reader = new AssetReaderImpl(new AssetFacadeImpl(ics)).includeLinks(true); Map navMap = new NavigationReaderImpl( new AssetFacadeImpl(ics), new NavigationFacadeImpl(ics)) .forNode( System.getProperty("assettype"), Long.parseLong(System.getProperty("assetid")) ) .getSitePlanAssetNode(true) .levelOfChildren(1) .allParents(false) .useAssetReader(reader) .read();
Modifier and Type | Field and Description |
---|---|
static String |
children |
static String |
description |
static String |
name |
static String |
ncode |
static String |
nid |
static String |
nparentid |
static String |
nrank |
static String |
oid |
static String |
otype |
static String |
parent |
static String |
PARENTS |
Modifier and Type | Method and Description |
---|---|
NavigationReader |
allParents(boolean allParent)
Whether all level of parents will be returned
|
NavigationReader |
forAsset(AssetId assetId)
The Page/SitePlan asset id for which the navigation is going to be build
|
NavigationReader |
forAssetName(String assetType, String assetName)
The Page/SitePlan asset name for which the navigation is going to be build
|
NavigationReader |
forAssetName(String assetType, String assetName, String siteName)
The Page/SitePlan asset name for which the navigation is going to be build
|
NavigationReader |
forNode(String type, Long id)
The Page/SitePlan/Publication type/id for which the navigation is going to be build
|
NavigationReader |
forSite(String siteName)
The site name for which the navigation is going to be build from
|
NavigationReader |
getPublicationNode(boolean getPublication)
specifies whether parents of typed Publication will be returned
|
NavigationReader |
getSiblings(boolean getSiblings)
Specifies whether siblings will be returned in reading of the tree
|
NavigationReader |
getSitePlanAssetNode(boolean getSitePlanAsset)
specifies whether parents typed SitePlan will be returned
|
NavigationReader |
levelOfChildren(int level)
Level of children will be retrieved, default to be 1
|
Map |
read()
Read the navigation hierarchy with information specified starting at the asset node specified.
|
NavigationReader |
useAssetReader(AssetReader assetReader)
The AssetReader to use to read the data
|
NavigationReader |
useAssetReader(String assettype, String subtype, AssetReader assetReader)
Specify an AssetReader to use page of specified assettype and subtype
|
static final String name
static final String description
static final String parent
static final String PARENTS
static final String children
static final String nrank
static final String ncode
static final String otype
static final String oid
static final String nparentid
static final String nid
NavigationReader forNode(String type, Long id)
type
- type - Page, SitePlan, Publicationid
- long idNavigationReader forAsset(AssetId assetId)
assetId
- build a navigation starting from an Asset typed of Page or SiteNavigationNavigationReader forAssetName(String assetType, String assetName)
assetType
- the asset type, only Page/SitePlan is allowed hereassetName
- the Page/SitePlan nameNavigationReader forAssetName(String assetType, String assetName, String siteName)
assetType
- the asset type, only Page/SitePlan is allowed hereassetName
- the Page/SitePlan name *siteName
- the site from which the asset of the same will be searched fromNavigationReader forSite(String siteName)
siteName
- site nameNavigationReader useAssetReader(AssetReader assetReader)
assetReader
- the assetReader uses to read asset related dataNavigationReader useAssetReader(String assettype, String subtype, AssetReader assetReader)
assettype
- the asset typesubtype
- the asset subtypeassetReader
- the assetReaderAssetReader
NavigationReader allParents(boolean allParent)
allParent
- true
indicate all parents will be returned, false
only immediate parent will be returnedNavigationReader levelOfChildren(int level)
level
- the level of childrenNavigationReader getPublicationNode(boolean getPublication)
getPublication
- true
indicate yes; false
otherwiseNavigationReader getSitePlanAssetNode(boolean getSitePlanAsset)
getSitePlanAsset
- true
indicates yes; false
otherwiseNavigationReader getSiblings(boolean getSiblings)
getSiblings
- true
indicates siblings will be returned in the Map, false
otherwiseMap read() throws AssetAccessException
AssetAccessException
- throws AssetAccessException