Difference between revisions of "GenerateProperties"

From BITPlan Wiki
Jump to navigation Jump to search
(created by WikiTask 2017-09-14T13:11:02Z)
Line 120: Line 120:
  
 
= result =
 
= result =
2016-02-10T06:54:11Z
+
2017-09-14T13:10:52Z
 
1 Topics need Properties to be generated
 
1 Topics need Properties to be generated
  
== Topic: Bigstock ==
+
== Topic: Seminar ==
=== properties of Bigstock ===
+
=== properties of Seminar ===
==== [[Property:Bigstock id]] ====
+
==== [[Property:Seminar kind]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=id
+
|name=kind
|label=id
+
|label=kind
|documentation=the id of the bigstock photo
+
|documentation=kind of
 +
for example CPSA-F, CPRE-FL, CPRE-AL RQ Management, UML-Tag, UML2
 +
|type=Special:Types/Page
 +
|index=1
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=dropdown
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Page]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar lang]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=lang
 +
|label=lang
 +
|documentation=The language of the seminar
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=1
+
|index=2
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=radiobutton
 +
|allowedValues=de,en
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar thema]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=thema
 +
|label=thema
 +
|documentation=Thema des Seminars
 +
|type=Special:Types/Text
 +
|index=3
 +
|sortPos=
 +
|primaryKey=
 +
|mandatory=
 +
|namespace=
 +
|size=
 +
|uploadable=
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar year]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=year
 +
|label=year
 +
|documentation=year of the event
 +
|type=Special:Types/Text
 +
|index=4
 +
|sortPos=-1
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar month]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=month
 +
|label=month
 +
|documentation=month of the event
 +
|type=Special:Types/Text
 +
|index=5
 +
|sortPos=-2
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar inHouse]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=inHouse
 +
|label=inHouse
 +
|documentation=is this an in house event?
 +
|type=Special:Types/Boolean
 +
|index=6
 
|sortPos=
 
|sortPos=
|primaryKey=true
+
|primaryKey=false
|mandatory=true
+
|mandatory=false
 
|namespace=
 
|namespace=
|size=8
+
|size=
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
Line 145: Line 286:
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
|showInGrid=false
+
|showInGrid=
 
|isLink=false
 
|isLink=false
|topic=Concept:Bigstock
+
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Boolean]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar city]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=city
 +
|label=city
 +
|documentation=the city where the event happened
 +
|type=Special:Types/Text
 +
|index=7
 +
|sortPos=
 +
|primaryKey=
 +
|mandatory=
 +
|namespace=
 +
|size=
 +
|uploadable=
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Seminar
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 153: Line 322:
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:Bigstock file]] ====
+
==== [[Property:Seminar from]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=from
 +
|label=von
 +
|documentation=start date of course
 +
|type=Special:Types/Date
 +
|index=8
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=datepicker
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Date]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar to]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=file
+
|name=to
|label=file
+
|label=bis
|documentation=the downloaded bigstock file - if it is downloaded a license has been paid for
+
|documentation=end date of course
|type=Special:Types/Page
+
|type=Special:Types/Date
|index=2
+
|index=9
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
 
|mandatory=false
 
|mandatory=false
|namespace=File
+
|namespace=
|size=100
+
|size=
|uploadable=true
+
|uploadable=false
 +
|defaultValue=
 +
|inputType=datepicker
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Date]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar title]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=title
 +
|label=title
 +
|documentation=
 +
|type=Special:Types/Text
 +
|index=10
 +
|sortPos=
 +
|primaryKey=
 +
|mandatory=
 +
|namespace=
 +
|size=
 +
|uploadable=
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar contact]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=contact
 +
|label=contact
 +
|documentation=the contact person for the seminar as a CRM WikiSon
 +
|type=Special:Types/Text
 +
|index=11
 +
|sortPos=
 +
|primaryKey=
 +
|mandatory=
 +
|namespace=
 +
|size=
 +
|uploadable=
 
|defaultValue=
 
|defaultValue=
 
|inputType=
 
|inputType=
 
|allowedValues=
 
|allowedValues=
|values_from=namespace=File
+
|values_from=
|showInGrid=false
+
|showInGrid=
 
|isLink=false
 
|isLink=false
|topic=Concept:Bigstock
+
|topic=Concept:Seminar
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::Page]]
+
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Seminar customer]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=customer
 +
|label=customer
 +
|documentation=the organization that ordered / organizes the event
 +
|type=Special:Types/Text
 +
|index=12
 +
|sortPos=
 +
|primaryKey=
 +
|mandatory=
 +
|namespace=
 +
|size=
 +
|uploadable=
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Seminar
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>

Revision as of 14:11, 14 September 2017

Action
edit
name  GenerateProperties
servicetype  WikiTask
service  
inputtype  Page
input  GenerateProperties#sidif
actionpage  GenerateProperties#template→GenerateProperties#template
output  GenerateProperties#result
engine  rythm
author  Wf→Wf
since  2015/11/18
comment  This saves a lot of work!


[edit]

sidif

Training isA Context
"TrainingContext#sidif"is sidif of it
Seminar needs Properties

Training sidif

Training isA Context
"Training#sidif"is sidif of it
Quizkarte needs Properties

Syllabus sidif

Syllabus isA Context
"Syllabus#sidif"is sidif of it
LearningGoal needs Properties

CRM Sidif

CRM isA Context
"CRM#sidif"is sidif of it
Organization needs Properties
Person needs Properties
Contact needs Properties
SocialLink needs Properties
[edit]
@// This is a rythm template
@import org.sidif.triple.TripleQuery
@import org.sidif.triple.Triple
@import org.sidif.wiki.SSLWiki
@import com.bitplan.topic.ContextSetting.TripleStoreMode
@import com.alibaba.fastjson.JSON
@import com.bitplan.mediawiki.japi.MediawikiApi
@import com.bitplan.mediawiki.japi.Mediawiki
@import com.bitplan.mediawiki.japi.api.Api
@include(wiki.SiDIFTemplates.propertiesdefs)
@args() {
  String title 
  String logo
  org.sidif.wiki.WikiTask wikiTask
  org.sidif.triple.TripleStore tripleStore
}
@{
  TripleQuery query=tripleStore.query();
  TripleQuery needed=query.query(null,"needs","Properties");
  Triple contextTriple=query.selectSingle(null,"isA","Context");
  String contextName=contextTriple.getSubject().toString();
  Triple sidifTriple=query.selectSingle(contextName,"sidif", null);
  String contextSidif=sidifTriple.getObject().toString();
  // now get the context
  ContextSetting contextSetting=ContextSetting.fromWikiTask(wikiTask);
  contextSetting.setContextName(contextName);
  contextSetting.setSidifInput(contextSidif);
  contextSetting.setTripleStoreMode(TripleStoreMode.SiDIF);
  Context context = ContextFactory.getInstance().getContext(contextSetting);
}
@(wikiTask.getWiki().getIsoTimeStamp())
@(needed.size()) Topics need Properties to be generated
@for (Triple neededTriple:needed.getTriples()) {
@{
  String topicName=neededTriple.getSubject().toString();
  Topic topic=context.byName(topicName);
}
== Topic: @(topicName) ==
=== properties of @(topic.name) ===
@for (Property property:topic.getProperties()) {
==== [[Property:@(topic.name) @(property.name)]] ====
@{
  Throwable error=null;
  try {
    // get the Rythm template result
    org.rythmengine.utils.RawData pageContentRaw=property(topic,property);
    String pageContent=pageContentRaw.toString();
    String pageTitle="Property:"+topic.name+" "+property.name;
    SSLWiki wiki=(SSLWiki)wikiTask.getWiki();
    String currentContent=wiki.getPageContent(pageTitle);
    // if (currentContent==null || currentContent.length()==0) {
      String summary="generated by GenerateProperties at "+wiki.getIsoTimeStamp();
      wiki.edit(pageTitle,pageContent,summary);
    // }
  } catch (Throwable th) {
    error=th;
  }
}
@if (error) {
<span style='color:red'>Error: @(error.getMessage())</span>
}
<pre>
@property(topic,property)
</pre>
}
}


[edit]

2017-09-14T13:10:52Z 1 Topics need Properties to be generated

Topic: Seminar

properties of Seminar

Property:Seminar kind


{{Property
|name=kind
|label=kind
|documentation=kind of 
for example CPSA-F, CPRE-FL, CPRE-AL RQ Management, UML-Tag, UML2
|type=Special:Types/Page
|index=1
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=dropdown
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Page]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar lang


{{Property
|name=lang
|label=lang
|documentation=The language of the seminar
|type=Special:Types/Text
|index=2
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=radiobutton
|allowedValues=de,en
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar thema


{{Property
|name=thema
|label=thema
|documentation=Thema des Seminars
|type=Special:Types/Text
|index=3
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar year


{{Property
|name=year
|label=year
|documentation=year of the event
|type=Special:Types/Text
|index=4
|sortPos=-1
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar month


{{Property
|name=month
|label=month
|documentation=month of the event
|type=Special:Types/Text
|index=5
|sortPos=-2
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar inHouse


{{Property
|name=inHouse
|label=inHouse
|documentation=is this an in house event?
|type=Special:Types/Boolean
|index=6
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Boolean]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar city


{{Property
|name=city
|label=city
|documentation=the city where the event happened
|type=Special:Types/Text
|index=7
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar from


{{Property
|name=from
|label=von
|documentation=start date of course
|type=Special:Types/Date
|index=8
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=datepicker
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Date]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar to


{{Property
|name=to
|label=bis
|documentation=end date of course
|type=Special:Types/Date
|index=9
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=datepicker
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Date]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar title


{{Property
|name=title
|label=title
|documentation=
|type=Special:Types/Text
|index=10
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar contact


{{Property
|name=contact
|label=contact
|documentation=the contact person for the seminar as a CRM WikiSon
|type=Special:Types/Text
|index=11
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Seminar customer


{{Property
|name=customer
|label=customer
|documentation=the organization that ordered / organizes the event
|type=Special:Types/Text
|index=12
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Seminar
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}