Difference between revisions of "GenerateProperties"

From BITPlan can4eve Wiki
Jump to navigation Jump to search
(created by WikiTask 2017-06-10T15:10:25Z)
(created by WikiTask 2017-06-10T15:11:23Z)
Line 128: Line 128:
  
 
= result =
 
= result =
2017-06-10T15:10:19Z
+
2017-06-10T15:11:16Z
1 Topics need Properties to be generated
+
2 Topics need Properties to be generated
  
== Topic: Action ==
+
== Topic: CANInfo ==
=== properties of Action ===
+
=== properties of CANInfo ===
==== [[Property:Action name]] ====
+
==== [[Property:CANInfo name]] ====
  
 
<pre>
 
<pre>
Line 140: Line 140:
 
|name=name
 
|name=name
 
|label=name
 
|label=name
|documentation=The name of the Action
+
|documentation=name of CANInfo
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=0
+
|index=1
 
|sortPos=
 
|sortPos=
 
|primaryKey=true
 
|primaryKey=true
Line 153: Line 153:
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
|showInGrid=
+
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:CANInfo
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 161: Line 161:
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:Action servicetype]] ====
+
==== [[Property:CANInfo description]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=servicetype
+
|name=description
|label=servicetype
+
|label=description
|documentation=The type of the service
+
|documentation=description of CANInfo
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=1
+
|index=2
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
|mandatory=true
+
|mandatory=false
 
|namespace=
 
|namespace=
 
|size=
 
|size=
 
|uploadable=false
 
|uploadable=false
|defaultValue=WikiTask
 
|inputType=radiobutton
 
|allowedValues=WikiTask
 
|values_from=
 
|showInGrid=true
 
|isLink=false
 
|topic=Concept:Action
 
|storemode=property
 
}}
 
[[Has type::Text]]
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
==== [[Property:Action service]] ====
 
 
<pre>
 
 
{{Property
 
|name=service
 
|label=service
 
|documentation=The service to be used
 
|type=Special:Types/URL
 
|index=2
 
|sortPos=
 
|primaryKey=
 
|mandatory=
 
|namespace=
 
|size=
 
|uploadable=
 
 
|defaultValue=
 
|defaultValue=
 
|inputType=
 
|inputType=
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
|showInGrid=
+
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:CANInfo
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::URL]]
+
[[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:Action inputtype]] ====
+
==== [[Property:CANInfo unit]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=inputtype
+
|name=unit
|label=inputtype
+
|label=unit
|documentation=What is the type of the input?
+
|documentation=the unit of this CANInfo
 
|type=Special:Types/Text
 
|type=Special:Types/Text
 
|index=3
 
|index=3
Line 233: Line 205:
 
|size=
 
|size=
 
|uploadable=false
 
|uploadable=false
|defaultValue=Page
+
|defaultValue=
|inputType=radiobutton
+
|inputType=
|allowedValues=Query,Page,URL
+
|allowedValues=
 
|values_from=
 
|values_from=
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:CANInfo
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 245: Line 217:
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:Action input]] ====
+
==== [[Property:CANInfo pid]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=input
+
|name=pid
|label=input
+
|label=pid
|documentation=the decription of the input e.g. a page name, url or SMW ask query
+
|documentation=PID of this CANInfo
|type=Special:Types/Code
+
|type=Special:Types/Page
|index=4
+
|index=
 
|sortPos=
 
|sortPos=
|primaryKey=false
+
|primaryKey=
|mandatory=false
+
|mandatory=
 
|namespace=
 
|namespace=
|size=300
+
|size=
|uploadable=false
+
|uploadable=
 
|defaultValue=
 
|defaultValue=
|inputType=textarea
+
|inputType=dropdown
 
|allowedValues=
 
|allowedValues=
|values_from=
+
|values_from=concept=PID
|showInGrid=true
+
|showInGrid=
|isLink=false
+
|isLink=true
|topic=Concept:Action
+
|topic=Concept:CANInfo
 
|storemode=property
 
|storemode=property
 
}}
 
}}
[[Has type::Code]]
+
[[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:Action actionpage]] ====
+
 
 +
== Topic: PID ==
 +
=== properties of PID ===
 +
==== [[Property:PID id]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=actionpage
+
|name=id
|label=actionpage
+
|label=id
|documentation=What page will 'steer' this action?
+
|documentation=Id of diagnostic parameter
|type=Special:Types/Page
+
|type=Special:Types/Text
|index=5
+
|index=1
 
|sortPos=
 
|sortPos=
|primaryKey=false
+
|primaryKey=true
|mandatory=false
+
|mandatory=true
 
|namespace=
 
|namespace=
 
|size=
 
|size=
 
|uploadable=false
 
|uploadable=false
|defaultValue=Property:Action actionpage
+
|defaultValue=
 
|inputType=
 
|inputType=
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
|showInGrid=true
+
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:PID
 
|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>
==== [[Property:Action output]] ====
+
==== [[Property:PID name]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=output
+
|name=name
|label=output
+
|label=name
|documentation=where the output of the action should go
+
|documentation=name of parameter
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=6
+
|index=2
 
|sortPos=
 
|sortPos=
|primaryKey=
+
|primaryKey=false
|mandatory=
+
|mandatory=false
 
|namespace=
 
|namespace=
 
|size=
 
|size=
|uploadable=
+
|uploadable=false
 
|defaultValue=
 
|defaultValue=
 
|inputType=
 
|inputType=
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
|showInGrid=
+
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:PID
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 329: Line 304:
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:Action engine]] ====
+
==== [[Property:PID description]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=engine
+
|name=description
|label=engine
+
|label=description
|documentation=the template engine to be used either [[Rythm]] or [[Freemarker]]
+
|documentation=description for OBDII parameter
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=7
+
|index=3
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 345: Line 320:
 
|size=
 
|size=
 
|uploadable=false
 
|uploadable=false
|defaultValue=rythm
+
|defaultValue=
|inputType=radiobutton
+
|inputType=textarea
|allowedValues=rythm,freemarker
+
|allowedValues=
 
|values_from=
 
|values_from=
|showInGrid=true
+
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:PID
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 357: Line 332:
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 
</pre>
 
</pre>
==== [[Property:Action author]] ====
+
==== [[Property:PID links]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=author
+
|name=links
|label=author
+
|label=links
|documentation=the author of this action
+
|documentation=links for parameter
|type=Special:Types/Page
+
|type=Special:Types/Text
|index=8
+
|index=4
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 374: Line 349:
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
|inputType=combobox
+
|inputType=textarea
 
|allowedValues=
 
|allowedValues=
|values_from=namespace=User
+
|values_from=
|showInGrid=true
+
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:PID
 
|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>
==== [[Property:Action since]] ====
+
==== [[Property:PID examples]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=since
+
|name=examples
|label=since
+
|label=examples
|documentation=since when is this action available?
+
|documentation=example for parameter
|type=Special:Types/Date
+
|type=Special:Types/Text
|index=9
+
|index=5
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 402: Line 377:
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
|inputType=datepicker
+
|inputType=textarea
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
|showInGrid=true
+
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:PID
 
|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:Action comment]] ====
+
==== [[Property:PID frequency]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=comment
+
|name=frequency
|label=comment
+
|label=freq
|documentation=a comment for the action
+
|documentation=frequency on CANBus
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=10
+
|index=6
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
 
|mandatory=false
 
|mandatory=false
 
|namespace=
 
|namespace=
|size=400
+
|size=
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
Line 435: Line 410:
 
|showInGrid=false
 
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Action
+
|topic=Concept:PID
 
|storemode=property
 
|storemode=property
 
}}
 
}}

Revision as of 16:11, 10 June 2017

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]

metamodel sidif

MetaModel isA Context
"MetaModel#sidif"is sidif of it
Action needs Properties

sidif

CantripletContext isA Context
"CantripletContext#sidif"is sidif of it
CANInfo needs Properties
PID 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-06-10T15:11:16Z 2 Topics need Properties to be generated

Topic: CANInfo

properties of CANInfo

Property:CANInfo name


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

Property:CANInfo description


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

Property:CANInfo unit


{{Property
|name=unit
|label=unit
|documentation=the unit of this CANInfo
|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:CANInfo
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:CANInfo pid


{{Property
|name=pid
|label=pid
|documentation=PID of this CANInfo
|type=Special:Types/Page
|index=
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=dropdown
|allowedValues=
|values_from=concept=PID
|showInGrid=
|isLink=true
|topic=Concept:CANInfo
|storemode=property
}}
[[Has type::Page]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Topic: PID

properties of PID

Property:PID id


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

Property:PID name


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

Property:PID description


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

Property:PID links


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

Property:PID examples


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

Property:PID frequency


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