protected string GetXslPath(BaseBookmark xmlBm, string bizName, bool isIf, List <string> selectedTables, Relations relations, XmlNode startNode = null) { BookmarkType type = xmlBm == null ? BookmarkType.Select : xmlBm.Type; switch (type) { case BookmarkType.PdeTag: case BookmarkType.PdeChart: return(GetPdeXslPath(bizName, selectedTables)); case BookmarkType.StartForeach: if (_foreach[_foreach.Count - 1].IsContainPdeTag) { return(GetPdeXslPath(bizName, selectedTables)); } else { return(GetPdwXslPath(bizName, isIf, selectedTables, relations, startNode)); } default: return(GetPdwXslPath(bizName, isIf, selectedTables, relations, startNode)); } }
private List <string> FindTableNames(int index, IEnumerable <BaseBookmark> bookmarks, Pdw.Core.Relations relation) { int boltForeach = 1; List <string> tableNames = new List <string>(); for (int i = index + 1; i < bookmarks.Count(); i++) { BaseBookmark item = bookmarks.ElementAt(i); // to setup commanding position on stop lookup children if (boltForeach < 1) { break; } switch (item.Type) { case Core.BookmarkType.Select: case Core.BookmarkType.StartIf: if (boltForeach == 1) { tableNames.Add(GetTableName(item, relation)); } break; case BookmarkType.PdeTag: if (boltForeach == 1) { tableNames.Add(item.Key); } _selectedTable = new List <List <string> >(); _selectedTable.Add(tableNames); IsContainPdeTag = true; break; case Core.BookmarkType.StartForeach: boltForeach++; break; case Core.BookmarkType.EndForeach: boltForeach--; break; default: break; } } return(tableNames); }
private string GetTableName(BaseBookmark item, Pdw.Core.Relations relation) { // find biz name string bizName = item.BizName; // find table name string tableName = string.Empty; if (relation.MapInfos.ContainsKey(bizName)) { tableName = relation.MapInfos[bizName].TableName; } return(tableName); }
protected List <string> GetSelectedTables(BaseBookmark pbmItem) { if (pbmItem != null) { switch (pbmItem.Type) { case BookmarkType.PdeTag: case BookmarkType.PdeChart: return(GetPdeSelectedTables(pbmItem.Key)); default: return(GetPdwSelectedTables(pbmItem)); } } return(new List <string>()); }
private List <string> GetPdwSelectedTables(BaseBookmark pbmItem) { string ibmItemKey = pbmItem.Key; InternalBookmarkDomain ibmDomain = _ibm.GetInternalBookmarkDomainByItemKey(ibmItemKey); string bizName = pbmItem.BizName; if (string.IsNullOrWhiteSpace(bizName)) { InternalBookmarkItem ibmItem = ibmDomain.InternalBookmarkItems.FirstOrDefault(c => c.Key == ibmItemKey); bizName = ibmItem.OrginalBizName; } Relations relations = GetRelations(pbmItem); if (relations != null && relations.MapInfos.ContainsKey(bizName)) { string tableName = relations.MapInfos[bizName].TableName; return(ibmDomain.GetSelectedTabledOfPath(tableName)); } return(ibmDomain.GetAllSelectedTables()); }
protected Relations GetRelations(BaseBookmark pbmItem) { if (pbmItem != null) { switch (pbmItem.Type) { case BookmarkType.PdeTag: return(new Relations()); case BookmarkType.PdeChart: return(new Relations()); default: string ibmItemKey = pbmItem.Key; InternalBookmarkDomain ibmDomain = _ibm.GetInternalBookmarkDomainByItemKey(ibmItemKey); return(ibmDomain.Relations); } } return(new Relations()); }