Changeset 5654
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/src/docbook/developerdoc/extensions.xml
r5640 r5654 1479 1479 <menuchoice><guimenu>Extensions</guimenu></menuchoice> 1480 1480 menu. Actions should implement the interface: <interfacename 1481 docapi="net.sf.basedb.clients.web.extensions.menu"> net.sf.basedb.clients.web.extensions.menu.MenuItemAction</interfacename>1481 docapi="net.sf.basedb.clients.web.extensions.menu">MenuItemAction</interfacename> 1482 1482 </para> 1483 1483 … … 1493 1493 <para> 1494 1494 BASE ships with two action factories: 1495 <classname docapi="net.sf.basedb.clients.web.extensions.menu"> 1496 net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory 1497 </classname> and 1498 <classname docapi="net.sf.basedb.clients.web.extensions.menu"> 1499 net.sf.basedb.clients.web.extensions.menu.PermissionMenuItemFactory 1500 </classname>. 1495 <classname docapi="net.sf.basedb.clients.web.extensions.menu">FixedMenuItemFactory</classname> and 1496 <classname docapi="net.sf.basedb.clients.web.extensions.menu">PermissionMenuItemFactory</classname>. 1501 1497 1502 1498 The fixed factory provides a menu that is the same for all users. … … 1513 1509 be extended with extra buttons. Actions should implement 1514 1510 the interface: <interfacename 1515 docapi="net.sf.basedb.clients.web.extensions.toolbar"> 1516 net.sf.basedb.clients.web.extensions.toolbar.ButtonAction 1517 </interfacename>. 1511 docapi="net.sf.basedb.clients.web.extensions.toolbar">ButtonAction</interfacename>. 1518 1512 Button actions are very simple and only need to provide things like 1519 1513 a title, tooltip, on-click script, etc. This extension point has … … 1525 1519 <para> 1526 1520 BASE ships with two action factories: 1527 <classname docapi="net.sf.basedb.clients.web.extensions.toolbar"> 1528 net.sf.basedb.clients.web.extensions.toolbar.FixedButtonFactory 1529 </classname> and 1530 <classname docapi="net.sf.basedb.clients.web.extensions.toolbar"> 1531 net.sf.basedb.clients.web.extensions.toolbar.PermissionButtonFactory 1532 </classname>. 1521 <classname docapi="net.sf.basedb.clients.web.extensions.toolbar">FixedButtonFactory</classname> and 1522 <classname docapi="net.sf.basedb.clients.web.extensions.toolbar">PermissionButtonFactory</classname>. 1533 1523 1534 1524 The fixed factory provides a toolbar button that is the same for all users. … … 1545 1535 Most item edit dialogs can be extended with additional tabs. 1546 1536 Actions should implement the interface: <interfacename 1547 docapi="net.sf.basedb.clients.web.extensions.tabcontrol"> 1548 net.sf.basedb.clients.web.extensions.tabcontrol.TabAction 1549 </interfacename>. 1537 docapi="net.sf.basedb.clients.web.extensions.tabcontrol">TabAction</interfacename>. 1550 1538 The actions are, in principle, simple and only need to 1551 1539 provide a title and content (HTML). The action may also provide … … 1557 1545 <para> 1558 1546 BASE ships with two action factories: 1559 <classname docapi="net.sf.basedb.clients.web.extensions.tabcontrol"> 1560 net.sf.basedb.clients.web.extensions.tabcontrol.FixedTabFactory 1561 </classname> and 1562 <classname docapi="net.sf.basedb.clients.web.extensions.tabcontrol"> 1563 net.sf.basedb.clients.web.extensions.tabcontrol.IncludeContentTabFactory 1564 </classname>. 1547 <classname docapi="net.sf.basedb.clients.web.extensions.tabcontrol">FixedTabFactory</classname> and 1548 <classname docapi="net.sf.basedb.clients.web.extensions.tabcontrol">IncludeContentTabFactory</classname>. 1565 1549 1566 1550 The fixed factory provides a tab with fixed content that same for all users … … 1590 1574 the edit form is saved. Each edit-dialog extension point has a corresponding 1591 1575 on-save extension point. Actions should implement the interface: <interfacename 1592 docapi="net.sf.basedb.clients.web.extensions.edit"> 1593 net.sf.basedb.clients.web.extensions.edit.OnSaveAction 1594 </interfacename>. 1576 docapi="net.sf.basedb.clients.web.extensions.edit">OnSaveAction</interfacename>. 1595 1577 1596 1578 This interface define three callback methods that BASE will call when … … 1612 1594 to the toolbar extension points and actions should implement 1613 1595 the interface: <interfacename 1614 docapi="net.sf.basedb.clients.web.extensions.toolbar"> 1615 net.sf.basedb.clients.web.extensions.toolbar.ButtonAction 1616 </interfacename>. 1596 docapi="net.sf.basedb.clients.web.extensions.toolbar">ButtonAction</interfacename>. 1617 1597 </para> 1618 1598 … … 1637 1617 kind of data you have. BASE ships with an extension 1638 1618 (<classname docapi="net.sf.basedb.clients.web.extensions">MAPlotFactory</classname>) 1639 that creates 1640 MA plots and Correction factor plots for 2-channel bioassays. 1641 Actions should implement 1642 the interface: <interfacename 1643 docapi="net.sf.basedb.clients.web.extensions.plot"> 1644 net.sf.basedb.clients.web.extensions.plot.OverviewPlotAction 1645 </interfacename>. A single action generates a sub-tab in the 1646 <guilabel>Overview plots</guilabel> tab. The sub-tab may contain 1647 one or more images. Each image is defined by a 1619 that creates MA plots and Correction factor plots for 2-channel bioassays. 1620 Actions should implement the interface: 1621 <interfacename docapi="net.sf.basedb.clients.web.extensions.plot">OverviewPlotAction</interfacename>. 1622 A single action generates a sub-tab in the <guilabel>Overview plots</guilabel> tab. 1623 The sub-tab may contain one or more images. Each image is defined by a 1648 1624 <interfacename docapi="net.sf.basedb.clients.web.extensions.plot">PlotGenerator</interfacename> 1649 1625 which sets the size of the image and provides an URL to a servlet that generates 1650 the actual image. 1626 the actual image. It is recommended that the servlet cache images since the 1627 data in a bioassay set never changes. The BASE core API provides a 1628 system-managed file cache that is suitable for this. Call 1629 <methodname>Application.getStaticCache()</methodname> to get a 1630 <classname docapi="net.sf.basedb.util">StaticCache</classname> instance. 1631 See the source code for the core 1632 <classname docapi="net.sf.basedb.clients.web.servlet">PlotServlet</classname> 1633 for details of how to use the cache. 1651 1634 </para> 1652 1635 … … 1666 1649 always return null). There is also no meaning for extensions to specify 1667 1650 a <interfacename>RendererFactory</interfacename>. Service actions should 1668 implement the interface: <interfacename 1669 docapi="net.sf.basedb.clients.web.extensions.service"> 1670 net.sf.basedb.clients.web.extensions.service.ServiceControllerAction 1671 </interfacename>. 1651 implement the interface: 1652 <interfacename docapi="net.sf.basedb.clients.web.extensions.service">ServiceControllerAction</interfacename>. 1672 1653 1673 1654 The interface provides <methodname>start()</methodname> and … … 1687 1668 in BASE. This is a core extension point and is available 1688 1669 independently of the web client. Actions should implement 1689 the interface: <interfacename 1690 docapi="net.sf.basedb.util.uri"> 1691 net.sf.basedb.util.uri.ConnectionManagerFactory 1692 </interfacename>. 1670 the interface: 1671 <interfacename docapi="net.sf.basedb.util.uri">ConnectionManagerFactory</interfacename>. 1693 1672 </para> 1694 1673 … … 1696 1675 The <methodname>getDisplayName()</methodname> and <methodname>getDescription()</methodname> 1697 1676 methods are used in the gui when a user manually selects which connection 1698 manager to use. The <methodname>supports( )</methodname> is used when auto-selecting1699 a connection manager base on the URI of the file.1677 manager to use. The <methodname>supports(URI)</methodname> is used when auto-selecting 1678 a connection manager based on the URI of the resource. 1700 1679 </para> 1701 1680 … … 1716 1695 <title>Fileset validators</title> 1717 1696 1718 <para> 1719 1720 </para> 1697 <itemizedlist> 1698 <title>See also</title> 1699 <listitem><para><xref linkend="core_api.data_in_files" /></para></listitem> 1700 <listitem><para><xref linkend="data_api.platforms" /></para></listitem> 1701 </itemizedlist> 1702 1703 <para> 1704 In those cases where files are used to store data instead 1705 of importing it to the database, BASE can use extensions to 1706 check that the supplied files are valid and also to extract 1707 metadata from the files. For example, the 1708 <classname docapi="net.sf.basedb.util.affymetrix">CelValidationAction</classname> 1709 is used to check if a file is a valid Affymetrix CEL file and 1710 to extract data headers and the number of spots from it. 1711 </para> 1712 1713 <para> 1714 Validation and metadata extraction actions should implement 1715 the <interfacename docapi="net.sf.basedb.util.fileset">ValidationAction</interfacename> 1716 interface. This is a core extension point and is available 1717 independently of the web client. 1718 </para> 1719 1720 <para> 1721 This extension point is a bit more complex than most other extension 1722 points. To begin with, the factory class will be called with the 1723 owner of the file set as the current item. Eg. the 1724 <code>ClientContext.getCurrentItem()</code> should return a 1725 <interfacename docapi="net.sf.basedb.core">FileStoreEnabled</interfacename> 1726 item. It is recommended that the factory performs a pre-filtering 1727 of the items to avoid calling the actual validation code on unsupported 1728 files. For example, the <classname docapi="net.sf.basedb.util.affymetrix">CelValidationFactory</classname> 1729 will check that the item is a <classname docapi="net.sf.basedb.core">RawBioAssay</classname> 1730 item using the Affymetrix platform. 1731 </para> 1732 1733 <para> 1734 Each file in the file set is then passed to the 1735 <methodname>ValidationAction.acceptFile(FileSetMember)</methodname> 1736 which may accept or reject the file. If the file is accepted it may 1737 be accepted for immediate validation or later validation. The latter option 1738 is useful in more complex scenarios were files need to be validated as a group. 1739 If the file is accepted the <methodname>ValidationAction.validateAndExtractMetadata()</methodname> 1740 is called, which is were the real work should happen. 1741 </para> 1742 1743 <para> 1744 The extensions for this extension point is also called when a file is replaced 1745 or removed from the file set. The calling sequence to set up the validation is 1746 more or less the same as described above, but the last step is to 1747 call <methodname>ValidationAction.resetMetadata()</methodname> instead 1748 of <methodname>ValidationAction.validateAndExtractMetadata()</methodname>. 1749 </para> 1750 1751 <tip> 1752 <title> 1753 Use the <classname docapi="net.sf.basedb.util.fileset">SingleFileValidationAction</classname> 1754 class. 1755 </title> 1756 <para> 1757 Most validators that work on a single file at a time may find the 1758 <classname>SingleFileValidationAction</classname> class useful. Is should 1759 simplify the task of making sure that only the desired file type is 1760 validated. See the source code of the <classname 1761 docapi="net.sf.basedb.util.affymetrix">CelValidationAction</classname> 1762 class for an example. 1763 </para> 1764 </tip> 1721 1765 1722 1766 </sect2> -
trunk/doc/src/docbook/developerdoc/plugin_developer.xml
r5640 r5654 4189 4189 </sect2> 4190 4190 4191 <sect2 id="plugin_developer.other.datafiles">4192 <title>File validator and metadata reader plug-ins</title>4193 4194 <itemizedlist>4195 <title>See also</title>4196 <listitem><xref linkend="core_api.data_in_files" /></listitem>4197 <listitem><xref linkend="data_api.platforms" /></listitem>4198 </itemizedlist>4199 4200 4201 <para>4202 In those cases where files are used to store data instead4203 of importing it to the database, BASE can use plug-ins to4204 check that the supplied files are valid and also to extract4205 metadata from the files. For example, the4206 <classname docapi="net.sf.basedb.core.filehandler">net.sf.basedb.core.filehandler.CelFileHandler</classname>4207 is used to check if a file is a valid Affymetrix CEL file and4208 to extract data headers and the number of spots from it.4209 </para>4210 4211 <para>4212 The validator and metadata reader plug-ins are not regular plug-ins4213 (ie. they don't have to implement the <interfacename docapi="net.sf.basedb.core.plugin">Plugin</interfacename>4214 interface). This means that you don't have to mess with configuration or4215 job parameters.4216 </para>4217 4218 <para>4219 Validator plug-ins must implement the4220 <interfacename docapi="net.sf.basedb.core.filehandler">net.sf.basedb.core.filehandler.DataFileHandler</interfacename>4221 and <interfacename docapi="net.sf.basedb.core.filehandler">net.sf.basedb.core.filehandler.DataValidator</interfacename>4222 interfaces. Metadata reader plug-ins should implement the4223 <interfacename docapi="net.sf.basedb.core.filehandler">net.sf.basedb.core.filehandler.DataFileHandler</interfacename>4224 and <interfacename docapi="net.sf.basedb.core.filehandler">net.sf.basedb.core.filehandler.DataFileMetadataReader</interfacename>4225 interfaces.4226 </para>4227 4228 <note>4229 <para>4230 Meta data extraction can only be done if the file has first been4231 validated. We recommend that metadata reader plug-ins also takes the role as4232 validator plug-ins. This will make BASE re-use the same object instance4233 and the file doesn't have to be parsed twice.4234 </para>4235 </note>4236 4237 <important>4238 <title>4239 Always extend the4240 <classname docapi="net.sf.basedb.core.filehandler">net.sf.basedb.core.filehandler.AbstractDataFileHandler</classname>4241 class4242 </title>4243 <para>4244 We consider the mentioned interface to be part of the public API only4245 from the caller side, not from the implementor side. Thus, we may4246 add methods to those interfaces in the future without prior notice.4247 The <classname docapi="net.sf.basedb.core.filehandler">AbstractDataFileHandler</classname> will provide default4248 implementations of the new methods in order to not break existing4249 plug-ins.4250 </para>4251 </important>4252 4253 <variablelist>4254 <title>Methods in the <interfacename docapi="net.sf.basedb.core.filehandler">DataFileHandler</interfacename> interface</title>4255 <varlistentry>4256 <term>4257 <methodsynopsis language="java">4258 <modifier>public</modifier>4259 <void/>4260 <methodname>setFile</methodname>4261 <methodparam>4262 <type>FileSetMember</type>4263 <parameter>member</parameter>4264 </methodparam>4265 </methodsynopsis>4266 </term>4267 <listitem>4268 <para>4269 Sets the file that is going to be validated or used for metadata4270 extraction. If the same plug-in can be used for validating4271 more than one type of file, this method will be called4272 one time for each file that is present in the file set.4273 </para>4274 </listitem>4275 </varlistentry>4276 4277 <varlistentry>4278 <term>4279 <methodsynopsis language="java">4280 <modifier>public</modifier>4281 <void/>4282 <methodname>setItem</methodname>4283 <methodparam>4284 <type>FileStoreEnabled</type>4285 <parameter>item</parameter>4286 </methodparam>4287 </methodsynopsis>4288 </term>4289 <listitem>4290 <para>4291 Sets the item that the files belong to. This method is only4292 called once.4293 </para>4294 </listitem>4295 </varlistentry>4296 </variablelist>4297 4298 <variablelist>4299 <title>Methods in the <interfacename docapi="net.sf.basedb.core.filehandler">DataFileValidator</interfacename> interface</title>4300 <varlistentry>4301 <term>4302 <methodsynopsis language="java">4303 <modifier>public</modifier>4304 <void/>4305 <methodname>validate</methodname>4306 <methodparam>4307 <type>DbControl</type>4308 <parameter>dc</parameter>4309 </methodparam>4310 <exceptionname>InvalidDataException</exceptionname>4311 <exceptionname>InvalidRelationException</exceptionname>4312 </methodsynopsis>4313 </term>4314 <listitem>4315 <para>4316 Validate the file. The file is valid if this method returns4317 sucessfully. If the file is not valid an4318 <exceptionname>InvalidDataException</exceptionname> should be4319 thrown. Note that BASE will still accept the file, but will indicate4320 the failure with a flag and also keep the message of the exception in the4321 database to remind the user of the failure.4322 </para>4323 <para>4324 The <exceptionname>InvalidRelationException</exceptionname>4325 should be used to indicate a partial success/partial failure,4326 where the file as such is a valid file, but in relation to4327 other files it is not. For example, we may assign a valid CEL4328 file to a raw bioassay, but the chip type doesn't match4329 the chip type of the CDF file of the related array design.4330 This exception will also allow metadata to be extracted from4331 the file.4332 </para>4333 </listitem>4334 </varlistentry>4335 </variablelist>4336 4337 <variablelist>4338 <title>Methods in the <interfacename docapi="net.sf.basedb.core.filehandler">DataFileMetadataReader</interfacename> interface</title>4339 <varlistentry>4340 <term>4341 <methodsynopsis language="java">4342 <modifier>public</modifier>4343 <void/>4344 <methodname>extractMetadata</methodname>4345 <methodparam>4346 <type>DbControl</type>4347 <parameter>dc</parameter>4348 </methodparam>4349 </methodsynopsis>4350 </term>4351 <listitem>4352 <para>4353 Extract metadata from the file. It is up to the plug-in4354 to decide what to extract and how to store it.4355 The <classname docapi="net.sf.basedb.core.filehandler">CelFileHandler</classname> will, for4356 example, extract headers and the number of spots from the file4357 and store it with the raw bioassay.4358 </para>4359 </listitem>4360 </varlistentry>4361 <varlistentry>4362 <term>4363 <methodsynopsis language="java">4364 <modifier>public</modifier>4365 <void/>4366 <methodname>resetMetadata</methodname>4367 <methodparam>4368 <type>DbControl</type>4369 <parameter>dc</parameter>4370 </methodparam>4371 </methodsynopsis>4372 </term>4373 <listitem>4374 <para>4375 Remove all metadata that the plug-in usually can extract.4376 This method is called if a file is unlinked from an item4377 or if the validation fails. It is important that the4378 plug-in cleans up everything so that data from a4379 previous file doesn't remain in the database.4380 </para>4381 </listitem>4382 </varlistentry>4383 </variablelist>4384 4385 <variablelist>4386 <title>Methods in the <classname docapi="net.sf.basedb.core.filehandler">AbstractDataFileHandler</classname> class</title>4387 <varlistentry>4388 <term>4389 <methodsynopsis language="java">4390 <modifier>public</modifier>4391 <type>FileStoreEnabled</type>4392 <methodname>getItem</methodname>4393 </methodsynopsis>4394 </term>4395 <listitem>4396 <para>4397 Get the item that was previously added to4398 <methodname>setItem()</methodname>4399 </para>4400 </listitem>4401 </varlistentry>4402 <varlistentry>4403 <term>4404 <methodsynopsis language="java">4405 <modifier>public</modifier>4406 <type>FileSetMember</type>4407 <methodname>getMember</methodname>4408 <methodparam>4409 <type>String</type>4410 <parameter>dataFileTypeId</parameter>4411 </methodparam>4412 </methodsynopsis>4413 </term>4414 <listitem>4415 <para>4416 Get a file that was previously added to4417 <methodname>setFile()</methodname>. The4418 <parameter>dataFileTypeId</parameter> is4419 the external ID of the <classname docapi="net.sf.basedb.core">DataFileType</classname>.4420 </para>4421 </listitem>4422 </varlistentry>4423 </variablelist>4424 4425 </sect2>4426 4427 4191 <sect2 id="plugin_developer.other.logging"> 4428 4192 <title>Logging plug-ins</title> -
trunk/lib/docbook/custom-styles/docbook/plain/xsl/customized.chunked.xsl
r5244 r5654 276 276 </xsl:template> 277 277 278 <xsl:template match="classname"> 279 <xsl:call-template name="inline.monoseq"/> 280 <xsl:if test = "@docapi != ''"> 281 <xsl:variable name="packagePath"> 282 <xsl:call-template name="replaceCharsInString"> 283 <xsl:with-param name="stringIn" select="string(@docapi)"/> 284 <xsl:with-param name="charsIn" select="'.'" /> 285 <xsl:with-param name="charsOut" select="'/'" /> 286 </xsl:call-template> 287 </xsl:variable> 288 278 <xsl:template match="classname"> 279 <xsl:call-template name="inline.monoseq"/> 280 <xsl:call-template name="linkToJavadoc" /> 281 </xsl:template> 282 283 <xsl:template match="interfacename"> 284 <xsl:call-template name="inline.monoseq"/> 285 <xsl:call-template name="linkToJavadoc" /> 286 </xsl:template> 287 288 <xsl:template name="linkToJavadoc"> 289 <xsl:if test = "@docapi != ''"> 289 290 <xsl:variable name="cleanClassName"> 290 291 <xsl:choose> … … 298 299 </xsl:variable> 299 300 301 <xsl:variable name="fullClassName"> 302 <xsl:value-of select="concat(@docapi, '.', $cleanClassName)"/> 303 </xsl:variable> 304 305 <xsl:variable name="classPath"> 306 <xsl:call-template name="replaceCharsInString"> 307 <xsl:with-param name="stringIn" select="$fullClassName"/> 308 <xsl:with-param name="charsIn" select="'.'" /> 309 <xsl:with-param name="charsOut" select="'/'" /> 310 </xsl:call-template> 311 </xsl:variable> 312 300 313 <xsl:variable name="pathtorootdir"> 301 314 <xsl:call-template name="pathtorootdir" /> … … 304 317 <a> 305 318 <xsl:attribute name="href"> 306 <xsl:value-of select="concat($pathtorootdir, $javadoc.root.path, $ packagePath, '/', $cleanClassName, '.html')" />319 <xsl:value-of select="concat($pathtorootdir, $javadoc.root.path, $classPath, '.html')" /> 307 320 </xsl:attribute> 308 <xsl:attribute name="title">Javadoc for this class.</xsl:attribute> 321 <xsl:attribute name="title"> 322 <xsl:value-of select="concat('Javadoc for ', $fullClassName)" /> 323 </xsl:attribute> 309 324 <image> 310 325 <xsl:attribute name="src"> … … 315 330 </image> 316 331 </a> 317 </xsl:if> 318 </xsl:template> 319 320 <xsl:template match="interfacename"> 321 <xsl:call-template name="inline.monoseq"/> 322 <xsl:if test = "@docapi != ''"> 323 <xsl:variable name="packagePath"> 324 <xsl:call-template name="replaceCharsInString"> 325 <xsl:with-param name="stringIn" select="string(@docapi)"/> 326 <xsl:with-param name="charsIn" select="'.'" /> 327 <xsl:with-param name="charsOut" select="'/'" /> 328 </xsl:call-template> 329 </xsl:variable> 330 331 <xsl:variable name="cleanClassName"> 332 <xsl:choose> 333 <xsl:when test="starts-with(., @docapi)"> 334 <xsl:value-of select="substring-after(., concat(@docapi, '.'))" /> 335 </xsl:when> 336 <xsl:otherwise> 337 <xsl:value-of select="." /> 338 </xsl:otherwise> 339 </xsl:choose> 340 </xsl:variable> 341 342 <xsl:variable name="pathtorootdir"> 343 <xsl:call-template name="pathtorootdir" /> 344 </xsl:variable> 345 <a> 346 <xsl:attribute name="href"> 347 <xsl:value-of select="concat($pathtorootdir, $javadoc.root.path, $packagePath, '/', $cleanClassName, '.html')" /> 348 </xsl:attribute> 349 <xsl:attribute name="title">Javadoc for this interface.</xsl:attribute> 350 351 <image> 352 <xsl:attribute name="src"> 353 <xsl:value-of select="concat($pathtorootdir, $admon.graphics.path, 'docapi.gif')"/> 354 </xsl:attribute> 355 <xsl:attribute name="border">0</xsl:attribute> 356 <xsl:attribute name="style">padding-left: 4px;</xsl:attribute> 357 </image> 358 </a> 359 </xsl:if> 332 </xsl:if> 360 333 </xsl:template> 361 334
Note: See TracChangeset
for help on using the changeset viewer.