Concept:Seminar/Java
Jump to navigation
Jump to search
java code
<source lang='java' id='javacode'>@// This is a rythm template @// the args are the standard wikiTask arguments @import org.sidif.triple.TripleQuery @import org.sidif.triple.Triple @import com.alibaba.fastjson.JSON @args() {
String title String logo org.sidif.wiki.WikiTask wikiTask org.sidif.triple.TripleStore tripleStore
}
@def static {
/** * Base class */ static abstract class TopicBase { // each Topic has a pageid - for non subobject thats the pagename public String pageid;
/** * get a WikiSon version of the given name value * * @param name * @param value * @return - the string representation */ public String toWikiSon(String name, String value) { String result = "\n"; if (value != null) result = "|" + name + "=" + value + "\n"; return result; }
/** * get the propertySidif of the given property * * @param name * @param value * @return */ public static String propertySiDIF(String name, String value, String type) { // default is an empty string - no property line for emtpy values String result = ""; // if the value is not empty if ((value != null) && (!("".equals(value.trim())))) { // do we need to quote the result? String quote = ""; // this depends on the Type if ("Text".equals(type)) { quote = "\""; } // create a SIDIF Property line like // "John" is lastname of it result += quote + value + quote + " is " + name + " of it\n"; } // return the SiDIF property line return result; }
/** * get me as a String * * @param name * @param value * @return */ public static String propertySiDIF(String name, String value) { String result = propertySiDIF(name, value, "Text"); return result; }
/** * check if the given boolean String value is true * * @param value * @return true if the value is not null and has true/TRUE as it's string * content */ public boolean isTrue(String value) { boolean result = false; if (value != null && value.toLowerCase().equals("true")) { result = true; } return result; }
/** * initialize */ public void init(TripleQuery query) { } } // TopicBase /** * ZAnswer * A ZAnswer is an answer to a Z-Question - it consist of a pair of terms that 'fit' */ public static class ZAnswer extends TopicBase { public String left; public String right; public String question;
public String getLeft() { return left; } public void setLeft(String pLeft) { left=pLeft; } public String getRight() { return right; } public void setRight(String pRight) { right=pRight; } public String getQuestion() { return question; } public void setQuestion(String pQuestion) { question=pQuestion; } /** * convert this ZAnswer to a JSON string */ public String toJson() { return JSON.toJSONString(this); }
/** * convert this ZAnswer to a WikiSon string */ public String toWikiSon() { String wikison= "{{ZAnswer\n"; wikison+=toWikiSon("left",left); wikison+=toWikiSon("right",right); wikison+=toWikiSon("question",question); wikison+="}}\n"; return wikison; } /** * get the pageid for this topic */ public String getPageid() { return pageid; };
/** * default constructor for ZAnswer */ public ZAnswer() {}
/** * construct a ZAnswer from the given Triple * @param query - the TripleQuery to get the triples from * @param pZAnswerTriple - the triple to construct me from */ public ZAnswer(TripleQuery query,Triple pZAnswerTriple) { this(query,pZAnswerTriple.getSubject().toString()); } // constructor
/** * construct a ZAnswer from the given pageId * @param query - the TripleQuery to get the triples from * @param pageid - pageid */ public ZAnswer(TripleQuery query,String pageid) { this.pageid=pageid; Triple leftTriple=query.selectSingle(pageid,"left",null); if (leftTriple==null) leftTriple=query.selectSingle(pageid,"Property:ZAnswer_left",null); if (leftTriple!=null) left=leftTriple.getObject().toString(); Triple rightTriple=query.selectSingle(pageid,"right",null); if (rightTriple==null) rightTriple=query.selectSingle(pageid,"Property:ZAnswer_right",null); if (rightTriple!=null) right=rightTriple.getObject().toString(); Triple questionTriple=query.selectSingle(pageid,"question",null); if (questionTriple==null) questionTriple=query.selectSingle(pageid,"Property:ZAnswer_question",null); if (questionTriple!=null) question=questionTriple.getObject().toString(); init(query); } // constructor for ZAnswer // >>>{user defined topic code}{ZAnswer}{ZAnswer} // <<<{user defined topic code}{ZAnswer}{ZAnswer} } // class ZAnswer /** * Manager for ZAnswer */ public static class ZAnswerManager extends TopicBase { public String topicName="ZAnswer"; public transient List<ZAnswer> mZAnswers=new ArrayList<ZAnswer>(); public transient Map<String,ZAnswer> mZAnswerMap=new LinkedHashMap<String,ZAnswer>();
/** * get my ZAnswers */ public List<ZAnswer> getZAnswers() { List<ZAnswer> result=this.mZAnswers; return result; }
/** * add a new ZAnswer */ public ZAnswer add(ZAnswer pZAnswer) { mZAnswers.add(pZAnswer); mZAnswerMap.put(pZAnswer.getPageid(),pZAnswer); return pZAnswer; }
/** * add a new ZAnswer from the given triple */ public ZAnswer add(TripleQuery query,Triple pZAnswerTriple) { ZAnswer lZAnswer=new ZAnswer(query,pZAnswerTriple); add(lZAnswer); return lZAnswer; }
// reinitialize my mZAnswer map public void reinit() { mZAnswerMap.clear(); for (ZAnswer lZAnswer:mZAnswers) { mZAnswerMap.put(lZAnswer.getPageid(),lZAnswer); } }
// convert this manager to json format public String toJson() { return JSON.toJSONString(this); } // get a new manager from the given json string public static ZAnswerManager fromJson(String json) { ZAnswerManager result=JSON.parseObject(json, ZAnswerManager.class); result.reinit(); return result; }
// default constructor for ZAnswer Manager public ZAnswerManager() {}
// add ZAnswers from the given query public void addZAnswers(TripleQuery pZAnswerQuery,TripleQuery query) { if (pZAnswerQuery!=null) { for (Triple lZAnswerTriple:pZAnswerQuery.getTriples()) { add(query,lZAnswerTriple); } } }
// construct me from the given triple Query query public ZAnswerManager(TripleQuery query) { // first query the SiDIF bases triplestore TripleQuery lZAnswerQuery=query.query(null,"isA","ZAnswer"); addZAnswers(lZAnswerQuery,query); // then the SMW triplestore lZAnswerQuery=query.query(null,"Property:IsA","ZAnswer"); addZAnswers(lZAnswerQuery,query); init(query); } // constructor for ZAnswer Manager // >>>{user defined topicmanager code}{ZAnswer}{ZAnswer} // <<<{user defined topicmanager code}{ZAnswer}{ZAnswer} } // class ZAnswer Manager /** * ZQuestion * Z - Questions are exercise question that show two columns of terms. The task is to create pairs of terms from the left and right side that fit together */ public static class ZQuestion extends TopicBase { public String name; public String day; public String chapter;
public String getName() { return name; } public void setName(String pName) { name=pName; } public String getDay() { return day; } public void setDay(String pDay) { day=pDay; } public String getChapter() { return chapter; } public void setChapter(String pChapter) { chapter=pChapter; } /** * convert this ZQuestion to a JSON string */ public String toJson() { return JSON.toJSONString(this); }
/** * convert this ZQuestion to a WikiSon string */ public String toWikiSon() { String wikison= "{{ZQuestion\n"; wikison+=toWikiSon("name",name); wikison+=toWikiSon("day",day); wikison+=toWikiSon("chapter",chapter); wikison+="}}\n"; return wikison; } /** * get the pageid for this topic */ public String getPageid() { return pageid; };
/** * default constructor for ZQuestion */ public ZQuestion() {}
/** * construct a ZQuestion from the given Triple * @param query - the TripleQuery to get the triples from * @param pZQuestionTriple - the triple to construct me from */ public ZQuestion(TripleQuery query,Triple pZQuestionTriple) { this(query,pZQuestionTriple.getSubject().toString()); } // constructor
/** * construct a ZQuestion from the given pageId * @param query - the TripleQuery to get the triples from * @param pageid - pageid */ public ZQuestion(TripleQuery query,String pageid) { this.pageid=pageid; Triple nameTriple=query.selectSingle(pageid,"name",null); if (nameTriple==null) nameTriple=query.selectSingle(pageid,"Property:ZQuestion_name",null); if (nameTriple!=null) name=nameTriple.getObject().toString(); Triple dayTriple=query.selectSingle(pageid,"day",null); if (dayTriple==null) dayTriple=query.selectSingle(pageid,"Property:ZQuestion_day",null); if (dayTriple!=null) day=dayTriple.getObject().toString(); Triple chapterTriple=query.selectSingle(pageid,"chapter",null); if (chapterTriple==null) chapterTriple=query.selectSingle(pageid,"Property:ZQuestion_chapter",null); if (chapterTriple!=null) chapter=chapterTriple.getObject().toString(); init(query); } // constructor for ZQuestion // >>>{user defined topic code}{ZQuestion}{ZQuestion} // <<<{user defined topic code}{ZQuestion}{ZQuestion} } // class ZQuestion /** * Manager for ZQuestion */ public static class ZQuestionManager extends TopicBase { public String topicName="ZQuestion"; public transient List<ZQuestion> mZQuestions=new ArrayList<ZQuestion>(); public transient Map<String,ZQuestion> mZQuestionMap=new LinkedHashMap<String,ZQuestion>();
/** * get my ZQuestions */ public List<ZQuestion> getZQuestions() { List<ZQuestion> result=this.mZQuestions; return result; }
/** * add a new ZQuestion */ public ZQuestion add(ZQuestion pZQuestion) { mZQuestions.add(pZQuestion); mZQuestionMap.put(pZQuestion.getPageid(),pZQuestion); return pZQuestion; }
/** * add a new ZQuestion from the given triple */ public ZQuestion add(TripleQuery query,Triple pZQuestionTriple) { ZQuestion lZQuestion=new ZQuestion(query,pZQuestionTriple); add(lZQuestion); return lZQuestion; }
// reinitialize my mZQuestion map public void reinit() { mZQuestionMap.clear(); for (ZQuestion lZQuestion:mZQuestions) { mZQuestionMap.put(lZQuestion.getPageid(),lZQuestion); } }
// convert this manager to json format public String toJson() { return JSON.toJSONString(this); } // get a new manager from the given json string public static ZQuestionManager fromJson(String json) { ZQuestionManager result=JSON.parseObject(json, ZQuestionManager.class); result.reinit(); return result; }
// default constructor for ZQuestion Manager public ZQuestionManager() {}
// add ZQuestions from the given query public void addZQuestions(TripleQuery pZQuestionQuery,TripleQuery query) { if (pZQuestionQuery!=null) { for (Triple lZQuestionTriple:pZQuestionQuery.getTriples()) { add(query,lZQuestionTriple); } } }
// construct me from the given triple Query query public ZQuestionManager(TripleQuery query) { // first query the SiDIF bases triplestore TripleQuery lZQuestionQuery=query.query(null,"isA","ZQuestion"); addZQuestions(lZQuestionQuery,query); // then the SMW triplestore lZQuestionQuery=query.query(null,"Property:IsA","ZQuestion"); addZQuestions(lZQuestionQuery,query); init(query); } // constructor for ZQuestion Manager // >>>{user defined topicmanager code}{ZQuestion}{ZQuestion} // <<<{user defined topicmanager code}{ZQuestion}{ZQuestion} } // class ZQuestion Manager /** * ChapterCR * a chapter CR is a change request for the content of a chapter */ public static class ChapterCR extends TopicBase { public String where; public String change; public String why; public String enteredBy; public String enteredOn; public String chapter;
public String getWhere() { return where; } public void setWhere(String pWhere) { where=pWhere; } public String getChange() { return change; } public void setChange(String pChange) { change=pChange; } public String getWhy() { return why; } public void setWhy(String pWhy) { why=pWhy; } public String getEnteredBy() { return enteredBy; } public void setEnteredBy(String pEnteredBy) { enteredBy=pEnteredBy; } public String getEnteredOn() { return enteredOn; } public void setEnteredOn(String pEnteredOn) { enteredOn=pEnteredOn; } public String getChapter() { return chapter; } public void setChapter(String pChapter) { chapter=pChapter; } /** * convert this ChapterCR to a JSON string */ public String toJson() { return JSON.toJSONString(this); }
/** * convert this ChapterCR to a WikiSon string */ public String toWikiSon() { String wikison= "{{ChapterCR\n"; wikison+=toWikiSon("where",where); wikison+=toWikiSon("change",change); wikison+=toWikiSon("why",why); wikison+=toWikiSon("enteredBy",enteredBy); wikison+=toWikiSon("enteredOn",enteredOn); wikison+=toWikiSon("chapter",chapter); wikison+="}}\n"; return wikison; } /** * get the pageid for this topic */ public String getPageid() { return pageid; };
/** * default constructor for ChapterCR */ public ChapterCR() {}
/** * construct a ChapterCR from the given Triple * @param query - the TripleQuery to get the triples from * @param pChapterCRTriple - the triple to construct me from */ public ChapterCR(TripleQuery query,Triple pChapterCRTriple) { this(query,pChapterCRTriple.getSubject().toString()); } // constructor
/** * construct a ChapterCR from the given pageId * @param query - the TripleQuery to get the triples from * @param pageid - pageid */ public ChapterCR(TripleQuery query,String pageid) { this.pageid=pageid; Triple whereTriple=query.selectSingle(pageid,"where",null); if (whereTriple==null) whereTriple=query.selectSingle(pageid,"Property:ChapterCR_where",null); if (whereTriple!=null) where=whereTriple.getObject().toString(); Triple changeTriple=query.selectSingle(pageid,"change",null); if (changeTriple==null) changeTriple=query.selectSingle(pageid,"Property:ChapterCR_change",null); if (changeTriple!=null) change=changeTriple.getObject().toString(); Triple whyTriple=query.selectSingle(pageid,"why",null); if (whyTriple==null) whyTriple=query.selectSingle(pageid,"Property:ChapterCR_why",null); if (whyTriple!=null) why=whyTriple.getObject().toString(); Triple enteredByTriple=query.selectSingle(pageid,"enteredBy",null); if (enteredByTriple==null) enteredByTriple=query.selectSingle(pageid,"Property:ChapterCR_enteredBy",null); if (enteredByTriple!=null) enteredBy=enteredByTriple.getObject().toString(); Triple enteredOnTriple=query.selectSingle(pageid,"enteredOn",null); if (enteredOnTriple==null) enteredOnTriple=query.selectSingle(pageid,"Property:ChapterCR_enteredOn",null); if (enteredOnTriple!=null) enteredOn=enteredOnTriple.getObject().toString(); Triple chapterTriple=query.selectSingle(pageid,"chapter",null); if (chapterTriple==null) chapterTriple=query.selectSingle(pageid,"Property:ChapterCR_chapter",null); if (chapterTriple!=null) chapter=chapterTriple.getObject().toString(); init(query); } // constructor for ChapterCR // >>>{user defined topic code}{ChapterCR}{ChapterCR} // <<<{user defined topic code}{ChapterCR}{ChapterCR} } // class ChapterCR /** * Manager for ChapterCR */ public static class ChapterCRManager extends TopicBase { public String topicName="ChapterCR"; public transient List<ChapterCR> mChapterCRs=new ArrayList<ChapterCR>(); public transient Map<String,ChapterCR> mChapterCRMap=new LinkedHashMap<String,ChapterCR>();
/** * get my ChapterCR */ public List<ChapterCR> getChapterCR() { List<ChapterCR> result=this.mChapterCRs; return result; }
/** * add a new ChapterCR */ public ChapterCR add(ChapterCR pChapterCR) { mChapterCRs.add(pChapterCR); mChapterCRMap.put(pChapterCR.getPageid(),pChapterCR); return pChapterCR; }
/** * add a new ChapterCR from the given triple */ public ChapterCR add(TripleQuery query,Triple pChapterCRTriple) { ChapterCR lChapterCR=new ChapterCR(query,pChapterCRTriple); add(lChapterCR); return lChapterCR; }
// reinitialize my mChapterCR map public void reinit() { mChapterCRMap.clear(); for (ChapterCR lChapterCR:mChapterCRs) { mChapterCRMap.put(lChapterCR.getPageid(),lChapterCR); } }
// convert this manager to json format public String toJson() { return JSON.toJSONString(this); } // get a new manager from the given json string public static ChapterCRManager fromJson(String json) { ChapterCRManager result=JSON.parseObject(json, ChapterCRManager.class); result.reinit(); return result; }
// default constructor for ChapterCR Manager public ChapterCRManager() {}
// add ChapterCR from the given query public void addChapterCR(TripleQuery pChapterCRQuery,TripleQuery query) { if (pChapterCRQuery!=null) { for (Triple lChapterCRTriple:pChapterCRQuery.getTriples()) { add(query,lChapterCRTriple); } } }
// construct me from the given triple Query query public ChapterCRManager(TripleQuery query) { // first query the SiDIF bases triplestore TripleQuery lChapterCRQuery=query.query(null,"isA","ChapterCR"); addChapterCR(lChapterCRQuery,query); // then the SMW triplestore lChapterCRQuery=query.query(null,"Property:IsA","ChapterCR"); addChapterCR(lChapterCRQuery,query); init(query); } // constructor for ChapterCR Manager // >>>{user defined topicmanager code}{ChapterCR}{ChapterCR} // <<<{user defined topicmanager code}{ChapterCR}{ChapterCR} } // class ChapterCR Manager /** * Quizkarte * Eine Quizkarte dient zum Abfragen des Wissen zu einem Seminar */ public static class Quizkarte extends TopicBase { public String Punkte; public String Nummer; public String Frage; public String Question; public String Typ; public String TypeParameter; public String SeminarTag; public String bild; public String Qualität; public String context; public String A; public String A_en; public String A_comment; public String B; public String B_en; public String B_comment; public String C; public String C_en; public String C_comment; public String D; public String D_en; public String D_comment; public String E; public String E_en; public String E_comment; public String F; public String F_en; public String F_comment; public String G; public String G_en; public String G_comment; public String Lösung; public String Kommentar; public String learningGoal; public String learnItem;
public String getPunkte() { return Punkte; } public void setPunkte(String pPunkte) { Punkte=pPunkte; } public String getNummer() { return Nummer; } public void setNummer(String pNummer) { Nummer=pNummer; } public String getFrage() { return Frage; } public void setFrage(String pFrage) { Frage=pFrage; } public String getQuestion() { return Question; } public void setQuestion(String pQuestion) { Question=pQuestion; } public String getTyp() { return Typ; } public void setTyp(String pTyp) { Typ=pTyp; } public String getTypeParameter() { return TypeParameter; } public void setTypeParameter(String pTypeParameter) { TypeParameter=pTypeParameter; } public String getSeminarTag() { return SeminarTag; } public void setSeminarTag(String pSeminarTag) { SeminarTag=pSeminarTag; } public String getBild() { return bild; } public void setBild(String pBild) { bild=pBild; } public String getQualität() { return Qualität; } public void setQualität(String pQualität) { Qualität=pQualität; } public String getContext() { return context; } public void setContext(String pContext) { context=pContext; } public String getA() { return A; } public void setA(String pA) { A=pA; } public String getA_en() { return A_en; } public void setA_en(String pA_en) { A_en=pA_en; } public String getA_comment() { return A_comment; } public void setA_comment(String pA_comment) { A_comment=pA_comment; } public String getB() { return B; } public void setB(String pB) { B=pB; } public String getB_en() { return B_en; } public void setB_en(String pB_en) { B_en=pB_en; } public String getB_comment() { return B_comment; } public void setB_comment(String pB_comment) { B_comment=pB_comment; } public String getC() { return C; } public void setC(String pC) { C=pC; } public String getC_en() { return C_en; } public void setC_en(String pC_en) { C_en=pC_en; } public String getC_comment() { return C_comment; } public void setC_comment(String pC_comment) { C_comment=pC_comment; } public String getD() { return D; } public void setD(String pD) { D=pD; } public String getD_en() { return D_en; } public void setD_en(String pD_en) { D_en=pD_en; } public String getD_comment() { return D_comment; } public void setD_comment(String pD_comment) { D_comment=pD_comment; } public String getE() { return E; } public void setE(String pE) { E=pE; } public String getE_en() { return E_en; } public void setE_en(String pE_en) { E_en=pE_en; } public String getE_comment() { return E_comment; } public void setE_comment(String pE_comment) { E_comment=pE_comment; } public String getF() { return F; } public void setF(String pF) { F=pF; } public String getF_en() { return F_en; } public void setF_en(String pF_en) { F_en=pF_en; } public String getF_comment() { return F_comment; } public void setF_comment(String pF_comment) { F_comment=pF_comment; } public String getG() { return G; } public void setG(String pG) { G=pG; } public String getG_en() { return G_en; } public void setG_en(String pG_en) { G_en=pG_en; } public String getG_comment() { return G_comment; } public void setG_comment(String pG_comment) { G_comment=pG_comment; } public String getLösung() { return Lösung; } public void setLösung(String pLösung) { Lösung=pLösung; } public String getKommentar() { return Kommentar; } public void setKommentar(String pKommentar) { Kommentar=pKommentar; } public String getLearningGoal() { return learningGoal; } public void setLearningGoal(String pLearningGoal) { learningGoal=pLearningGoal; } public String getLearnItem() { return learnItem; } public void setLearnItem(String pLearnItem) { learnItem=pLearnItem; } /** * convert this Quizkarte to a JSON string */ public String toJson() { return JSON.toJSONString(this); }
/** * convert this Quizkarte to a WikiSon string */ public String toWikiSon() { String wikison= "{{Quizkarte\n"; wikison+=toWikiSon("Punkte",Punkte); wikison+=toWikiSon("Nummer",Nummer); wikison+=toWikiSon("Frage",Frage); wikison+=toWikiSon("Question",Question); wikison+=toWikiSon("Typ",Typ); wikison+=toWikiSon("TypeParameter",TypeParameter); wikison+=toWikiSon("SeminarTag",SeminarTag); wikison+=toWikiSon("bild",bild); wikison+=toWikiSon("Qualität",Qualität); wikison+=toWikiSon("context",context); wikison+=toWikiSon("A",A); wikison+=toWikiSon("A_en",A_en); wikison+=toWikiSon("A_comment",A_comment); wikison+=toWikiSon("B",B); wikison+=toWikiSon("B_en",B_en); wikison+=toWikiSon("B_comment",B_comment); wikison+=toWikiSon("C",C); wikison+=toWikiSon("C_en",C_en); wikison+=toWikiSon("C_comment",C_comment); wikison+=toWikiSon("D",D); wikison+=toWikiSon("D_en",D_en); wikison+=toWikiSon("D_comment",D_comment); wikison+=toWikiSon("E",E); wikison+=toWikiSon("E_en",E_en); wikison+=toWikiSon("E_comment",E_comment); wikison+=toWikiSon("F",F); wikison+=toWikiSon("F_en",F_en); wikison+=toWikiSon("F_comment",F_comment); wikison+=toWikiSon("G",G); wikison+=toWikiSon("G_en",G_en); wikison+=toWikiSon("G_comment",G_comment); wikison+=toWikiSon("Lösung",Lösung); wikison+=toWikiSon("Kommentar",Kommentar); wikison+=toWikiSon("learningGoal",learningGoal); wikison+=toWikiSon("learnItem",learnItem); wikison+="}}\n"; return wikison; } /** * get the pageid for this topic */ public String getPageid() { return pageid; };
/** * default constructor for Quizkarte */ public Quizkarte() {}
/** * construct a Quizkarte from the given Triple * @param query - the TripleQuery to get the triples from * @param pQuizkarteTriple - the triple to construct me from */ public Quizkarte(TripleQuery query,Triple pQuizkarteTriple) { this(query,pQuizkarteTriple.getSubject().toString()); } // constructor
/** * construct a Quizkarte from the given pageId * @param query - the TripleQuery to get the triples from * @param pageid - pageid */ public Quizkarte(TripleQuery query,String pageid) { this.pageid=pageid; Triple PunkteTriple=query.selectSingle(pageid,"Punkte",null); if (PunkteTriple==null) PunkteTriple=query.selectSingle(pageid,"Property:Quizkarte_Punkte",null); if (PunkteTriple!=null) Punkte=PunkteTriple.getObject().toString(); Triple NummerTriple=query.selectSingle(pageid,"Nummer",null); if (NummerTriple==null) NummerTriple=query.selectSingle(pageid,"Property:Quizkarte_Nummer",null); if (NummerTriple!=null) Nummer=NummerTriple.getObject().toString(); Triple FrageTriple=query.selectSingle(pageid,"Frage",null); if (FrageTriple==null) FrageTriple=query.selectSingle(pageid,"Property:Quizkarte_Frage",null); if (FrageTriple!=null) Frage=FrageTriple.getObject().toString(); Triple QuestionTriple=query.selectSingle(pageid,"Question",null); if (QuestionTriple==null) QuestionTriple=query.selectSingle(pageid,"Property:Quizkarte_Question",null); if (QuestionTriple!=null) Question=QuestionTriple.getObject().toString(); Triple TypTriple=query.selectSingle(pageid,"Typ",null); if (TypTriple==null) TypTriple=query.selectSingle(pageid,"Property:Quizkarte_Typ",null); if (TypTriple!=null) Typ=TypTriple.getObject().toString(); Triple TypeParameterTriple=query.selectSingle(pageid,"TypeParameter",null); if (TypeParameterTriple==null) TypeParameterTriple=query.selectSingle(pageid,"Property:Quizkarte_TypeParameter",null); if (TypeParameterTriple!=null) TypeParameter=TypeParameterTriple.getObject().toString(); Triple SeminarTagTriple=query.selectSingle(pageid,"SeminarTag",null); if (SeminarTagTriple==null) SeminarTagTriple=query.selectSingle(pageid,"Property:Quizkarte_SeminarTag",null); if (SeminarTagTriple!=null) SeminarTag=SeminarTagTriple.getObject().toString(); Triple bildTriple=query.selectSingle(pageid,"bild",null); if (bildTriple==null) bildTriple=query.selectSingle(pageid,"Property:Quizkarte_bild",null); if (bildTriple!=null) bild=bildTriple.getObject().toString(); Triple QualitätTriple=query.selectSingle(pageid,"Qualität",null); if (QualitätTriple==null) QualitätTriple=query.selectSingle(pageid,"Property:Quizkarte_Qualität",null); if (QualitätTriple!=null) Qualität=QualitätTriple.getObject().toString(); Triple contextTriple=query.selectSingle(pageid,"context",null); if (contextTriple==null) contextTriple=query.selectSingle(pageid,"Property:Quizkarte_context",null); if (contextTriple!=null) context=contextTriple.getObject().toString(); Triple ATriple=query.selectSingle(pageid,"A",null); if (ATriple==null) ATriple=query.selectSingle(pageid,"Property:Quizkarte_A",null); if (ATriple!=null) A=ATriple.getObject().toString(); Triple A_enTriple=query.selectSingle(pageid,"A_en",null); if (A_enTriple==null) A_enTriple=query.selectSingle(pageid,"Property:Quizkarte_A_en",null); if (A_enTriple!=null) A_en=A_enTriple.getObject().toString(); Triple A_commentTriple=query.selectSingle(pageid,"A_comment",null); if (A_commentTriple==null) A_commentTriple=query.selectSingle(pageid,"Property:Quizkarte_A_comment",null); if (A_commentTriple!=null) A_comment=A_commentTriple.getObject().toString(); Triple BTriple=query.selectSingle(pageid,"B",null); if (BTriple==null) BTriple=query.selectSingle(pageid,"Property:Quizkarte_B",null); if (BTriple!=null) B=BTriple.getObject().toString(); Triple B_enTriple=query.selectSingle(pageid,"B_en",null); if (B_enTriple==null) B_enTriple=query.selectSingle(pageid,"Property:Quizkarte_B_en",null); if (B_enTriple!=null) B_en=B_enTriple.getObject().toString(); Triple B_commentTriple=query.selectSingle(pageid,"B_comment",null); if (B_commentTriple==null) B_commentTriple=query.selectSingle(pageid,"Property:Quizkarte_B_comment",null); if (B_commentTriple!=null) B_comment=B_commentTriple.getObject().toString(); Triple CTriple=query.selectSingle(pageid,"C",null); if (CTriple==null) CTriple=query.selectSingle(pageid,"Property:Quizkarte_C",null); if (CTriple!=null) C=CTriple.getObject().toString(); Triple C_enTriple=query.selectSingle(pageid,"C_en",null); if (C_enTriple==null) C_enTriple=query.selectSingle(pageid,"Property:Quizkarte_C_en",null); if (C_enTriple!=null) C_en=C_enTriple.getObject().toString(); Triple C_commentTriple=query.selectSingle(pageid,"C_comment",null); if (C_commentTriple==null) C_commentTriple=query.selectSingle(pageid,"Property:Quizkarte_C_comment",null); if (C_commentTriple!=null) C_comment=C_commentTriple.getObject().toString(); Triple DTriple=query.selectSingle(pageid,"D",null); if (DTriple==null) DTriple=query.selectSingle(pageid,"Property:Quizkarte_D",null); if (DTriple!=null) D=DTriple.getObject().toString(); Triple D_enTriple=query.selectSingle(pageid,"D_en",null); if (D_enTriple==null) D_enTriple=query.selectSingle(pageid,"Property:Quizkarte_D_en",null); if (D_enTriple!=null) D_en=D_enTriple.getObject().toString(); Triple D_commentTriple=query.selectSingle(pageid,"D_comment",null); if (D_commentTriple==null) D_commentTriple=query.selectSingle(pageid,"Property:Quizkarte_D_comment",null); if (D_commentTriple!=null) D_comment=D_commentTriple.getObject().toString(); Triple ETriple=query.selectSingle(pageid,"E",null); if (ETriple==null) ETriple=query.selectSingle(pageid,"Property:Quizkarte_E",null); if (ETriple!=null) E=ETriple.getObject().toString(); Triple E_enTriple=query.selectSingle(pageid,"E_en",null); if (E_enTriple==null) E_enTriple=query.selectSingle(pageid,"Property:Quizkarte_E_en",null); if (E_enTriple!=null) E_en=E_enTriple.getObject().toString(); Triple E_commentTriple=query.selectSingle(pageid,"E_comment",null); if (E_commentTriple==null) E_commentTriple=query.selectSingle(pageid,"Property:Quizkarte_E_comment",null); if (E_commentTriple!=null) E_comment=E_commentTriple.getObject().toString(); Triple FTriple=query.selectSingle(pageid,"F",null); if (FTriple==null) FTriple=query.selectSingle(pageid,"Property:Quizkarte_F",null); if (FTriple!=null) F=FTriple.getObject().toString(); Triple F_enTriple=query.selectSingle(pageid,"F_en",null); if (F_enTriple==null) F_enTriple=query.selectSingle(pageid,"Property:Quizkarte_F_en",null); if (F_enTriple!=null) F_en=F_enTriple.getObject().toString(); Triple F_commentTriple=query.selectSingle(pageid,"F_comment",null); if (F_commentTriple==null) F_commentTriple=query.selectSingle(pageid,"Property:Quizkarte_F_comment",null); if (F_commentTriple!=null) F_comment=F_commentTriple.getObject().toString(); Triple GTriple=query.selectSingle(pageid,"G",null); if (GTriple==null) GTriple=query.selectSingle(pageid,"Property:Quizkarte_G",null); if (GTriple!=null) G=GTriple.getObject().toString(); Triple G_enTriple=query.selectSingle(pageid,"G_en",null); if (G_enTriple==null) G_enTriple=query.selectSingle(pageid,"Property:Quizkarte_G_en",null); if (G_enTriple!=null) G_en=G_enTriple.getObject().toString(); Triple G_commentTriple=query.selectSingle(pageid,"G_comment",null); if (G_commentTriple==null) G_commentTriple=query.selectSingle(pageid,"Property:Quizkarte_G_comment",null); if (G_commentTriple!=null) G_comment=G_commentTriple.getObject().toString(); Triple LösungTriple=query.selectSingle(pageid,"Lösung",null); if (LösungTriple==null) LösungTriple=query.selectSingle(pageid,"Property:Quizkarte_Lösung",null); if (LösungTriple!=null) Lösung=LösungTriple.getObject().toString(); Triple KommentarTriple=query.selectSingle(pageid,"Kommentar",null); if (KommentarTriple==null) KommentarTriple=query.selectSingle(pageid,"Property:Quizkarte_Kommentar",null); if (KommentarTriple!=null) Kommentar=KommentarTriple.getObject().toString(); Triple learningGoalTriple=query.selectSingle(pageid,"learningGoal",null); if (learningGoalTriple==null) learningGoalTriple=query.selectSingle(pageid,"Property:Quizkarte_learningGoal",null); if (learningGoalTriple!=null) learningGoal=learningGoalTriple.getObject().toString(); Triple learnItemTriple=query.selectSingle(pageid,"learnItem",null); if (learnItemTriple==null) learnItemTriple=query.selectSingle(pageid,"Property:Quizkarte_learnItem",null); if (learnItemTriple!=null) learnItem=learnItemTriple.getObject().toString(); init(query); } // constructor for Quizkarte // >>>{user defined topic code}{Quizkarte}{Quizkarte} // <<<{user defined topic code}{Quizkarte}{Quizkarte} } // class Quizkarte /** * Manager for Quizkarte */ public static class QuizkarteManager extends TopicBase { public String topicName="Quizkarte"; public transient List<Quizkarte> mQuizkartes=new ArrayList<Quizkarte>(); public transient Map<String,Quizkarte> mQuizkarteMap=new LinkedHashMap<String,Quizkarte>();
/** * get my Quizkarten */ public List<Quizkarte> getQuizkarten() { List<Quizkarte> result=this.mQuizkartes; return result; }
/** * add a new Quizkarte */ public Quizkarte add(Quizkarte pQuizkarte) { mQuizkartes.add(pQuizkarte); mQuizkarteMap.put(pQuizkarte.getPageid(),pQuizkarte); return pQuizkarte; }
/** * add a new Quizkarte from the given triple */ public Quizkarte add(TripleQuery query,Triple pQuizkarteTriple) { Quizkarte lQuizkarte=new Quizkarte(query,pQuizkarteTriple); add(lQuizkarte); return lQuizkarte; }
// reinitialize my mQuizkarte map public void reinit() { mQuizkarteMap.clear(); for (Quizkarte lQuizkarte:mQuizkartes) { mQuizkarteMap.put(lQuizkarte.getPageid(),lQuizkarte); } }
// convert this manager to json format public String toJson() { return JSON.toJSONString(this); } // get a new manager from the given json string public static QuizkarteManager fromJson(String json) { QuizkarteManager result=JSON.parseObject(json, QuizkarteManager.class); result.reinit(); return result; }
// default constructor for Quizkarte Manager public QuizkarteManager() {}
// add Quizkarten from the given query public void addQuizkarten(TripleQuery pQuizkarteQuery,TripleQuery query) { if (pQuizkarteQuery!=null) { for (Triple lQuizkarteTriple:pQuizkarteQuery.getTriples()) { add(query,lQuizkarteTriple); } } }
// construct me from the given triple Query query public QuizkarteManager(TripleQuery query) { // first query the SiDIF bases triplestore TripleQuery lQuizkarteQuery=query.query(null,"isA","Quizkarte"); addQuizkarten(lQuizkarteQuery,query); // then the SMW triplestore lQuizkarteQuery=query.query(null,"Property:IsA","Quizkarte"); addQuizkarten(lQuizkarteQuery,query); init(query); } // constructor for Quizkarte Manager // >>>{user defined topicmanager code}{Quizkarte}{Quizkarte} // <<<{user defined topicmanager code}{Quizkarte}{Quizkarte} } // class Quizkarte Manager /** * TrainingChapter * A TrainingChapter is a chapter of material for a training e.g. in Powerpoint or PDF format - the filename is given without extension */ public static class TrainingChapter extends TopicBase { public String id; public String title; public String title_en; public String filename; public String filename_en; public String material;
public String getId() { return id; } public void setId(String pId) { id=pId; } public String getTitle() { return title; } public void setTitle(String pTitle) { title=pTitle; } public String getTitle_en() { return title_en; } public void setTitle_en(String pTitle_en) { title_en=pTitle_en; } public String getFilename() { return filename; } public void setFilename(String pFilename) { filename=pFilename; } public String getFilename_en() { return filename_en; } public void setFilename_en(String pFilename_en) { filename_en=pFilename_en; } public String getMaterial() { return material; } public void setMaterial(String pMaterial) { material=pMaterial; } /** * convert this TrainingChapter to a JSON string */ public String toJson() { return JSON.toJSONString(this); }
/** * convert this TrainingChapter to a WikiSon string */ public String toWikiSon() { String wikison= "{{TrainingChapter\n"; wikison+=toWikiSon("id",id); wikison+=toWikiSon("title",title); wikison+=toWikiSon("title_en",title_en); wikison+=toWikiSon("filename",filename); wikison+=toWikiSon("filename_en",filename_en); wikison+=toWikiSon("material",material); wikison+="}}\n"; return wikison; } /** * get the pageid for this topic */ public String getPageid() { return pageid; };
/** * default constructor for TrainingChapter */ public TrainingChapter() {}
/** * construct a TrainingChapter from the given Triple * @param query - the TripleQuery to get the triples from * @param pTrainingChapterTriple - the triple to construct me from */ public TrainingChapter(TripleQuery query,Triple pTrainingChapterTriple) { this(query,pTrainingChapterTriple.getSubject().toString()); } // constructor
/** * construct a TrainingChapter from the given pageId * @param query - the TripleQuery to get the triples from * @param pageid - pageid */ public TrainingChapter(TripleQuery query,String pageid) { this.pageid=pageid; Triple idTriple=query.selectSingle(pageid,"id",null); if (idTriple==null) idTriple=query.selectSingle(pageid,"Property:TrainingChapter_id",null); if (idTriple!=null) id=idTriple.getObject().toString(); Triple titleTriple=query.selectSingle(pageid,"title",null); if (titleTriple==null) titleTriple=query.selectSingle(pageid,"Property:TrainingChapter_title",null); if (titleTriple!=null) title=titleTriple.getObject().toString(); Triple title_enTriple=query.selectSingle(pageid,"title_en",null); if (title_enTriple==null) title_enTriple=query.selectSingle(pageid,"Property:TrainingChapter_title_en",null); if (title_enTriple!=null) title_en=title_enTriple.getObject().toString(); Triple filenameTriple=query.selectSingle(pageid,"filename",null); if (filenameTriple==null) filenameTriple=query.selectSingle(pageid,"Property:TrainingChapter_filename",null); if (filenameTriple!=null) filename=filenameTriple.getObject().toString(); Triple filename_enTriple=query.selectSingle(pageid,"filename_en",null); if (filename_enTriple==null) filename_enTriple=query.selectSingle(pageid,"Property:TrainingChapter_filename_en",null); if (filename_enTriple!=null) filename_en=filename_enTriple.getObject().toString(); Triple materialTriple=query.selectSingle(pageid,"material",null); if (materialTriple==null) materialTriple=query.selectSingle(pageid,"Property:TrainingChapter_material",null); if (materialTriple!=null) material=materialTriple.getObject().toString(); init(query); } // constructor for TrainingChapter // >>>{user defined topic code}{TrainingChapter}{TrainingChapter} // <<<{user defined topic code}{TrainingChapter}{TrainingChapter} } // class TrainingChapter /** * Manager for TrainingChapter */ public static class TrainingChapterManager extends TopicBase { public String topicName="TrainingChapter"; public transient List<TrainingChapter> mTrainingChapters=new ArrayList<TrainingChapter>(); public transient Map<String,TrainingChapter> mTrainingChapterMap=new LinkedHashMap<String,TrainingChapter>();
/** * get my TrainingChapters */ public List<TrainingChapter> getTrainingChapters() { List<TrainingChapter> result=this.mTrainingChapters; return result; }
/** * add a new TrainingChapter */ public TrainingChapter add(TrainingChapter pTrainingChapter) { mTrainingChapters.add(pTrainingChapter); mTrainingChapterMap.put(pTrainingChapter.getPageid(),pTrainingChapter); return pTrainingChapter; }
/** * add a new TrainingChapter from the given triple */ public TrainingChapter add(TripleQuery query,Triple pTrainingChapterTriple) { TrainingChapter lTrainingChapter=new TrainingChapter(query,pTrainingChapterTriple); add(lTrainingChapter); return lTrainingChapter; }
// reinitialize my mTrainingChapter map public void reinit() { mTrainingChapterMap.clear(); for (TrainingChapter lTrainingChapter:mTrainingChapters) { mTrainingChapterMap.put(lTrainingChapter.getPageid(),lTrainingChapter); } }
// convert this manager to json format public String toJson() { return JSON.toJSONString(this); } // get a new manager from the given json string public static TrainingChapterManager fromJson(String json) { TrainingChapterManager result=JSON.parseObject(json, TrainingChapterManager.class); result.reinit(); return result; }
// default constructor for TrainingChapter Manager public TrainingChapterManager() {}
// add TrainingChapters from the given query public void addTrainingChapters(TripleQuery pTrainingChapterQuery,TripleQuery query) { if (pTrainingChapterQuery!=null) { for (Triple lTrainingChapterTriple:pTrainingChapterQuery.getTriples()) { add(query,lTrainingChapterTriple); } } }
// construct me from the given triple Query query public TrainingChapterManager(TripleQuery query) { // first query the SiDIF bases triplestore TripleQuery lTrainingChapterQuery=query.query(null,"isA","TrainingChapter"); addTrainingChapters(lTrainingChapterQuery,query); // then the SMW triplestore lTrainingChapterQuery=query.query(null,"Property:IsA","TrainingChapter"); addTrainingChapters(lTrainingChapterQuery,query); init(query); } // constructor for TrainingChapter Manager // >>>{user defined topicmanager code}{TrainingChapter}{TrainingChapter} // <<<{user defined topicmanager code}{TrainingChapter}{TrainingChapter} } // class TrainingChapter Manager /** * TrainingMaterial * A TrainingMaterial is a collection of computer documents to be used for a training */ public static class TrainingMaterial extends TopicBase { public String id; public String topic; public String folder; public String slides_de; public String slides_en; public String since;
public String getId() { return id; } public void setId(String pId) { id=pId; } public String getTopic() { return topic; } public void setTopic(String pTopic) { topic=pTopic; } public String getFolder() { return folder; } public void setFolder(String pFolder) { folder=pFolder; } public String getSlides_de() { return slides_de; } public void setSlides_de(String pSlides_de) { slides_de=pSlides_de; } public String getSlides_en() { return slides_en; } public void setSlides_en(String pSlides_en) { slides_en=pSlides_en; } public String getSince() { return since; } public void setSince(String pSince) { since=pSince; } /** * convert this TrainingMaterial to a JSON string */ public String toJson() { return JSON.toJSONString(this); }
/** * convert this TrainingMaterial to a WikiSon string */ public String toWikiSon() { String wikison= "{{TrainingMaterial\n"; wikison+=toWikiSon("id",id); wikison+=toWikiSon("topic",topic); wikison+=toWikiSon("folder",folder); wikison+=toWikiSon("slides_de",slides_de); wikison+=toWikiSon("slides_en",slides_en); wikison+=toWikiSon("since",since); wikison+="}}\n"; return wikison; } /** * get the pageid for this topic */ public String getPageid() { return pageid; };
/** * default constructor for TrainingMaterial */ public TrainingMaterial() {}
/** * construct a TrainingMaterial from the given Triple * @param query - the TripleQuery to get the triples from * @param pTrainingMaterialTriple - the triple to construct me from */ public TrainingMaterial(TripleQuery query,Triple pTrainingMaterialTriple) { this(query,pTrainingMaterialTriple.getSubject().toString()); } // constructor
/** * construct a TrainingMaterial from the given pageId * @param query - the TripleQuery to get the triples from * @param pageid - pageid */ public TrainingMaterial(TripleQuery query,String pageid) { this.pageid=pageid; Triple idTriple=query.selectSingle(pageid,"id",null); if (idTriple==null) idTriple=query.selectSingle(pageid,"Property:TrainingMaterial_id",null); if (idTriple!=null) id=idTriple.getObject().toString(); Triple topicTriple=query.selectSingle(pageid,"topic",null); if (topicTriple==null) topicTriple=query.selectSingle(pageid,"Property:TrainingMaterial_topic",null); if (topicTriple!=null) topic=topicTriple.getObject().toString(); Triple folderTriple=query.selectSingle(pageid,"folder",null); if (folderTriple==null) folderTriple=query.selectSingle(pageid,"Property:TrainingMaterial_folder",null); if (folderTriple!=null) folder=folderTriple.getObject().toString(); Triple slides_deTriple=query.selectSingle(pageid,"slides_de",null); if (slides_deTriple==null) slides_deTriple=query.selectSingle(pageid,"Property:TrainingMaterial_slides_de",null); if (slides_deTriple!=null) slides_de=slides_deTriple.getObject().toString(); Triple slides_enTriple=query.selectSingle(pageid,"slides_en",null); if (slides_enTriple==null) slides_enTriple=query.selectSingle(pageid,"Property:TrainingMaterial_slides_en",null); if (slides_enTriple!=null) slides_en=slides_enTriple.getObject().toString(); Triple sinceTriple=query.selectSingle(pageid,"since",null); if (sinceTriple==null) sinceTriple=query.selectSingle(pageid,"Property:TrainingMaterial_since",null); if (sinceTriple!=null) since=sinceTriple.getObject().toString(); init(query); } // constructor for TrainingMaterial // >>>{user defined topic code}{TrainingMaterial}{TrainingMaterial} // <<<{user defined topic code}{TrainingMaterial}{TrainingMaterial} } // class TrainingMaterial /** * Manager for TrainingMaterial */ public static class TrainingMaterialManager extends TopicBase { public String topicName="TrainingMaterial"; public transient List<TrainingMaterial> mTrainingMaterials=new ArrayList<TrainingMaterial>(); public transient Map<String,TrainingMaterial> mTrainingMaterialMap=new LinkedHashMap<String,TrainingMaterial>();
/** * get my TrainingMaterials */ public List<TrainingMaterial> getTrainingMaterials() { List<TrainingMaterial> result=this.mTrainingMaterials; return result; }
/** * add a new TrainingMaterial */ public TrainingMaterial add(TrainingMaterial pTrainingMaterial) { mTrainingMaterials.add(pTrainingMaterial); mTrainingMaterialMap.put(pTrainingMaterial.getPageid(),pTrainingMaterial); return pTrainingMaterial; }
/** * add a new TrainingMaterial from the given triple */ public TrainingMaterial add(TripleQuery query,Triple pTrainingMaterialTriple) { TrainingMaterial lTrainingMaterial=new TrainingMaterial(query,pTrainingMaterialTriple); add(lTrainingMaterial); return lTrainingMaterial; }
// reinitialize my mTrainingMaterial map public void reinit() { mTrainingMaterialMap.clear(); for (TrainingMaterial lTrainingMaterial:mTrainingMaterials) { mTrainingMaterialMap.put(lTrainingMaterial.getPageid(),lTrainingMaterial); } }
// convert this manager to json format public String toJson() { return JSON.toJSONString(this); } // get a new manager from the given json string public static TrainingMaterialManager fromJson(String json) { TrainingMaterialManager result=JSON.parseObject(json, TrainingMaterialManager.class); result.reinit(); return result; }
// default constructor for TrainingMaterial Manager public TrainingMaterialManager() {}
// add TrainingMaterials from the given query public void addTrainingMaterials(TripleQuery pTrainingMaterialQuery,TripleQuery query) { if (pTrainingMaterialQuery!=null) { for (Triple lTrainingMaterialTriple:pTrainingMaterialQuery.getTriples()) { add(query,lTrainingMaterialTriple); } } }
// construct me from the given triple Query query public TrainingMaterialManager(TripleQuery query) { // first query the SiDIF bases triplestore TripleQuery lTrainingMaterialQuery=query.query(null,"isA","TrainingMaterial"); addTrainingMaterials(lTrainingMaterialQuery,query); // then the SMW triplestore lTrainingMaterialQuery=query.query(null,"Property:IsA","TrainingMaterial"); addTrainingMaterials(lTrainingMaterialQuery,query); init(query); } // constructor for TrainingMaterial Manager // >>>{user defined topicmanager code}{TrainingMaterial}{TrainingMaterial} // <<<{user defined topicmanager code}{TrainingMaterial}{TrainingMaterial} } // class TrainingMaterial Manager /** * Seminar * Ein Seminar ist die Durchfuehrung einer Ausbildungsveranstaltung an einem bestimmten Ort in einem bestimmten Zeitraum zu einem bestimmten Thema */ public static class Seminar extends TopicBase { public String kind; public String lang; public String thema; public String year; public String month; public String inHouse; public String city; public String from; public String to; public String title; public String contact; public String customer;
public String getKind() { return kind; } public void setKind(String pKind) { kind=pKind; } public String getLang() { return lang; } public void setLang(String pLang) { lang=pLang; } public String getThema() { return thema; } public void setThema(String pThema) { thema=pThema; } public String getYear() { return year; } public void setYear(String pYear) { year=pYear; } public String getMonth() { return month; } public void setMonth(String pMonth) { month=pMonth; } public String getInHouse() { return inHouse; } public void setInHouse(String pInHouse) { inHouse=pInHouse; } public String getCity() { return city; } public void setCity(String pCity) { city=pCity; } public String getFrom() { return from; } public void setFrom(String pFrom) { from=pFrom; } public String getTo() { return to; } public void setTo(String pTo) { to=pTo; } public String getTitle() { return title; } public void setTitle(String pTitle) { title=pTitle; } public String getContact() { return contact; } public void setContact(String pContact) { contact=pContact; } public String getCustomer() { return customer; } public void setCustomer(String pCustomer) { customer=pCustomer; } /** * convert this Seminar to a JSON string */ public String toJson() { return JSON.toJSONString(this); }
/** * convert this Seminar to a WikiSon string */ public String toWikiSon() { String wikison= "{{Seminar\n"; wikison+=toWikiSon("kind",kind); wikison+=toWikiSon("lang",lang); wikison+=toWikiSon("thema",thema); wikison+=toWikiSon("year",year); wikison+=toWikiSon("month",month); wikison+=toWikiSon("inHouse",inHouse); wikison+=toWikiSon("city",city); wikison+=toWikiSon("from",from); wikison+=toWikiSon("to",to); wikison+=toWikiSon("title",title); wikison+=toWikiSon("contact",contact); wikison+=toWikiSon("customer",customer); wikison+="}}\n"; return wikison; } /** * get the pageid for this topic */ public String getPageid() { return pageid; };
/** * default constructor for Seminar */ public Seminar() {}
/** * construct a Seminar from the given Triple * @param query - the TripleQuery to get the triples from * @param pSeminarTriple - the triple to construct me from */ public Seminar(TripleQuery query,Triple pSeminarTriple) { this(query,pSeminarTriple.getSubject().toString()); } // constructor
/** * construct a Seminar from the given pageId * @param query - the TripleQuery to get the triples from * @param pageid - pageid */ public Seminar(TripleQuery query,String pageid) { this.pageid=pageid; Triple kindTriple=query.selectSingle(pageid,"kind",null); if (kindTriple==null) kindTriple=query.selectSingle(pageid,"Property:Seminar_kind",null); if (kindTriple!=null) kind=kindTriple.getObject().toString(); Triple langTriple=query.selectSingle(pageid,"lang",null); if (langTriple==null) langTriple=query.selectSingle(pageid,"Property:Seminar_lang",null); if (langTriple!=null) lang=langTriple.getObject().toString(); Triple themaTriple=query.selectSingle(pageid,"thema",null); if (themaTriple==null) themaTriple=query.selectSingle(pageid,"Property:Seminar_thema",null); if (themaTriple!=null) thema=themaTriple.getObject().toString(); Triple yearTriple=query.selectSingle(pageid,"year",null); if (yearTriple==null) yearTriple=query.selectSingle(pageid,"Property:Seminar_year",null); if (yearTriple!=null) year=yearTriple.getObject().toString(); Triple monthTriple=query.selectSingle(pageid,"month",null); if (monthTriple==null) monthTriple=query.selectSingle(pageid,"Property:Seminar_month",null); if (monthTriple!=null) month=monthTriple.getObject().toString(); Triple inHouseTriple=query.selectSingle(pageid,"inHouse",null); if (inHouseTriple==null) inHouseTriple=query.selectSingle(pageid,"Property:Seminar_inHouse",null); if (inHouseTriple!=null) inHouse=inHouseTriple.getObject().toString(); Triple cityTriple=query.selectSingle(pageid,"city",null); if (cityTriple==null) cityTriple=query.selectSingle(pageid,"Property:Seminar_city",null); if (cityTriple!=null) city=cityTriple.getObject().toString(); Triple fromTriple=query.selectSingle(pageid,"from",null); if (fromTriple==null) fromTriple=query.selectSingle(pageid,"Property:Seminar_from",null); if (fromTriple!=null) from=fromTriple.getObject().toString(); Triple toTriple=query.selectSingle(pageid,"to",null); if (toTriple==null) toTriple=query.selectSingle(pageid,"Property:Seminar_to",null); if (toTriple!=null) to=toTriple.getObject().toString(); Triple titleTriple=query.selectSingle(pageid,"title",null); if (titleTriple==null) titleTriple=query.selectSingle(pageid,"Property:Seminar_title",null); if (titleTriple!=null) title=titleTriple.getObject().toString(); Triple contactTriple=query.selectSingle(pageid,"contact",null); if (contactTriple==null) contactTriple=query.selectSingle(pageid,"Property:Seminar_contact",null); if (contactTriple!=null) contact=contactTriple.getObject().toString(); Triple customerTriple=query.selectSingle(pageid,"customer",null); if (customerTriple==null) customerTriple=query.selectSingle(pageid,"Property:Seminar_customer",null); if (customerTriple!=null) customer=customerTriple.getObject().toString(); init(query); } // constructor for Seminar // >>>{user defined topic code}{Seminar}{Seminar} // <<<{user defined topic code}{Seminar}{Seminar} } // class Seminar /** * Manager for Seminar */ public static class SeminarManager extends TopicBase { public String topicName="Seminar"; public transient List<Seminar> mSeminars=new ArrayList<Seminar>(); public transient Map<String,Seminar> mSeminarMap=new LinkedHashMap<String,Seminar>();
/** * get my Seminars */ public List<Seminar> getSeminars() { List<Seminar> result=this.mSeminars; return result; }
/** * add a new Seminar */ public Seminar add(Seminar pSeminar) { mSeminars.add(pSeminar); mSeminarMap.put(pSeminar.getPageid(),pSeminar); return pSeminar; }
/** * add a new Seminar from the given triple */ public Seminar add(TripleQuery query,Triple pSeminarTriple) { Seminar lSeminar=new Seminar(query,pSeminarTriple); add(lSeminar); return lSeminar; }
// reinitialize my mSeminar map public void reinit() { mSeminarMap.clear(); for (Seminar lSeminar:mSeminars) { mSeminarMap.put(lSeminar.getPageid(),lSeminar); } }
// convert this manager to json format public String toJson() { return JSON.toJSONString(this); } // get a new manager from the given json string public static SeminarManager fromJson(String json) { SeminarManager result=JSON.parseObject(json, SeminarManager.class); result.reinit(); return result; }
// default constructor for Seminar Manager public SeminarManager() {}
// add Seminars from the given query public void addSeminars(TripleQuery pSeminarQuery,TripleQuery query) { if (pSeminarQuery!=null) { for (Triple lSeminarTriple:pSeminarQuery.getTriples()) { add(query,lSeminarTriple); } } }
// construct me from the given triple Query query public SeminarManager(TripleQuery query) { // first query the SiDIF bases triplestore TripleQuery lSeminarQuery=query.query(null,"isA","Seminar"); addSeminars(lSeminarQuery,query); // then the SMW triplestore lSeminarQuery=query.query(null,"Property:IsA","Seminar"); addSeminars(lSeminarQuery,query); init(query); } // constructor for Seminar Manager // >>>{user defined topicmanager code}{Seminar}{Seminar} // <<<{user defined topicmanager code}{Seminar}{Seminar} } // class Seminar Manager /** * SeminarInterview * A seminarinterview clarifies and documens the prerequisites and expectations of participants of a Seminar */ public static class SeminarInterview extends TopicBase { public String Teilnehmer; public String versucht; public String anmeldeQuelle; public String empfehlung; public String erreicht; public String Rolle; public String Ausbildung; public String Umfeld; public String UMLVorkenntnisse; public String Erwartungen; public String comment; public String SeminarVeranstaltung;
public String getTeilnehmer() { return Teilnehmer; } public void setTeilnehmer(String pTeilnehmer) { Teilnehmer=pTeilnehmer; } public String getVersucht() { return versucht; } public void setVersucht(String pVersucht) { versucht=pVersucht; } public String getAnmeldeQuelle() { return anmeldeQuelle; } public void setAnmeldeQuelle(String pAnmeldeQuelle) { anmeldeQuelle=pAnmeldeQuelle; } public String getEmpfehlung() { return empfehlung; } public void setEmpfehlung(String pEmpfehlung) { empfehlung=pEmpfehlung; } public String getErreicht() { return erreicht; } public void setErreicht(String pErreicht) { erreicht=pErreicht; } public String getRolle() { return Rolle; } public void setRolle(String pRolle) { Rolle=pRolle; } public String getAusbildung() { return Ausbildung; } public void setAusbildung(String pAusbildung) { Ausbildung=pAusbildung; } public String getUmfeld() { return Umfeld; } public void setUmfeld(String pUmfeld) { Umfeld=pUmfeld; } public String getUMLVorkenntnisse() { return UMLVorkenntnisse; } public void setUMLVorkenntnisse(String pUMLVorkenntnisse) { UMLVorkenntnisse=pUMLVorkenntnisse; } public String getErwartungen() { return Erwartungen; } public void setErwartungen(String pErwartungen) { Erwartungen=pErwartungen; } public String getComment() { return comment; } public void setComment(String pComment) { comment=pComment; } public String getSeminarVeranstaltung() { return SeminarVeranstaltung; } public void setSeminarVeranstaltung(String pSeminarVeranstaltung) { SeminarVeranstaltung=pSeminarVeranstaltung; } /** * convert this SeminarInterview to a JSON string */ public String toJson() { return JSON.toJSONString(this); }
/** * convert this SeminarInterview to a WikiSon string */ public String toWikiSon() { String wikison= "{{SeminarInterview\n"; wikison+=toWikiSon("Teilnehmer",Teilnehmer); wikison+=toWikiSon("versucht",versucht); wikison+=toWikiSon("anmeldeQuelle",anmeldeQuelle); wikison+=toWikiSon("empfehlung",empfehlung); wikison+=toWikiSon("erreicht",erreicht); wikison+=toWikiSon("Rolle",Rolle); wikison+=toWikiSon("Ausbildung",Ausbildung); wikison+=toWikiSon("Umfeld",Umfeld); wikison+=toWikiSon("UMLVorkenntnisse",UMLVorkenntnisse); wikison+=toWikiSon("Erwartungen",Erwartungen); wikison+=toWikiSon("comment",comment); wikison+=toWikiSon("SeminarVeranstaltung",SeminarVeranstaltung); wikison+="}}\n"; return wikison; } /** * get the pageid for this topic */ public String getPageid() { return pageid; };
/** * default constructor for SeminarInterview */ public SeminarInterview() {}
/** * construct a SeminarInterview from the given Triple * @param query - the TripleQuery to get the triples from * @param pSeminarInterviewTriple - the triple to construct me from */ public SeminarInterview(TripleQuery query,Triple pSeminarInterviewTriple) { this(query,pSeminarInterviewTriple.getSubject().toString()); } // constructor
/** * construct a SeminarInterview from the given pageId * @param query - the TripleQuery to get the triples from * @param pageid - pageid */ public SeminarInterview(TripleQuery query,String pageid) { this.pageid=pageid; Triple TeilnehmerTriple=query.selectSingle(pageid,"Teilnehmer",null); if (TeilnehmerTriple==null) TeilnehmerTriple=query.selectSingle(pageid,"Property:SeminarInterview_Teilnehmer",null); if (TeilnehmerTriple!=null) Teilnehmer=TeilnehmerTriple.getObject().toString(); Triple versuchtTriple=query.selectSingle(pageid,"versucht",null); if (versuchtTriple==null) versuchtTriple=query.selectSingle(pageid,"Property:SeminarInterview_versucht",null); if (versuchtTriple!=null) versucht=versuchtTriple.getObject().toString(); Triple anmeldeQuelleTriple=query.selectSingle(pageid,"anmeldeQuelle",null); if (anmeldeQuelleTriple==null) anmeldeQuelleTriple=query.selectSingle(pageid,"Property:SeminarInterview_anmeldeQuelle",null); if (anmeldeQuelleTriple!=null) anmeldeQuelle=anmeldeQuelleTriple.getObject().toString(); Triple empfehlungTriple=query.selectSingle(pageid,"empfehlung",null); if (empfehlungTriple==null) empfehlungTriple=query.selectSingle(pageid,"Property:SeminarInterview_empfehlung",null); if (empfehlungTriple!=null) empfehlung=empfehlungTriple.getObject().toString(); Triple erreichtTriple=query.selectSingle(pageid,"erreicht",null); if (erreichtTriple==null) erreichtTriple=query.selectSingle(pageid,"Property:SeminarInterview_erreicht",null); if (erreichtTriple!=null) erreicht=erreichtTriple.getObject().toString(); Triple RolleTriple=query.selectSingle(pageid,"Rolle",null); if (RolleTriple==null) RolleTriple=query.selectSingle(pageid,"Property:SeminarInterview_Rolle",null); if (RolleTriple!=null) Rolle=RolleTriple.getObject().toString(); Triple AusbildungTriple=query.selectSingle(pageid,"Ausbildung",null); if (AusbildungTriple==null) AusbildungTriple=query.selectSingle(pageid,"Property:SeminarInterview_Ausbildung",null); if (AusbildungTriple!=null) Ausbildung=AusbildungTriple.getObject().toString(); Triple UmfeldTriple=query.selectSingle(pageid,"Umfeld",null); if (UmfeldTriple==null) UmfeldTriple=query.selectSingle(pageid,"Property:SeminarInterview_Umfeld",null); if (UmfeldTriple!=null) Umfeld=UmfeldTriple.getObject().toString(); Triple UMLVorkenntnisseTriple=query.selectSingle(pageid,"UMLVorkenntnisse",null); if (UMLVorkenntnisseTriple==null) UMLVorkenntnisseTriple=query.selectSingle(pageid,"Property:SeminarInterview_UMLVorkenntnisse",null); if (UMLVorkenntnisseTriple!=null) UMLVorkenntnisse=UMLVorkenntnisseTriple.getObject().toString(); Triple ErwartungenTriple=query.selectSingle(pageid,"Erwartungen",null); if (ErwartungenTriple==null) ErwartungenTriple=query.selectSingle(pageid,"Property:SeminarInterview_Erwartungen",null); if (ErwartungenTriple!=null) Erwartungen=ErwartungenTriple.getObject().toString(); Triple commentTriple=query.selectSingle(pageid,"comment",null); if (commentTriple==null) commentTriple=query.selectSingle(pageid,"Property:SeminarInterview_comment",null); if (commentTriple!=null) comment=commentTriple.getObject().toString(); Triple SeminarVeranstaltungTriple=query.selectSingle(pageid,"SeminarVeranstaltung",null); if (SeminarVeranstaltungTriple==null) SeminarVeranstaltungTriple=query.selectSingle(pageid,"Property:SeminarInterview_SeminarVeranstaltung",null); if (SeminarVeranstaltungTriple!=null) SeminarVeranstaltung=SeminarVeranstaltungTriple.getObject().toString(); init(query); } // constructor for SeminarInterview // >>>{user defined topic code}{SeminarInterview}{SeminarInterview} // <<<{user defined topic code}{SeminarInterview}{SeminarInterview} } // class SeminarInterview /** * Manager for SeminarInterview */ public static class SeminarInterviewManager extends TopicBase { public String topicName="SeminarInterview"; public transient List<SeminarInterview> mSeminarInterviews=new ArrayList<SeminarInterview>(); public transient Map<String,SeminarInterview> mSeminarInterviewMap=new LinkedHashMap<String,SeminarInterview>();
/** * get my SeminarInterviews */ public List<SeminarInterview> getSeminarInterviews() { List<SeminarInterview> result=this.mSeminarInterviews; return result; }
/** * add a new SeminarInterview */ public SeminarInterview add(SeminarInterview pSeminarInterview) { mSeminarInterviews.add(pSeminarInterview); mSeminarInterviewMap.put(pSeminarInterview.getPageid(),pSeminarInterview); return pSeminarInterview; }
/** * add a new SeminarInterview from the given triple */ public SeminarInterview add(TripleQuery query,Triple pSeminarInterviewTriple) { SeminarInterview lSeminarInterview=new SeminarInterview(query,pSeminarInterviewTriple); add(lSeminarInterview); return lSeminarInterview; }
// reinitialize my mSeminarInterview map public void reinit() { mSeminarInterviewMap.clear(); for (SeminarInterview lSeminarInterview:mSeminarInterviews) { mSeminarInterviewMap.put(lSeminarInterview.getPageid(),lSeminarInterview); } }
// convert this manager to json format public String toJson() { return JSON.toJSONString(this); } // get a new manager from the given json string public static SeminarInterviewManager fromJson(String json) { SeminarInterviewManager result=JSON.parseObject(json, SeminarInterviewManager.class); result.reinit(); return result; }
// default constructor for SeminarInterview Manager public SeminarInterviewManager() {}
// add SeminarInterviews from the given query public void addSeminarInterviews(TripleQuery pSeminarInterviewQuery,TripleQuery query) { if (pSeminarInterviewQuery!=null) { for (Triple lSeminarInterviewTriple:pSeminarInterviewQuery.getTriples()) { add(query,lSeminarInterviewTriple); } } }
// construct me from the given triple Query query public SeminarInterviewManager(TripleQuery query) { // first query the SiDIF bases triplestore TripleQuery lSeminarInterviewQuery=query.query(null,"isA","SeminarInterview"); addSeminarInterviews(lSeminarInterviewQuery,query); // then the SMW triplestore lSeminarInterviewQuery=query.query(null,"Property:IsA","SeminarInterview"); addSeminarInterviews(lSeminarInterviewQuery,query); init(query); } // constructor for SeminarInterview Manager // >>>{user defined topicmanager code}{SeminarInterview}{SeminarInterview} // <<<{user defined topicmanager code}{SeminarInterview}{SeminarInterview} } // class SeminarInterview Manager
}