@Exported
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 has 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 to be retrieved.
|
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 ID.NavigationReader forAsset(AssetId assetId)
assetId
- Build a navigation starting from an Asset typed of Page or SiteNavigation.NavigationReader forAssetName(String assetType, String assetName)
assetType
- The asset type, only Page/SitePlan is allowed here.assetName
- The Page/SitePlan name.NavigationReader forAssetName(String assetType, String assetName, String siteName)
assetType
- The asset type, only Page/SitePlan is allowed here.assetName
- The Page/SitePlan name. *siteName
- The site from which the asset of the same will be searched from.NavigationReader forSite(String siteName)
siteName
- site name.NavigationReader useAssetReader(AssetReader assetReader)
assetReader
- the assetReader uses to read asset related data.NavigationReader useAssetReader(String assettype, String subtype, AssetReader assetReader)
assettype
- the asset type.subtype
- the asset subtype.assetReader
- the assetReader.AssetReader
NavigationReader allParents(boolean allParent)
allParent
- true
indicate all parents will be returned, false
only immediate parent will be returned.NavigationReader levelOfChildren(int level)
level
- the level of children.NavigationReader getPublicationNode(boolean getPublication)
getPublication
- true
indicate yes; false
otherwise.NavigationReader getSitePlanAssetNode(boolean getSitePlanAsset)
getSitePlanAsset
- true
indicates yes; false
otherwise.NavigationReader getSiblings(boolean getSiblings)
getSiblings
- true
indicates siblings will be returned in the Map, false
otherwise.Map read() throws AssetAccessException
AssetAccessException
- throws AssetAccessException.