Difference between revisions of "GenerateProperties"

From BITPlan E-Bike Wiki
Jump to navigation Jump to search
(created by WikiTask 2018-06-28T18:12:30Z)
 
(3 intermediate revisions by the same user not shown)
Line 18: Line 18:
 
* {{Link|target=Template:Wikitask}}
 
* {{Link|target=Template:Wikitask}}
 
= input =
 
= input =
=== tsidif ===
+
=== sidif ===
<source lang='java' id='tsidif'>
+
<source lang='java' id='sidif'>
Training isA Context
+
PrivatKontext isA Context
"Training#sidif"is sidif of it
+
"PrivatKontext#sidif"is sidif of it
ChapterCR needs Properties
+
Tour needs Properties
 
</source>
 
</source>
  
=== sidif ===
+
=== msidif ===
<source lang='java' id='sidif'>
+
<source lang='java' id='msidif'>
 
MetaModel isA Context
 
MetaModel isA Context
 
"MetaModel#sidif"is sidif of it
 
"MetaModel#sidif"is sidif of it
Line 139: Line 139:
  
 
= result =
 
= result =
2018-02-22T09:27:37Z
+
2018-06-28T18:12:26Z
 
1 Topics need Properties to be generated
 
1 Topics need Properties to be generated
  
== Topic: ChapterCR ==
+
== Topic: Tour ==
=== properties of ChapterCR ===
+
=== properties of Tour ===
==== [[Property:ChapterCR id]] ====
+
==== [[Property:Tour date]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=id
+
|name=date
|label=id
+
|label=date
|documentation=id of the change
+
|documentation=the date of the tour
|type=Special:Types/Number
+
|type=Special:Types/Date
 
|index=1
 
|index=1
 
|sortPos=
 
|sortPos=
|primaryKey=true
+
|primaryKey=false
|mandatory=true
+
|mandatory=false
 
|namespace=
 
|namespace=
 
|size=
 
|size=
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
|inputType=
+
|inputType=datepicker
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::Number]]
+
[[Has type::Date]]
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:ChapterCR where]] ====
+
==== [[Property:Tour target]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=where
+
|name=target
|label=where
+
|label=target
|documentation=in which slide the change is necessary / the issue was found
+
|documentation=the target of the tour
|type=Special:Types/Text
+
|type=Special:Types/Page
 
|index=2
 
|index=2
 
|sortPos=
 
|sortPos=
Line 194: Line 194:
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::Text]]
+
[[Has type::Page]]
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:ChapterCR change]] ====
+
==== [[Property:Tour weather]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=change
+
|name=weather
|label=change
+
|label=weather
|documentation=The change that is required
+
|documentation=the location to show the weather for
 
|type=Special:Types/Text
 
|type=Special:Types/Text
 
|index=3
 
|index=3
Line 222: Line 222:
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 228: Line 228:
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:ChapterCR why]] ====
+
==== [[Property:Tour location]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=why
+
|name=location
|label=why
+
|label=location
|documentation=why is this change wanted?
+
|documentation=the location of the tour
 
|type=Special:Types/Text
 
|type=Special:Types/Text
 
|index=4
 
|index=4
Line 250: Line 250:
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 256: Line 256:
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:ChapterCR langs]] ====
+
==== [[Property:Tour coordinates]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=langs
+
|name=coordinates
|label=langs
+
|label=coordinates
|documentation=The languages that need to be changed
+
|documentation=coordinates of the point
 
|type=Special:Types/Text
 
|type=Special:Types/Text
 
|index=5
 
|index=5
Line 273: Line 273:
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
|inputType=checkboxes
+
|inputType=
|allowedValues=de, en
+
|allowedValues=
 
|values_from=
 
|values_from=
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 284: Line 284:
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:ChapterCR enteredBy]] ====
+
==== [[Property:Tour trip]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=enteredBy
+
|name=trip
|label=enteredBy
+
|label=trip
|documentation=who entered this change?
+
|documentation=the trip this point belongs to
|type=Special:Types/Text
+
|type=Special:Types/Page
 
|index=6
 
|index=6
 
|sortPos=
 
|sortPos=
Line 306: Line 306:
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::Text]]
+
[[Has type::Page]]
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:ChapterCR enteredOn]] ====
+
==== [[Property:Tour track]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=enteredOn
+
|name=track
|label=enteredOn
+
|label=track
|documentation=when was this change entered?
+
|documentation=the track to this tour point
|type=Special:Types/Date
+
|type=Special:Types/Text
 
|index=7
 
|index=7
 
|sortPos=
 
|sortPos=
Line 329: Line 329:
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
|inputType=datepicker
+
|inputType=
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::Date]]
+
[[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>
==== [[Property:ChapterCR fixed]] ====
+
==== [[Property:Tour stay]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=fixed
+
|name=stay
|label=fixed
+
|label=stay
|documentation=when was this change implemented?
+
|documentation=accomodation/loding/pause
|type=Special:Types/Date
+
|type=Special:Types/Text
 
|index=8
 
|index=8
 
|sortPos=
 
|sortPos=
Line 357: Line 357:
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
|inputType=datepicker
+
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Tour
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Tour shop]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=shop
 +
|label=shop
 +
|documentation=shopping location (if any)
 +
|type=Special:Types/Text
 +
|index=9
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Tour
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Tour distance]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=distance
 +
|label=distance
 +
|documentation=distance from previous tour point
 +
|type=Special:Types/Text
 +
|index=10
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::Date]]
+
[[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>
==== [[Property:ChapterCR chapter]] ====
+
==== [[Property:Tour comment]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=chapter
+
|name=comment
|label=chapter
+
|label=comment
|documentation=
+
|documentation=any comment for the tour point
|type=Special:Types/Page
+
|type=Special:Types/Text
|index=
+
|index=11
 
|sortPos=
 
|sortPos=
|primaryKey=
+
|primaryKey=false
|mandatory=
+
|mandatory=false
 
|namespace=
 
|namespace=
 
|size=
 
|size=
|uploadable=
+
|uploadable=false
 
|defaultValue=
 
|defaultValue=
|inputType=dropdown
+
|inputType=textarea
 
|allowedValues=
 
|allowedValues=
|values_from=concept=TrainingChapter
+
|values_from=
|showInGrid=
+
|showInGrid=true
|isLink=true
+
|isLink=false
|topic=Concept:ChapterCR
+
|topic=Concept:Tour
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::Page]]
+
[[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>

Latest revision as of 19:12, 28 June 2018

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

login reset runtemplate -> GenerateProperties#result


[edit]

sidif

PrivatKontext isA Context
"PrivatKontext#sidif"is sidif of it
Tour needs Properties

msidif

MetaModel isA Context
"MetaModel#sidif"is sidif of it
Topic needs Properties
Property needs Properties
SMW_Type needs Properties
Context needs Properties
TopicLink needs Properties
Action needs Properties

presentation sidif

Presentation isA Context
"Presentation#sidif"is sidif of it
Bigstock 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]

2018-06-28T18:12:26Z 1 Topics need Properties to be generated

Topic: Tour

properties of Tour

Property:Tour date


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

Property:Tour target


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

Property:Tour weather


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

Property:Tour location


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

Property:Tour coordinates


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

Property:Tour trip


{{Property
|name=trip
|label=trip
|documentation=the trip this point belongs to
|type=Special:Types/Page
|index=6
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Tour
|storemode=property
}}
[[Has type::Page]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Tour track


{{Property
|name=track
|label=track
|documentation=the track to this tour point
|type=Special:Types/Text
|index=7
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Tour
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Tour stay


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

Property:Tour shop


{{Property
|name=shop
|label=shop
|documentation=shopping location (if any)
|type=Special:Types/Text
|index=9
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Tour
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Tour distance


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

Property:Tour comment


{{Property
|name=comment
|label=comment
|documentation=any comment for the tour point
|type=Special:Types/Text
|index=11
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=textarea
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Tour
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}