WikiContext

From BITPlan Wiki
Jump to navigation Jump to search
Context
edit
name  WikiContext
since  2015-08-19
updated  
copyright  
master  master.bitplan.com


topics

 namepluralNameiconiconUrldocumentationwikiDocumentationdefaultstoremodelistLimitcargoheaderTabscontext
ExtensionExtensionExtensionsExtension-Icon-64px.png
/images/master/a/a5/Extension-Icon-64px.png
A MediaWiki extensionpropertyWikiContext

see

WikiTask

login
reset

dialog smw dialog sidif no dialog smw no dialog sidif
runtemplate -> TopicGenerator2015/WikiContext runtemplate -> TopicGenerator2015/WikiContext runtemplate -> TopicGenerator2015/WikiContext runtemplate -> TopicGenerator2015/WikiContext


sidif

#Context
WikiContext isA Context
"WikiContext" is name of it
# Model
Wiki isA Topic
Wiki_id addsTo it
siteurl addsTo it
scriptPath addsTo it
Wiki_purpose addsTo it
Wiki_language addsTo it
Wiki_since addsTo it
Wiki_until addsTo it
Wiki_backup addsTo it
Wiki_server addsTo it
Wiki_safes addsTo it
Wiki_owner addsTo it
Wiki_project addsTo it
"see http://en.wikipedia.org/wiki/Wiki" is wikiDocumentation of it
"A wiki is an application, typically a web application, which allows collaborative modification, extension, or deletion of its content and structure. In a typical wiki, text is written using a simplified markup language (known as 'wiki markup') or a rich-text editor. While a wiki is a type of content management system, it differs from a blog or most other such systems in that the content is created without any defined owner or leader, and wikis have little implicit structure, allowing structure to emerge according to the needs of the users." is documentation of it
"File:48px-Mediawiki logo reworked.png" is icon of it
"/images/master/9/95/48px-Mediawiki_logo_reworked.png" is iconUrl of it
"property" is defaultstoremode of it
"WikiContext" is context of it
#
# Properties
#
# Property id
Wiki_id isA Property
"Text" is type of it
"id" is name of it
1 is index of it
true is primaryKey of it
true is mandatory of it
"Wiki" is topic of it 
# Property purpose
Wiki_purpose isA Property
"The purpose of the wiki" is documentation of it
"Text" is type of it
"purpose" is name of it
"purpose" is label of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"Wiki" is topic of it 
# Property language
Wiki_language isA Property
"The language of the wiki" is documentation of it
"Text" is type of it
"language" is name of it
"language" is label of it
false is primaryKey of it
true is mandatory of it
false is uploadable of it
"en" is defaultValue of it
"radiobutton" is inputType of it
"de,en" is allowedValues of it
"Wiki" is topic of it 
#Property since
Wiki_since isA Property
"since" is name of it
"since" is label of it
"Date" is type of it
5 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"datepicker" is inputType of it
"when was the wiki or its predecessor initialized?" is documentation of it
true is showInGrid of it
false is isLink of it
"Wiki" is topic of it
#Property until
Wiki_until isA Property
"until" is name of it
"until" is label of it
"Date" is type of it
6 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"datepicker" is inputType of it
"when was the wiki terminated" is documentation of it
true is showInGrid of it
false is isLink of it
"Wiki" is topic of it
#Property backup
Wiki_backup isA Property
"backup" is name of it
"backup" is label of it
"Date" is type of it
7 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"datepicker" is inputType of it
"when was the the most recent backup of the wiki?" is documentation of it
true is showInGrid of it
false is isLink of it
"Wiki" is topic of it
#Property server
Wiki_server isA Property
"server" is name of it
"server" is label of it
"Page" is type of it
8 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"The server/computer where the wiki runs" is documentation of it
true is showInGrid of it
false is isLink of it
"Wiki" is topic of it
#Property safes
Wiki_safes isA Property
"safes" is name of it
"safes" is label of it
"Text" is type of it
9 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"backup servers - multiple ; separated possible" is documentation of it
true is showInGrid of it
false is isLink of it
"Wiki" is topic of it
#Property owner
Wiki_owner isA Property
"owner" is name of it
"owner" is label of it
"Page" is type of it
10 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"The organization or person owning the data in the wiki" is documentation of it
true is showInGrid of it
false is isLink of it
"Wiki" is topic of it
#Property project
Wiki_project isA Property
"project" is name of it
"project" is label of it
"Page" is type of it
11 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"project the wiki is motivated by" is documentation of it
true is showInGrid of it
false is isLink of it
"Wiki" is topic of it
#
# TransferPage
#
TransferPage isA Topic
page addsTo it
"a Wiki page which might be bulk-transferred to another Wiki" is documentation of it
"subobject" is defaultstoremode of it
"WikiContext" is context of it
"File:Document_up.png" is icon of it
"/images/4/47/Document_up.png" is iconUrl of it
"WikiContext" is context of it
#
# Extension
#
Extension isA Topic
"A MediaWiki extension" is documentation of it
"File:Extension-Icon-64px.png" is icon of it
"/images/master/a/a5/Extension-Icon-64px.png" is iconUrl of it
"property" is defaultstoremode of it
"WikiContext" is context of it
Extension_name addsTo it
Extension_url addsTo it
Extension_purpose addsTo it
Extension_since addsTo it
# Property name
Extension_name isA Property
"Text" is type of it
"name" is name of it
1 is index of it
true is primaryKey of it
true is mandatory of it
"Extension" is topic of it 
# Property url
Extension_url isA Property
"Url" is type of it
"url" is name of it
2 is index of it
false is primaryKey of it
false is mandatory of it
"Extension" is topic of it 
# Property purpose
Extension_purpose isA Property
"The purpose of the extension" is documentation of it
"Text" is type of it
"purpose" is name of it
3 is index of it
"purpose" is label of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"Extension" is topic of it 
#Property since
Extension_since isA Property
"since" is name of it
"since" is label of it
"Date" is type of it
4 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"datepicker" is inputType of it
"when was the extension first installed" is documentation of it
true is showInGrid of it
false is isLink of it
"Extension" is topic of it
#Property until
Extension_until isA Property
"until" is name of it
"until" is label of it
"Date" is type of it
5 is index of it
false is primaryKey of it
false is mandatory of it
false is uploadable of it
"datepicker" is inputType of it
"when was the extension uninstall / unuseable" is documentation of it
true is showInGrid of it
false is isLink of it
"Extension" is topic of it
#
# TopicLinks
#
TopicLinks_pagesToTransfer isA TopicLink
"pagesToTransfer" is name of it
"wiki" is sourceRole of it
false is sourceMultiple of it
"Wiki" is source of it
"transferPage" is targetRole of it
true is targetMultiple of it
"TransferPage" is target of it
TopicLinks_installedExtensions isA TopicLink
"installedExtensions" is name of it
"wiki" is sourceRole of it
true is sourceMultiple of it
"Wiki" is source of it
"extensions" is targetRole of it
true is targetMultiple of it
"Extension" is target of it

Topic Wiki tasks

login
reset

Wiki sidif smw
template runtemplate -> Template:Wiki runtemplate -> Template:Wiki
form runtemplate -> Form:Wiki runtemplate -> Form:Wiki
list of runtemplate -> List of Wikis runtemplate -> List of Wikis
category runtemplate ->Category:Wiki runtemplate ->Category:Wiki
properties runtemplate -> Concept:Wiki/properties runtemplate -> Concept:Wiki/properties
help runtemplate -> Help:Wiki runtemplate -> Help:Wiki
instances runtemplate -> Wikis runtemplate -> Wikis
concept runtemplate -> Concept:Wiki runtemplate -> Concept:Wiki
java code runtemplate -> WikiContext#Wiki JavaCode runtemplate -> WikiContext#Wiki JavaCode
{{wikitask|cmd=runtemplate|input={{{input|}}}|params=sidifInput:{{FULLPAGENAME}}#{{{input|}}},contextName:{{{context|}}},maintopicName:{{{topic|}}}|engine=Rythm|template=SiDIFTemplates#javacodegen|targetpage={{FULLPAGENAMEE}}#{{{topic|}}} JavaCode}}


login
reset

TransferPage sidif smw
template runtemplate -> Template:TransferPage runtemplate -> Template:TransferPage
form runtemplate -> Form:TransferPage runtemplate -> Form:TransferPage
list of runtemplate -> List of TransferPages runtemplate -> List of TransferPages
category runtemplate ->Category:TransferPage runtemplate ->Category:TransferPage
properties runtemplate -> Concept:TransferPage/properties runtemplate -> Concept:TransferPage/properties
help runtemplate -> Help:TransferPage runtemplate -> Help:TransferPage
instances runtemplate -> TransferPages runtemplate -> TransferPages
concept runtemplate -> Concept:TransferPage runtemplate -> Concept:TransferPage
java code runtemplate -> WikiContext#TransferPage JavaCode runtemplate -> WikiContext#TransferPage JavaCode
{{wikitask|cmd=runtemplate|input={{{input|}}}|params=sidifInput:{{FULLPAGENAME}}#{{{input|}}},contextName:{{{context|}}},maintopicName:{{{topic|}}}|engine=Rythm|template=SiDIFTemplates#javacodegen|targetpage={{FULLPAGENAMEE}}#{{{topic|}}} JavaCode}}


Wiki JavaCode

java code

@// 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
  com.bitplan.topic.TopicManager topicManager
}

@def static {

  /**
   * Base class
   */
  static abstract class TopicBase {
    /**
     * initialize
     */
    public void init(TripleQuery query) {
    }
  } // TopicBase
 /**
  * Wiki
  * A wiki is an application, typically a web application, which allows collaborative modification, extension, or deletion of its content and structure. In a typical wiki, text is written using a simplified markup language (known as 'wiki markup') or a rich-text editor. While a wiki is a type of content management system, it differs from a blog or most other such systems in that the content is created without any defined owner or leader, and wikis have little implicit structure, allowing structure to emerge according to the needs of the users.
  */
  static class Wiki extends TopicBase {
    String pageid;
    String id;
    String siteurl;
    String scriptPath;
    String language;

    public String getId() { return id; }
    public void setId(String pId) { id=pId; }
    public String getSiteurl() { return siteurl; }
    public void setSiteurl(String pSiteurl) { siteurl=pSiteurl; }
    public String getScriptPath() { return scriptPath; }
    public void setScriptPath(String pScriptPath) { scriptPath=pScriptPath; }
    public String getLanguage() { return language; }
    public void setLanguage(String pLanguage) { language=pLanguage; }
    /**
     * convert this Wiki to a JSON string
     */
    public String toJson() { return JSON.toJSONString(this); }
 
    /**  
     * get the pageid for this topic
     */
    public String getPageid() { return pageid; };

    /**
     * default constructor for Wiki
     */
    public Wiki() {}

    /**
     * construct a Wiki from the given Triple
     * @param query - the TripleQuery to get the triples from
     * @param pWikiTriple - the triple to construct me from
     */
    public Wiki(TripleQuery query,Triple pWikiTriple) {
      this(query,pWikiTriple.getSubject().toString());
    } // constructor

    /**
     * construct a Wiki from the given pageId
     * @param query - the TripleQuery to get the triples from
     * @param pageid - pageid
     */
    public Wiki(TripleQuery query,String pageid) {
      this.pageid=pageid;
      Triple idTriple=query.selectSingle(pageid,"id",null);
      if (idTriple==null)
        idTriple=query.selectSingle(pageid,"Property:Wiki_id",null);
      if (idTriple!=null) 
        id=idTriple.getObject().toString();
      Triple siteurlTriple=query.selectSingle(pageid,"siteurl",null);
      if (siteurlTriple==null)
        siteurlTriple=query.selectSingle(pageid,"Property:Wiki_siteurl",null);
      if (siteurlTriple!=null) 
        siteurl=siteurlTriple.getObject().toString();
      Triple scriptPathTriple=query.selectSingle(pageid,"scriptPath",null);
      if (scriptPathTriple==null)
        scriptPathTriple=query.selectSingle(pageid,"Property:Wiki_scriptPath",null);
      if (scriptPathTriple!=null) 
        scriptPath=scriptPathTriple.getObject().toString();
      Triple languageTriple=query.selectSingle(pageid,"language",null);
      if (languageTriple==null)
        languageTriple=query.selectSingle(pageid,"Property:Wiki_language",null);
      if (languageTriple!=null) 
        language=languageTriple.getObject().toString();
      init(query);
    } // constructor for Wiki
    
    // >>>{user defined topic code}{Wiki}{Wiki}
    // <<<{user defined topic code}{Wiki}{Wiki}
  } // class Wiki
  /**
   * Manager for Wiki
   */
  public static class WikiManager extends TopicBase {
 
    public String topicName="Wiki";
    public List<Wiki> mWikis=new ArrayList<Wiki>();
    public Map<String,Wiki> mWikiMap=new LinkedHashMap<String,Wiki>();

    /**
     *  add a new Wiki 
     */
    public Wiki add(Wiki pWiki) {
      mWikis.add(pWiki);
      mWikiMap.put(pWiki.getPageid(),pWiki);
      return pWiki;
    }

    /**
     *  add a new Wiki from the given triple
     */
    public Wiki add(TripleQuery query,Triple pWikiTriple) {
      Wiki lWiki=new Wiki(query,pWikiTriple);
      add(lWiki);
      return lWiki;
    }

    // convert this manager to json format 
    public String toJson() { return JSON.toJSONString(this); }

    // default constructor 
    public WikiManager() {}

    // construct me from the given triple Query query
    public WikiManager(TripleQuery query) {
      // first query the SiDIF bases triplestore
      TripleQuery lWikiQuery=query.query(null,"isA","Wiki");
      for (Triple lWikiTriple:lWikiQuery.getTriples()) {
        add(query,lWikiTriple);
      }
      // then the SMW triplestore
      lWikiQuery=query.query(null,"Property:IsA","Wiki");
      for (Triple lWikiTriple:lWikiQuery.getTriples()) {
        add(query,lWikiTriple);
      }
      init(query);
    } // constructor for Wiki Manager
    
    // >>>{user defined topicmanager code}{Wiki}{Wiki}
    // <<<{user defined topicmanager code}{Wiki}{Wiki}
  } // class Wiki Manager
 /**
  * TransferPage
  * 
  */
  static class TransferPage extends TopicBase {
    String pageid;
    String page;
    String wiki;

    public String getPage() { return page; }
    public void setPage(String pPage) { page=pPage; }
    public String getWiki() { return wiki; }
    public void setWiki(String pWiki) { wiki=pWiki; }
    /**
     * convert this TransferPage to a JSON string
     */
    public String toJson() { return JSON.toJSONString(this); }
 
    /**  
     * get the pageid for this topic
     */
    public String getPageid() { return pageid; };

    /**
     * default constructor for TransferPage
     */
    public TransferPage() {}

    /**
     * construct a TransferPage from the given Triple
     * @param query - the TripleQuery to get the triples from
     * @param pTransferPageTriple - the triple to construct me from
     */
    public TransferPage(TripleQuery query,Triple pTransferPageTriple) {
      this(query,pTransferPageTriple.getSubject().toString());
    } // constructor

    /**
     * construct a TransferPage from the given pageId
     * @param query - the TripleQuery to get the triples from
     * @param pageid - pageid
     */
    public TransferPage(TripleQuery query,String pageid) {
      this.pageid=pageid;
      Triple pageTriple=query.selectSingle(pageid,"page",null);
      if (pageTriple==null)
        pageTriple=query.selectSingle(pageid,"Property:TransferPage_page",null);
      if (pageTriple!=null) 
        page=pageTriple.getObject().toString();
      Triple wikiTriple=query.selectSingle(pageid,"wiki",null);
      if (wikiTriple==null)
        wikiTriple=query.selectSingle(pageid,"Property:TransferPage_wiki",null);
      if (wikiTriple!=null) 
        wiki=wikiTriple.getObject().toString();
      init(query);
    } // constructor for TransferPage
    
    // >>>{user defined topic code}{TransferPage}{TransferPage}
    // <<<{user defined topic code}{TransferPage}{TransferPage}
  } // class TransferPage
  /**
   * Manager for TransferPage
   */
  public static class TransferPageManager extends TopicBase {
 
    public String topicName="TransferPage";
    public List<TransferPage> mTransferPages=new ArrayList<TransferPage>();
    public Map<String,TransferPage> mTransferPageMap=new LinkedHashMap<String,TransferPage>();

    /**
     *  add a new TransferPage 
     */
    public TransferPage add(TransferPage pTransferPage) {
      mTransferPages.add(pTransferPage);
      mTransferPageMap.put(pTransferPage.getPageid(),pTransferPage);
      return pTransferPage;
    }

    /**
     *  add a new TransferPage from the given triple
     */
    public TransferPage add(TripleQuery query,Triple pTransferPageTriple) {
      TransferPage lTransferPage=new TransferPage(query,pTransferPageTriple);
      add(lTransferPage);
      return lTransferPage;
    }

    // convert this manager to json format 
    public String toJson() { return JSON.toJSONString(this); }

    // default constructor 
    public TransferPageManager() {}

    // construct me from the given triple Query query
    public TransferPageManager(TripleQuery query) {
      // first query the SiDIF bases triplestore
      TripleQuery lTransferPageQuery=query.query(null,"isA","TransferPage");
      for (Triple lTransferPageTriple:lTransferPageQuery.getTriples()) {
        add(query,lTransferPageTriple);
      }
      // then the SMW triplestore
      lTransferPageQuery=query.query(null,"Property:IsA","TransferPage");
      for (Triple lTransferPageTriple:lTransferPageQuery.getTriples()) {
        add(query,lTransferPageTriple);
      }
      init(query);
    } // constructor for TransferPage Manager
    
    // >>>{user defined topicmanager code}{TransferPage}{TransferPage}
    // <<<{user defined topicmanager code}{TransferPage}{TransferPage}
  } // class TransferPage Manager

}
@{
WikiManager mWikiManager=new WikiManager(query);
TransferPageManager mTransferPageManager=new TransferPageManager(query);
@mWikiManager.toJson();
@mTransferPageManager.toJson();

}

runtemplate -> WikiContext#JavaCodeTest