/// <summary> /// Compiles the link for elemenet /// </summary> /// <param name="element">The element.</param> /// <param name="context">The context.</param> /// <param name="format">The format.</param> /// <param name="levels">The levels.</param> /// <returns></returns> public static string CompileLinkForElemenet(this IMetaContentNested element, deliveryInstance context, reportOutputFormatName format, List <reportElementLevel> levels) { string path = ""; var elLevel = element.getElementLevel(); switch (elLevel) { case reportElementLevel.servicepage: case reportElementLevel.page: path = element.GetOutputPath(context, format, levels, false); break; case reportElementLevel.document: metaDocument doc = element as metaDocument; path = doc.index.GetOutputPath(context, format, levels, false); break; case reportElementLevel.documentSet: metaDocumentSet docs = element as metaDocumentSet; path = docs.index.GetOutputPath(context, format, levels, false); break; } path = path.getWebPathBackslashFormat().applyToContent(false, context.data); return(path); }
/// <summary> /// Gets the link collection /// </summary> /// <param name="scoped">The scoped.</param> /// <param name="context">The context.</param> /// <param name="format">The format.</param> /// <param name="levels">The levels.</param> /// <param name="makeAppApsolut">if set to <c>true</c> [make application apsolut].</param> /// <returns></returns> public static reportLinkCollectionSet GetLinkCollection(this IMetaContentNested scoped, deliveryInstance context, reportOutputFormatName format, List <reportElementLevel> levels, bool makeAppApsolut = true) { reportLinkCollectionSet menu = new reportLinkCollectionSet(); reportElementLevel level = scoped.getElementLevel(); IMetaContentNested linkFrom = scoped; switch (level) { case reportElementLevel.document: //metaDocument document = (metaDocument)linkFrom; //menu.Add(document.documentTitle, document.GetLinkCollection(context, format)); //break; case reportElementLevel.page: linkFrom = scoped.document; if (linkFrom != null) { metaDocument document2 = (metaDocument)linkFrom; menu.Add(document2.documentTitle, document2.GetLinkCollection(context, format, levels, makeAppApsolut)); } else { if (scoped.parent != null) { return(GetLinkCollection(scoped.parent, context, format, levels, makeAppApsolut)); } } break; case reportElementLevel.documentSet: metaDocumentSet documentSet = (metaDocumentSet)linkFrom; menu.AddInGroup(documentSet.documentSetTitle, documentSet.GetServicePageLinkCollection(context, format, levels, makeAppApsolut)); menu.AddInGroup(documentSet.documentSetTitle, documentSet.GetDocumentSetsLinkCollection(context, format, levels, makeAppApsolut)); menu.currentItem.GetMainGroup().name = "Report sections"; foreach (metaDocument docum in linkFrom) { menu.Add(docum.documentTitle, docum.GetLinkCollection(context, format, levels, makeAppApsolut)); } break; } return(menu); }