General Actions:
Zaloguj się
Zarejestruj
Wiki:
xwiki
▼
:
Document Index
»
Space:
Species
▼
:
Document Index
»
Page:
LocalitySheet
Search
en
Page Actions:
Eksportuj
▼
:
Eksportuj jako PDF
Eksportuj jako HTML
More actions
▼
:
Podgląd wydruku
View Source
Main.WebHome
»
XWiki Space
»
Data types
»
Locality Class
»
Wiki source code of
Locality Sheet
Ukryj numery linii
1: {{groovy}} 2: //-- definitions --------------------------- 3: def clazzName = 'Species.LocalityClass' 4: def docObject = doc.getObject(clazzName) 5: def clazz = docObject?.xWikiClass 6: 7: if (!clazz){ 8: println services.localization.render("speciesApp.noClassFound",[clazzName]) 9: return 10: } 11: 12: xwiki.ssx.use("Species.Tech StylesheetExtensionIkonoteka") 13: xwiki.jsx.use("Tech QueryChronostratigraphicUnitsServiceWidget") 14: 15: def hierarchyRoof = 'Species.Stanowiska' 16: def enableValidation = true 17: def aiautil = xwiki.parseGroovyFromPage("Species.Tech IkonotekaScripts") 18: def splitClassName = aiautil.splitClassName(clazzName) 19: 20: aiautil.includeGalleryJsxHeader(xwiki) 21: 22: //-- methods ------------------------------- 23: def defaultPrintClosure = { 24: if (!it){ 25: return; 26: } 27: println "**${services.localization.render("speciesApp.${clazzName}."+it.name)}**" 28: println doc.display(it.name) 29: println "" 30: } 31: //------------------------------------------ 32: 33: //-- hierarchy ----------------------------- 34: def aiaHierarchyTreeCode = aiautil.getXwikicode4Tree(xwiki,doc,["Species.ChronostratigraphicUnitClass","Species.LocalityClass"]) 35: request.setAttribute("aiaHierarchyTreeCode", aiaHierarchyTreeCode) 36: 37: //-- validation/post edition modifing ------ 38: if(enableValidation){ 39: println """{{html}}<input type="hidden" name="xvalidate" value="1" /> 40: <input type="hidden" name="xvalidation" value="${splitClassName[0]}.Tech Validation${splitClassName[1]}" />{{/html}}""" 41: } 42: 43: //-- properties ---------------------------- 44: def specialPropsNames = ["pRysunek", 45: "pRysunekInne", 46: "pKoordynatyDlugosc", 47: "pKoordynatySzerokosc", 48: "pAutorWpisuIkonoteki", 49: "pRokWpisuIkonoteki", 50: "pAlternatywnaCytacja", 51: "pNumer", 52: "pNazwa", 53: "pProfilGeologicznyFileName3", 54: "pChronoUnit2"] 55: 56: def plainProps = clazz?.properties.grep{!it.isDisabled()} 57: def specialProps = [:] 58: specialPropsNames.each{specialPropName -> 59: def tmpProp = plainProps.find{it?.name == specialPropName} 60: specialProps[specialPropName] = tmpProp 61: } 62: plainProps = plainProps.minus(specialProps.values()) 63: 64: //-- sekcja wydruku ------------------------ 65: // <wybor_parenta> 66: if (xcontext.action=='edit' || xcontext.action=='inline') { 67: def parentName = aiautil.computeParentFullNameWithCache(doc.getDocument(), clazzName, request)?.parentFullName 68: def parentTitle = "" 69: if (xwiki.exists(parentName)){ 70: def parentObj = xwiki.getDocument(parentName) 71: parentTitle = parentObj.getTitle() 72: } 73: 74: println """ 75: {{html}} 76: <label for="myinput">${services.localization.render("speciesApp.${clazzName}.template.parentInputFieldName")}</label> 77: <input id="myinput_suggest" name="myinput_suggest" type="text" value="$parentTitle"/> 78: <input id="myinput" name="myinput" type="hidden" value="$parentName" /> 79: {{/html}} 80: """ 81: 82: 83: } 84: def interceptParentName = request.getParameter("myinput") 85: if (interceptParentName && doc.getParent() != interceptParentName){ 86: doc.setParent(interceptParentName) 87: } 88: // </wybor_parenta> 89: // <koordynaty> 90: print "${services.localization.render("speciesApp.${clazzName}.template.koordynaty")}" 91: print " " + doc.display(specialProps["pKoordynatyDlugosc"].name) 92: println " " + doc.display(specialProps["pKoordynatySzerokosc"].name) 93: // </koordynaty> 94: aiautil.mergeImageInfoObjects(doc) 95: println """(% class="aiaMainTable" %)""" 96: print """|(% class="aiaMainTableLeftCol" %)(((""" 97: if (["edit","inline"].contains(xcontext.action)){ 98: println "${services.localization.render("speciesApp.tips.howToAddImage")}" 99: } 100: def pProfilGeologicznyFileNameProp = docObject.getProperty("pProfilGeologicznyFileName3") 101: def profilGeologicznyFileNames = pProfilGeologicznyFileNameProp?.getProperty()?.getList() 102: print aiautil.getGalleryHtml(doc, xcontext, services, profilGeologicznyFileNames) 103: 104: if (xcontext.action=='edit' || xcontext.action=='inline') { 105: defaultPrintClosure(specialProps["pNumer"]) 106: defaultPrintClosure(specialProps["pNazwa"]) 107: } 108: 109: plainProps.each{ 110: defaultPrintClosure(it) 111: println "" 112: } 113: print ")))" 114: 115: //<aiaMainTableRightCol> 116: print """|(% class="aiaMainTableRightCol" %)(((""" 117: //-- specyfikacja ---------------------- 118: if (xcontext.action=='edit' || xcontext.action=='inline') { 119: ["pAutorWpisuIkonoteki", 120: "pRokWpisuIkonoteki", 121: "pAlternatywnaCytacja"].each { 122: defaultPrintClosure(specialProps[it]) 123: } 124: } 125: 126: //<ProfilGeologiczny> 127: println "|=${services.localization.render("speciesApp.${clazzName}.template.profilGeologiczny")}" 128: print "|(((" 129: if (xcontext.action=='edit' || xcontext.action=='inline') { 130: defaultPrintClosure(specialProps["pProfilGeologicznyFileName3"]) 131: } else if (profilGeologicznyFileNames) { 132: profilGeologicznyFileNames.each{ 133: println "[[image:${it}]]" 134: } 135: } 136: print ")))" 137: println "" 138: //</ProfilGeologiczny> 139: 140: println ")))" 141: //</aiaMainTableRightCol> 142: 143: println "" 144: //-- EO sekcja wydruku --------------------- 145: 146: 147: {{/groovy}} 148: 149: 150: 151: \\
Kategorie
Koncepcja
Gatunki
Stanowiska
Sponsorzy
Instytut Paleobiologii PAN
Klasyfikacja