Is there any API avaialble which generates Load Rule for Given Components with Hierarchy considered
Dear Team,
Usecase : We are using Component Hierarchy in our Project. We are developing external utility which can load only specific Components in Sandbox. So we are looking for API which can generate for specfic Components considering hierarchy.
ie. for eg:
Comp1 [Parent]
- Comp11 [Child level 1]
- Comp111 [Child Level 2]
if i pass Comp111, API should support me to get Comp1,Comp11,Comp111 in loadrule.
Can you help here?
Accepted answer
There is no out-of-the-box feature which will generate a load rule that will load and respect the component hierarchy in the workspace.
You might have to write your own code to do this. The client-side API for retrieving a component hierarchy of a particular stream or repository workspace is:
IWorkspaceConnection.getComponentHierarchy() (although technically the method is on IFlowNodeConnection, which is the parent class of IWorkspaceConnection).
From there you would have to walk the hierarchy to determine what you need.
Note: There is no API to give the 'parents' of a given component. A component only knows about it's children, and not the other way around. Also be aware that a given component may appear in multiple hierarchy branches (i.e. have multiple parents).