A program to recognize and reward our most engaged community members
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="../../../documentation2html.xsl"?><p1:documents xmlns:p1="http://rapid-i.com/schemas/documentation/reference/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rapid-i.com/schemas/documentation/reference/1.0 http://rapid-i.com/schemas/documentation/reference/1.0/documentation.xsd";> <!-- each operator should have a key that consists of "operator." plus the operator's key. --> <operator key="operator.retrieve" locale="en" version="5.1.012"> <title>Retrieve</title> <synopsis>This operator reads an object from the data repository.</synopsis> <text> <paragraph>This operator can be used to access the repositories. It should replace all file access, since it provides full meta data processing, which eases the usage of RapidMiner a lot. In contrast to accessing a raw file, it provides the complete meta data of the data, so all meta data transformations are possible.</paragraph> <paragraph>An easier way to load an object from the repository is to drag and drop the required object from the Repositories View. This will automatically insert a Retrieve operator with correct path of the desired object.</paragraph> <paragraph>This operator has no input port. All it requires is a valid value in <em>repository entry</em> parameter.</paragraph> </text> <outputPorts> <port name="output" type="com.rapidminer.example.ExampleSet">It returns the object whose path was specified in <em>repository entry</em> parameter.</port> </outputPorts> <parameters> <!-- description of the parameters and the corresponding values --> <parameter key="repository_entry" type="string"> <paragraph>A valid path should be specified here in order to load an object. This parameter references an entry in the repository which will be returned as the output of this operator. Repository locations are resolved relative to the repository folder containing the current process. Folders in the repository are separated by a forward slash (/), a ".." references the parent folder. A leading forward slash references the root folder of the repository containing the current process. A leading double forward slash is interpreted as an absolute path starting with the name of a repository.</paragraph> <paragraph> <ul> <li>'MyData' looks up an entry 'MyData' in the same folder as the current process.</li> <li>'../Input/MyData' looks up an entry 'MyData' located in a folder 'Input' next to the folder containing the current process.</li> <li>'/data/Model' looks up an entry 'Model' in a top-level folder 'data' in the repository holding the current process</li> <li>'//Samples/data/Iris' looks up the Iris data set in the 'Samples' repository.</li> </ul> </paragraph> </parameter> <!-- ... --> </parameters> <relatedDocuments> <!-- ... --> </relatedDocuments> <tutorialProcesses> <tutorialProcess key="process.retrieve.retrieve_golf" title="Retrieving Golf from Repository"> <description> <paragraph>The Example Process loads Golf data set from repository. <em>Repository entry</em> parameter is provided with path '//Samples/data/Golf', thus Golf data set is returned from Samples repository. As it can be seen in Results Workspace, Retrieve operator loads both data and meta data.</paragraph> <!-- tutorialProcess description: What is done and shown here? You can use formated text here --> </description> <!-- Copy process from RapidMiner's XML view to here --> <process version="5.1.011"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="5.1.011" expanded="true" name="Process"> <process expanded="true" height="377" width="681"> <operator activated="true" class="retrieve" compatibility="5.1.011" expanded="true" height="60" name="Retrieve" width="90" x="380" y="30"> <parameter key="repository_entry" value="//Samples/data/Golf"/> </operator> <connect from_op="Retrieve" from_port="output" to_port="result 1"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> </process> </operator> </process> </tutorialProcess> </tutorialProcesses> </operator></p1:documents>
Urhixidur wrote:(Note also how the 'key' used here is NOT the 'key' defined in the operator's XML description: it is instead the 'shortName' element prefixed to the 'name' element (with substitution of underscores for spaces); this is a little confusing)
key = XMLTools.getTagContents(element, "key", true);
Marcin wrote:Currently we try to change the documentation system. The loading of the help from the html files is (or will be in near future) deprecated. For greater flexibility we will use XML files which is already done for a lot of our operators. If you take a look on the current code in the SVN repository you will notice a file "rm_doc.jar" in the lib directory. All documentation is stored here in a directory structure induced by the keys in the "OperatorsCore.xml" file. Every documentation is now a XML file and the issue with the prefix is already fixed for this mechanism and should work for your extension.To write your own XML-documentation just create a directory with the name of your plugin namespace under the "resources" directory and then further subdirectories to match the group keys in your OperatorsXXX.xml file for a given operator. Then name a XML file after the key of your operator and your are done.
<project name="RapidMiner_Extension_LTF"> <property name="extension.name" value="LTFReader" /> <!-- extension.name.long must be "RapidMiner " + extension.name + " Extension" --> <property name="extension.name.long" value="RapidMiner LTFReader Extension" /> <property name="extension.namespace" value="LTFDataReader" /> <property name="extension.operatorDefinition" value="/com/rapidminer/resources/OperatorsLTFReader.xml" />
<operators name="LTFDataReader" version="5.0" docbundle="com/rapidminer/resources/i18n/OperatorsDocLTFReader"> <group key=""> <group key="import"> <group key="data"> <operator> <key>stream_trace</key> <class>com.rapidminer.operator.io.CachedLTFExampleSource</class>
<operator> <key>stream_trace</key> <name>Stream LTF Trace</name> <shortName>LTFDataReader</shortName>
String prefix = opDesc.getProvider().getPrefix();prefix = Character.toUpperCase(prefix.charAt(0)) + prefix.substring(1);operatorWikiName = prefix + ":" + operatorWikiName;
Urhixidur wrote:Fascinating. I thought the html took precedence over the xml, because that's what is currently displayed in the GUI (as of rev 734).What about /resources/com/rapidminer/resources/i18n/OperatorsCoreDocumentation.xml? It has an 'operator' element with sub-elements 'name' ("Retrieve"), 'synopsis' and 'help' (containing a rudimentary description). By comparison, /resources/com/rapidminer/resources/OperatorsCore.xml has an 'operator' element with sub-elements 'key' ("retrieve"), 'class' ("com.rapidminer.operator.io.RepositorySource"), 'icon', and 'replaces'. At its root, OperatorsCore.xml sets docbundle to OperatorsCoreDocumentation. Meanwhile, core/repository_access/retrieve.xml opens with an 'operator' element whose key attribute (not a sub-element, mind you) is "operator.retrieve".I also note the stream_database operator is not in lib/rm_doc.jar (there is no com.import.data in there), which explains why its html help is being displayed.
Urhixidur wrote:An interesting aspect of the xml documentation in rm_doc.jar is the tutorialProcess element. I want to set one up, but this requires sample data to be included. Is there a way to add sample data to the RapidMiner repositories (a new Samples:data entry) as part of extension installation?Oh, I see here (http://rapid-i.com/rapidforum/index.php/topic,5696.0.html) that it can't be done. With the RapidMiner sample data repositories. Is there a way my extension could install its own little data repository?