Difference between revisions of "GenerateRoyalPages"
Jump to navigation
Jump to search
(7 intermediate revisions by the same user not shown) | |||
Line 29: | Line 29: | ||
org.sidif.wiki.WikiTask wikiTask | org.sidif.wiki.WikiTask wikiTask | ||
org.sidif.triple.TripleStore tripleStore | org.sidif.triple.TripleStore tripleStore | ||
+ | } | ||
+ | @// get the Stacktrace | ||
+ | @def getStackTrace(Throwable th) { | ||
+ | @{ | ||
+ | StringWriter sw = new StringWriter(); | ||
+ | PrintWriter pw = new PrintWriter(sw); | ||
+ | th.printStackTrace(pw); | ||
+ | String sStackTrace = sw.toString(); | ||
+ | } | ||
+ | @(sStackTrace) | ||
+ | } | ||
+ | @// handle error | ||
+ | @def handleError(Throwable th) { | ||
+ | <span style='color:red'>Error: @(th.getClass().getName()): @(th.getMessage())</span> | ||
+ | === stacktrace === | ||
+ | <pre> | ||
+ | @getStackTrace(th) | ||
+ | </pre> | ||
} | } | ||
@// create the given person | @// create the given person | ||
@def createPerson(Person p) { | @def createPerson(Person p) { | ||
+ | # [[@(p.getName())]] | ||
@{ | @{ | ||
Throwable error=null; | Throwable error=null; | ||
Line 45: | Line 64: | ||
} | } | ||
@if (error) { | @if (error) { | ||
− | + | @handleError(error) | |
} | } | ||
} | } | ||
@{ | @{ | ||
TripleQuery query=tripleStore.query(); | TripleQuery query=tripleStore.query(); | ||
− | + | PersonManager pm=new PersonManager(query); | |
− | + | FamilyManager fm=new FamilyManager(query); | |
− | PersonManager pm=new PersonManager( | ||
− | FamilyManager fm=new FamilyManager( | ||
int pCount=0; | int pCount=0; | ||
int pMax=3; | int pMax=3; | ||
Line 63: | Line 80: | ||
@(wikiTask.getWiki().getIsoTimeStamp()) | @(wikiTask.getWiki().getIsoTimeStamp()) | ||
*@(query.size()) triples found | *@(query.size()) triples found | ||
− | *@( | + | *@(pm.getPersons().size()) persons found |
− | *@( | + | *@(fm.getFamilies().size()) families found |
@for (Person p:pm.getPersons()) { | @for (Person p:pm.getPersons()) { | ||
@createPerson(p) | @createPerson(p) | ||
Line 79: | Line 96: | ||
= Links = | = Links = | ||
* {{Link|target=Royal92#sidif}} | * {{Link|target=Royal92#sidif}} | ||
+ | * {{Link|target=PersonJava}} | ||
* {{Link|target=Concept:Action}} | * {{Link|target=Concept:Action}} | ||
* {{Link|target=Template:Action}} | * {{Link|target=Template:Action}} | ||
* {{Link|target=Template:Wikitask}} | * {{Link|target=Template:Wikitask}} | ||
<headertabs/> | <headertabs/> |
Latest revision as of 08:57, 6 October 2017
Action | |
---|---|
edit | |
name | GenerateRoyalPages |
servicetype | WikiTask |
service | |
inputtype | Page |
input | Royal92#sidif |
actionpage | GenerateRoyalPages#template |
output | Royal92/pages |
engine | rythm |
author | Wf |
since | 2017/10/06 |
comment | Create wiki pages for Royal-Family |
login reset runtemplate -> Royal92/pages