public void RunTree(CswNbtAPITree Return, int ViewIdInt) { try { CswNbtViewId ViewId = new CswNbtViewId(ViewIdInt); CswNbtView View = _CswNbtResources.ViewSelect.restoreView(ViewId); if (null != View) { ICswNbtTree results = _CswNbtResources.Trees.getTreeFromView(View, true, false, false); for (int i = 0; i < results.getChildNodeCount(); i++) { results.goToNthChild(i); CswNbtNodeKey NodeKey = results.getNodeKeyForCurrentPosition(); string Name = results.getNodeNameForCurrentPosition(); CswNbtMetaDataNodeType nt = _CswNbtResources.MetaData.getNodeType(NodeKey.NodeTypeId); CswNbtMetaDataObjectClass oc = nt.getObjectClass(); CswNbtMetaDataPropertySet propSet = oc.getPropertySet(); string PropSetName = string.Empty; if (null != propSet) { PropSetName = propSet.Name; } CswNbtAPITree.CswNbtTreeResource Parent = Return.Add(Name, NodeKey.NodeId, nt.NodeTypeName, oc.ObjectClassName, PropSetName, BuildURI(nt.NodeTypeName, NodeKey.NodeId.PrimaryKey)); _recurseTree(results, Parent); results.goToParentNode(); } Return.Status = HttpStatusCode.OK; } else { Return.Status = HttpStatusCode.NotFound; } } catch (Exception) { Return.Status = HttpStatusCode.InternalServerError; } }
public CswNbtAPITree RunTree(string viewid) { CswNbtAPITree Ret = new CswNbtAPITree(); var SvcDriver = new CswWebSvcDriver <CswNbtAPITree, int>( CswWebSvcResourceInitializer: new CswWebSvcResourceInitializerNbt(_Context, null), ReturnObj: Ret, WebSvcMethodPtr: CswNbtWebServiceApiViews.RunTree, ParamObj: CswConvert.ToInt32(viewid) ); SvcDriver.run(); WebOperationContext ctx = WebOperationContext.Current; ctx.OutgoingResponse.StatusCode = Ret.Status; if (ctx.OutgoingResponse.StatusCode != HttpStatusCode.OK) { Ret = null; } return(Ret); }
public static void RunTree(ICswResources CswResources, CswNbtAPITree Return, int ViewIdInt) { CswNbtWebServiceApiViews viewApi = new CswNbtWebServiceApiViews((CswNbtResources)CswResources); viewApi.RunTree(Return, ViewIdInt); }