protected virtual void ExpandTree(BPMConnection cn, JArray items, string path) { BPMObjectNameCollection folderNames = cn.GetFolders(StoreZoneType.FormService, path, BPMPermision.Read); foreach (String folderName in folderNames) { string folderPath; if (String.IsNullOrEmpty(path)) { folderPath = folderName; } else { folderPath = path + "/" + folderName; } JObject item = new JObject(); items.Add(item); item["leaf"] = false; item["text"] = folderName; item["iconCls"] = "folder"; item["expanded"] = false; item["path"] = folderPath; item["rsid"] = StoreZoneType.FormService.ToString() + "://" + folderPath; JArray children = new JArray(); item[YZJsonProperty.children] = children; this.ExpandTree(cn, children, folderPath); } }
public virtual BPMObjectNameCollection GetStoreFolders(HttpContext context) { YZRequest request = new YZRequest(context); StoreZoneType zone = request.GetEnum <StoreZoneType>("zone"); string folder = request.GetString("folder", null); using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); return(cn.GetFolders(zone, folder)); } }
protected virtual void ExpandTree(BPMConnection cn, JArray items, string path, BPMPermision perm, bool expand, bool withProcess, bool checkbox) { BPMObjectNameCollection folderNames = cn.GetFolders(StoreZoneType.Process, path, perm); foreach (String folderName in folderNames) { string folderPath; if (String.IsNullOrEmpty(path)) { folderPath = folderName; } else { folderPath = path + "/" + folderName; } JObject item = new JObject(); items.Add(item); item["leaf"] = false; item["text"] = folderName; item["iconCls"] = "folder"; item["expanded"] = expand; item["path"] = folderPath; JArray children = new JArray(); item[YZJsonProperty.children] = children; this.ExpandTree(cn, children, folderPath, perm, expand, withProcess, checkbox); } if (withProcess) { BPMProcessCollection processes = cn.GetProcessList(path, perm, true); foreach (BPMProcess process in processes) { string processPath; if (String.IsNullOrEmpty(path)) { processPath = process.Name; } else { processPath = path + "/" + process.Name; } JObject item = new JObject(); items.Add(item); item["leaf"] = true; item["text"] = process.Name; if (checkbox) { item["checked"] = false; } item["path"] = processPath; item["ProcessName"] = process.Name; item["ProcessVersion"] = process.Version.ToString(2); item["Description"] = process.Property.Description; } } }