Difference between revisions of "Org.simantics.document"

From Developer Documents
Jump to navigation Jump to search
(Created page with "'''org.simantics.document''' (SVN) and its associated ontology '''org.simantics.document.ontology''' ([[svn:fou...")
 
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''org.simantics.document''' ([[svn:foundation/document/trunk/org.simantics.simantics.document|SVN]]) and its associated ontology '''org.simantics.document.ontology''' ([[svn:foundation/document/trunk/org.simantics.simantics.document.ontology|SVN]]) are used to define documents in the Simantics platform.
+
The Simantics document subsystem is defined in various plugins including
  
The document data model is a '''scene graph''' which is loaded with the '''scene graph loader'''.
+
* Headless documentation model
 +
*# '''org.simantics.document''' ([[svn:foundation/document/trunk/org.simantics.simantics.document|SVN]])
 +
*# '''org.simantics.document.ontology''' ([[svn:foundation/document/trunk/org.simantics.simantics.document.ontology|SVN]])
 +
* Document editor
 +
*# '''org.simantics.document.ui''' ([[svn:foundation/document/trunk/org.simantics.simantics.document.ui|SVN]])
 +
*# '''org.simantics.document.ui.ontology''' ([[svn:foundation/document/trunk/org.simantics.simantics.document.ui.ontology|SVN]])
 +
* Scene graph
 +
*# '''org.simantics.scenegraph''' ([[svn:2d/trunk/org.simantics.scenegraph|SVN]])
 +
*# '''org.simantics.scenegraph.ontology''' ([[svn:2d/trunk/org.simantics.scenegraph.ontology|SVN]])
 +
*# '''org.simantics.scenegraph.loader''' ([[svn:2d/trunk/org.simantics.scenegraph.loader|SVN]])
  
A standard document scene graph implements '''org.simantics.document.WikiDocumentNode''' which supports translation into Wiki text.
+
The document data model is a '''scene graph''' which is loaded with the '''scene graph loader''' described [[org.simantics.scenegraph.loader|here]].
  
Standard user interface editor is defined in '''org.simantics.document.ui''' ([[svn:foundation/document/trunk/org.simantics.simantics.document.ui|SVN]]) and its associated ontology '''org.simantics.document.ui.ontology'''
+
= Basic use =
 +
 
 +
Document scene graph models can be loaded into multiple scene graph implementations. The default implementation (via plain '''org.simantics.scenegraph.loader.ScenegraphLoader''' adaption) can be used to transform the document model into a Wiki document via the interface '''org.simantics.document.WikiDocumentNode'''.
 +
 
 +
<pre>
 +
 
 +
ScenegraphLoaderProcess loader = new ScenegraphLoaderProcess(new Composite());
 +
WikiDocumentNodeImpl node = loader.load(graph, desc, ScenegraphLoaderUtils.getRuntime(graph, context));
 +
 
 +
</pre>
 +
 
 +
= Nodes =
 +
 
 +
The following framework nodes are provided
 +
 
 +
* '''Composite''' is a container for other nodes
 +
* '''Wiki''' is a Wiki text node
 +
* '''Diagram''' is an embedded diagram container
 +
 
 +
= Modelling =
 +
 
 +
The document scene graph model is a structural model with procedural parameter support. The means that both the structure and content of the scene graph nodes can be defined as Values evaluated in Variable context. The document Variable context can be used to access the '''document context''' and the '''runtime context'''. Typical modelling constructs are
 +
 
 +
* '''Encapsulated types with interface properties''' which contain a scene graph fragment with some lifted parameters
 +
* '''Procedural text''' where a fragment of Wiki text is computed from the '''runtime context'''
 +
 
 +
= User interface =
 +
 
 +
A document editor is modelled in '''org.simantics.document.ui.ontology'''. The corresponding editor class is '''org.simantics.document.ui.DocumentEditor'''.

Latest revision as of 05:29, 2 December 2011

The Simantics document subsystem is defined in various plugins including

  • Headless documentation model
    1. org.simantics.document (SVN)
    2. org.simantics.document.ontology (SVN)
  • Document editor
    1. org.simantics.document.ui (SVN)
    2. org.simantics.document.ui.ontology (SVN)
  • Scene graph
    1. org.simantics.scenegraph (SVN)
    2. org.simantics.scenegraph.ontology (SVN)
    3. org.simantics.scenegraph.loader (SVN)

The document data model is a scene graph which is loaded with the scene graph loader described here.

Basic use

Document scene graph models can be loaded into multiple scene graph implementations. The default implementation (via plain org.simantics.scenegraph.loader.ScenegraphLoader adaption) can be used to transform the document model into a Wiki document via the interface org.simantics.document.WikiDocumentNode.


ScenegraphLoaderProcess loader = new ScenegraphLoaderProcess(new Composite());
WikiDocumentNodeImpl node = loader.load(graph, desc, ScenegraphLoaderUtils.getRuntime(graph, context));

Nodes

The following framework nodes are provided

  • Composite is a container for other nodes
  • Wiki is a Wiki text node
  • Diagram is an embedded diagram container

Modelling

The document scene graph model is a structural model with procedural parameter support. The means that both the structure and content of the scene graph nodes can be defined as Values evaluated in Variable context. The document Variable context can be used to access the document context and the runtime context. Typical modelling constructs are

  • Encapsulated types with interface properties which contain a scene graph fragment with some lifted parameters
  • Procedural text where a fragment of Wiki text is computed from the runtime context

User interface

A document editor is modelled in org.simantics.document.ui.ontology. The corresponding editor class is org.simantics.document.ui.DocumentEditor.