Difference between revisions of "GenerateProperties"

From BITPlan royal-family Wiki
Jump to navigation Jump to search
(transfered by WikiBackup wikiTask at 2017-10-03T16:44:11Z)
 
(created by WikiTask 2017-10-03T17:35:53Z)
Line 127: Line 127:
  
 
= result =
 
= result =
2016-02-10T06:54:11Z
+
2017-10-03T17:35:50Z
 
1 Topics need Properties to be generated
 
1 Topics need Properties to be generated
  
== Topic: Bigstock ==
+
== Topic: Action ==
=== properties of Bigstock ===
+
=== properties of Action ===
==== [[Property:Bigstock id]] ====
+
==== [[Property:Action name]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=id
+
|name=name
|label=id
+
|label=name
|documentation=the id of the bigstock photo
+
|documentation=The name of the Action
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=1
+
|index=0
 
|sortPos=
 
|sortPos=
 
|primaryKey=true
 
|primaryKey=true
 
|mandatory=true
 
|mandatory=true
 
|namespace=
 
|namespace=
|size=8
+
|size=
 
|uploadable=false
 
|uploadable=false
 
|defaultValue=
 
|defaultValue=
Line 152: Line 152:
 
|allowedValues=
 
|allowedValues=
 
|values_from=
 
|values_from=
|showInGrid=false
+
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Action
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Action servicetype]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=servicetype
 +
|label=servicetype
 +
|documentation=The type of the service
 +
|type=Special:Types/Text
 +
|index=1
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=true
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=WikiTask
 +
|inputType=radiobutton
 +
|allowedValues=WikiTask
 +
|values_from=
 +
|showInGrid=true
 
|isLink=false
 
|isLink=false
|topic=Concept:Bigstock
+
|topic=Concept:Action
 
|storemode=property
 
|storemode=property
 
}}
 
}}
Line 160: Line 188:
 
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:Action service]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=file
+
|name=service
|label=file
+
|label=service
|documentation=the downloaded bigstock file - if it is downloaded a license has been paid for
+
|documentation=The service to be used
|type=Special:Types/Page
+
|type=Special:Types/URL
 
|index=2
 
|index=2
 +
|sortPos=
 +
|primaryKey=
 +
|mandatory=
 +
|namespace=
 +
|size=
 +
|uploadable=
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Action
 +
|storemode=property
 +
}}
 +
[[Has type::URL]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Action inputtype]] ====
 +
 +
<pre>
 +
 +
{{Property
 +
|name=inputtype
 +
|label=inputtype
 +
|documentation=What is the type of the input?
 +
|type=Special:Types/Text
 +
|index=3
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=Page
 +
|inputType=radiobutton
 +
|allowedValues=Query,Page,URL
 +
|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 input]] ====
 +
 +
<pre>
 +
 +
{{Property
 +
|name=input
 +
|label=input
 +
|documentation=the decription of the input e.g. a page name, url or SMW ask query
 +
|type=Special:Types/Code
 +
|index=4
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
 
|mandatory=false
 
|mandatory=false
|namespace=File
+
|namespace=
|size=100
+
|size=300
|uploadable=true
+
|uploadable=false
 
|defaultValue=
 
|defaultValue=
 +
|inputType=textarea
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Action
 +
|storemode=property
 +
}}
 +
[[Has type::Code]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Action actionpage]] ====
 +
 +
<pre>
 +
 +
{{Property
 +
|name=actionpage
 +
|label=actionpage
 +
|documentation=What page will 'steer' this action?
 +
|type=Special:Types/Page
 +
|index=5
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=Property:Action actionpage
 
|inputType=
 
|inputType=
 
|allowedValues=
 
|allowedValues=
|values_from=namespace=File
+
|values_from=
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Action
 +
|storemode=property
 +
}}
 +
[[Has type::Page]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Action output]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=output
 +
|label=output
 +
|documentation=where the output of the action should go
 +
|type=Special:Types/Text
 +
|index=6
 +
|sortPos=
 +
|primaryKey=
 +
|mandatory=
 +
|namespace=
 +
|size=
 +
|uploadable=
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=
 +
|isLink=false
 +
|topic=Concept:Action
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Action engine]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=engine
 +
|label=engine
 +
|documentation=the template engine to be used either [[Rythm]] or [[Freemarker]]
 +
|type=Special:Types/Text
 +
|index=7
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=rythm
 +
|inputType=radiobutton
 +
|allowedValues=rythm,freemarker
 +
|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 author]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=author
 +
|label=author
 +
|documentation=the author of this action
 +
|type=Special:Types/Page
 +
|index=8
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=combobox
 +
|allowedValues=
 +
|values_from=namespace=User
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Action
 +
|storemode=property
 +
}}
 +
[[Has type::Page]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Action since]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=since
 +
|label=since
 +
|documentation=since when is this action available?
 +
|type=Special:Types/Date
 +
|index=9
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=datepicker
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Action
 +
|storemode=property
 +
}}
 +
[[Has type::Date]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Action comment]] ====
 +
 
 +
<pre>
 +
 
 +
{{Property
 +
|name=comment
 +
|label=comment
 +
|documentation=a comment for the action
 +
|type=Special:Types/Text
 +
|index=10
 +
|sortPos=
 +
|primaryKey=false
 +
|mandatory=false
 +
|namespace=
 +
|size=400
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=textarea
 +
|allowedValues=
 +
|values_from=
 
|showInGrid=false
 
|showInGrid=false
 
|isLink=false
 
|isLink=false
|topic=Concept:Bigstock
+
|topic=Concept:Action
 
|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>

Revision as of 19:35, 3 October 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]

sidif

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

2017-10-03T17:35:50Z 1 Topics need Properties to be generated

Topic: Action

properties of Action

Property:Action name


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

Property:Action servicetype


{{Property
|name=servicetype
|label=servicetype
|documentation=The type of the service
|type=Special:Types/Text
|index=1
|sortPos=
|primaryKey=false
|mandatory=true
|namespace=
|size=
|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#- }}

Property:Action service


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

Property:Action inputtype


{{Property
|name=inputtype
|label=inputtype
|documentation=What is the type of the input?
|type=Special:Types/Text
|index=3
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=Page
|inputType=radiobutton
|allowedValues=Query,Page,URL
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Action
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Action input


{{Property
|name=input
|label=input
|documentation=the decription of the input e.g. a page name, url or SMW ask query
|type=Special:Types/Code
|index=4
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=300
|uploadable=false
|defaultValue=
|inputType=textarea
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Action
|storemode=property
}}
[[Has type::Code]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Action actionpage


{{Property
|name=actionpage
|label=actionpage
|documentation=What page will 'steer' this action?
|type=Special:Types/Page
|index=5
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=Property:Action actionpage
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Action
|storemode=property
}}
[[Has type::Page]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Action output


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

Property:Action engine


{{Property
|name=engine
|label=engine
|documentation=the template engine to be used either [[Rythm]] or [[Freemarker]]
|type=Special:Types/Text
|index=7
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=rythm
|inputType=radiobutton
|allowedValues=rythm,freemarker
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Action
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Action author


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

Property:Action since


{{Property
|name=since
|label=since
|documentation=since when is this action available?
|type=Special:Types/Date
|index=9
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=datepicker
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Action
|storemode=property
}}
[[Has type::Date]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Action comment


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