source: extensions/net.sf.basedb.examples/trunk/META-INF/extensions.xml @ 1603

Last change on this file since 1603 was 1603, checked in by Nicklas Nordborg, 11 years ago

References #377: Create some example extensions for the item overview

Added validation implementations for user and role that check the URL for the user and role membership.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 19.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8" ?>
2<!--
3  Copyright (C) 2011 Nicklas Nordborg
4
5  This file is part of the Example Code Package for BASE.
6  Available at http://baseplugins.thep.lu.se/
7  BASE main site: http://base.thep.lu.se/
8 
9  This is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 3
12  of the License, or (at your option) any later version.
13 
14  The software is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
21-->
22<extensions xmlns="http://base.thep.lu.se/extensions.xsd"
23  id-base="net.sf.basedb.examples.extensions.">
24  <about>
25    <name>Extensions example package</name>
26    <description>
27      This package contains several simple example extensions.
28      Most of them are variants of the well-known "Hello world"
29      code example.
30    </description>
31    <version>1.5-dev</version>
32    <min-base-version>3.2.0</min-base-version>
33    <copyright>BASE development team</copyright>
34    <url>http://baseplugins.thep.lu.se/wiki/net.sf.basedb.examples.extensions</url>
35    <email>basedb-users@lists.sourceforge.net</email>
36  </about>
37 
38  <plugin-definition id="ExampleAnalyzer">
39    <about>
40      <name>Example: Copy spot intensity</name>
41      <description>
42        An example analysis plugin that creates a new bioassay set
43        by multiplying each intensitity value with the same factor,
44        filtering out intensities below a cutoff value.
45      </description>
46    </about>
47    <plugin-class>net.sf.basedb.examples.plugins.ExampleAnalyzer</plugin-class>
48  </plugin-definition>
49 
50  <plugin-definition id="ExampleImporter">
51    <about>
52      <name>Example: sample importer</name>
53      <description>
54        An example plugin that pretends to import samples.
55        It can't be configured, but will ask for a file to
56        import from and if existing samples should be updated
57        or not. It won't actually import any samples, but
58        will report that a few samples has been imported.
59      </description>
60    </about>
61    <plugin-class>net.sf.basedb.examples.plugins.ExampleImporter</plugin-class>
62  </plugin-definition>
63 
64  <extension
65    id="menu.helloworld"
66    extends="net.sf.basedb.clients.web.menu.extensions"
67    >
68    <index>0</index>
69    <action-factory>
70      <factory-class>
71        net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory
72      </factory-class>
73      <parameters>
74        <type>SUBMENU</type>
75        <submenuId>hello</submenuId>
76        <title>Hello world examples!</title>
77        <tooltip>Find all examples here</tooltip>
78        <icon>/images/info.png</icon>
79      </parameters>
80    </action-factory>
81  </extension>
82  <extension
83    id="menu.helloworldsimple"
84    extends="net.sf.basedb.clients.web.menu.extensions"
85    >
86    <index>1</index>
87    <about>
88      <name>Hello world</name>
89      <description>
90        The very first extensions example. Adds a "Hello world"
91        menu item that displays "Hello world" in a javascript
92        popup when selected.
93      </description>
94    </about>
95    <action-factory>
96      <factory-class>
97        net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory
98      </factory-class>
99      <parameters>
100        <menuId>hello</menuId>
101        <title>Hello world!</title>
102        <tooltip>This is to test the extensions system</tooltip>
103        <onClick>alert('Hello world!')</onClick>
104        <icon>/images/info.png</icon>
105      </parameters>
106    </action-factory>
107  </extension>
108 
109  <extension
110    id="menu.helloworldfactory"
111    extends="net.sf.basedb.clients.web.menu.extensions"
112    >
113    <index>2</index>
114    <about>
115      <name>Hello factory world</name>
116      <description>
117        A "Hello world" variant with a custom action factory.
118        Everything is hard-coded into the factory.
119      </description>
120    </about>
121    <action-factory>
122      <factory-class>
123        net.sf.basedb.examples.extensions.menu.HelloWorldFactory
124      </factory-class>
125    </action-factory>
126  </extension>
127 
128  <extension
129    id="menu.hellouser"
130    extends="net.sf.basedb.clients.web.menu.extensions"
131    >
132    <index>3</index>
133    <about>
134      <name>Greetings user</name>
135      <description>
136        A "Hello world" variant with a custom action factory
137        that displays "Greetings {name of user}" instead. We also
138        make the icon configurable.
139      </description>
140    </about>
141    <action-factory>
142      <factory-class>
143        net.sf.basedb.examples.extensions.menu.HelloUserFactory
144      </factory-class>
145      <parameters>
146        <prefix>Greetings</prefix>
147        <icon>/images/take_ownership.png</icon>
148      </parameters>
149    </action-factory>
150  </extension>
151
152  <extension
153    id="menu.hellojspworld"
154    extends="net.sf.basedb.clients.web.menu.extensions"
155    >
156    <index>4</index>
157    <about>
158      <name>Hello JSP world</name>
159      <description>
160        This example uses a custom JSP page to display the
161        "Hello world" message instead of a javascript popup.
162      </description>
163    </about>
164    <action-factory>
165      <factory-class>
166        net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory
167      </factory-class>
168      <parameters>
169        <menuId>hello</menuId>
170        <title>Hello JSP world!</title>
171        <tooltip>Opens a JSP page with the message</tooltip>
172        <onClick>Main.openPopup('$HOME$/hello_world.jsp?ID=' + getSessionId(), 'HelloJspWorld', 450, 300)</onClick>
173        <icon>~/images/world.png</icon>
174      </parameters>
175    </action-factory>
176  </extension>
177  <extension
178    id="menu.helloxjspworld"
179    extends="net.sf.basedb.clients.web.menu.extensions"
180    >
181    <index>5</index>
182    <about>
183      <name>Hello X-JSP world</name>
184      <description>
185        This example uses a custom X-JSP page to display the
186        "Hello world" message instead of a javascript popup.
187        An X-JSP file is a JSP file that has access to classes in
188        the extension's JAR file. NOTE! This example requires that
189        the XJSP compiler is installed on the server.
190      </description>
191    </about>
192    <action-factory>
193      <factory-class>
194        net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory
195      </factory-class>
196      <parameters>
197        <menuId>hello</menuId>
198        <title>Hello X-JSP world!</title>
199        <tooltip>Opens a X-JSP page with the message</tooltip>
200        <onClick>Main.openPopup('$HOME$/hello_world.xjsp?ID=' + getSessionId(), 'HelloXJspWorld', 450, 300)</onClick>
201        <icon>~/images/xworld.png</icon>
202      </parameters>
203    </action-factory>
204  </extension>
205  <extension
206    id="menu.helloservletworld"
207    extends="net.sf.basedb.clients.web.menu.extensions"
208    >
209    <index>6</index>
210    <about>
211      <name>Hello Servlet world</name>
212      <description>
213        This example uses a custom Servlet page to display the
214        "Hello world" message instead of a javascript popup.
215      </description>
216    </about>
217    <action-factory>
218      <factory-class>
219        net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory
220      </factory-class>
221      <parameters>
222        <menuId>hello</menuId>
223        <title>Hello Servlet world!</title>
224        <tooltip>Opens a Servlet generated page with the message</tooltip>
225        <onClick>Main.openPopup('$HOME$/HelloWorld/with/some/path-info.servlet?ID=' + getSessionId(), 'HelloServletWorld', 450, 300)</onClick>
226        <icon>~/images/servlet.png</icon>
227      </parameters>
228    </action-factory>
229  </extension>
230  <extension
231    id="menu.helloservletworld2"
232    extends="net.sf.basedb.clients.web.menu.extensions"
233    >
234    <index>7</index>
235    <about>
236      <name>Hello Servlet world (alternate)</name>
237      <description>
238        This example uses a custom Servlet page to display the
239        "Hello world" message instead of a javascript popup.
240        The difference from the above menu is that this uses an
241        alternate path to the servlet.
242      </description>
243    </about>
244    <action-factory>
245      <factory-class>
246        net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory
247      </factory-class>
248      <parameters>
249        <menuId>hello</menuId>
250        <title>Hello Servlet world (alternate)!</title>
251        <tooltip>Opens a Servlet generated page with the message</tooltip>
252        <onClick>Main.openPopup('$SERVLET_HOME$/HelloWorld/with/other/path?ID=' + getSessionId(), 'HelloServletWorld', 450, 300)</onClick>
253        <icon>~/images/servlet.png</icon>
254      </parameters>
255    </action-factory>
256  </extension>
257  <extension
258    id="toolbar.iteminfo"
259    extends="net.sf.basedb.clients.web.toolbar.item.all"
260    >
261    <index>1</index>
262    <about>
263      <name>Show item info</name>
264      <description>
265        This example creates a toolbar button on all single-item
266        pages that opens a JSP page that displays some information
267        about the item.
268      </description>
269    </about>
270    <action-factory>
271      <factory-class>
272        net.sf.basedb.examples.extensions.toolbar.InfoButtonFactory
273      </factory-class>
274      <parameters>
275        <title>More info...</title>
276        <tooltip>Show some information about $NAME</tooltip>
277        <icon>/images/info.png</icon>
278        <onClick>Examples.showItemInfo('$TYPE', $ID)</onClick>
279        <script>~/scripts/examples.jsp</script>
280      </parameters>
281    </action-factory>
282  </extension>
283  <extension
284    id="toolbar.filterselected"
285    extends="net.sf.basedb.clients.web.toolbar.list.annotatable"
286    >
287    <index>1</index>
288    <about>
289      <name>Annotation filter</name>
290      <description>
291        This example creates a toolbar button that can apply a
292        special filter for showing only items that has been
293        annotated or only items that has no annotations.
294      </description>
295    </about>
296    <action-factory>
297      <factory-class>
298        net.sf.basedb.examples.extensions.toolbar.InfoButtonFactory
299      </factory-class>
300      <parameters>
301        <title>Annotation filter...</title>
302        <tooltip>Filter items based on if they have been annotated or not</tooltip>
303        <icon>/images/filter.png</icon>
304        <onClick>Examples.filterAnnotated('$TYPE')</onClick>
305        <script>~/scripts/examples.jsp</script>
306      </parameters>
307    </action-factory>
308  </extension>
309  <extension
310    id="toolbar.clickme"
311    extends="net.sf.basedb.clients.web.toolbar.list.all"
312    >
313    <index>2</index>
314    <about>
315      <name>Click me!</name>
316      <description>
317        Click the button!
318      </description>
319    </about>
320    <action-factory>
321      <factory-class>
322        net.sf.basedb.clients.web.extensions.toolbar.FixedButtonFactory
323      </factory-class>
324      <parameters>
325        <title>Click me!</title>
326        <tooltip>Come on! Do it!</tooltip>
327        <icon>/images/info.gif</icon>
328        <onClick>alert('Ouch!')</onClick>
329      </parameters>
330    </action-factory>
331  </extension>
332  <extension
333    id="history-edit"
334    >
335    <extends>
336      <ref index="2">net.sf.basedb.clients.web.tabcontrol.edit.sample</ref>
337      <ref index="2">net.sf.basedb.clients.web.tabcontrol.edit.extract</ref>
338    </extends>
339    <about>
340      <name>History file (edit)</name>
341      <description>
342        Adds an extra tab to the "Edit sample/extract" dialogs, were the user may
343        select a "History file" (whatever that is!) that is linked
344        with an any-to-any link to the item. This action also need the
345        'history-save' action to save the link.
346      </description>
347    </about>
348    <action-factory>
349      <factory-class>
350        net.sf.basedb.clients.web.extensions.tabcontrol.IncludeContentTabFactory
351      </factory-class>
352      <parameters>
353        <id>history-file</id>
354        <title>History file</title>
355        <tooltip>On this form you can link the item with it's history file!</tooltip>
356        <include>~/history_file.jsp</include>
357      </parameters>
358    </action-factory>
359  </extension>
360
361  <extension
362    id="history-save"
363    >
364    <extends>
365      <ref index="2">net.sf.basedb.clients.web.onsave.sample</ref>
366      <ref index="2">net.sf.basedb.clients.web.onsave.extract</ref>
367    </extends>
368    <about>
369      <name>History file (save)</name>
370      <description>
371        Saves an any-to-any link between a sample/extract and it's history file.
372        The history file is set in an extra tab in the "Edit sample/extract"
373        dialogs that is controlled by the 'history-edit' extension.
374      </description>
375    </about>
376    <action-factory>
377      <factory-class>
378        net.sf.basedb.examples.extensions.edit.HistoryOnSaveActionFactory
379      </factory-class>
380    </action-factory>
381  </extension>
382
383  <extension
384    id="onsave.lastupdatedby"
385    extends="net.sf.basedb.clients.web.onsave.all"
386    >
387    <index>3</index>
388    <about>
389      <name>Last updated by</name>
390      <description>
391        Creates an any-to-any link between any item and the currently logged in user
392        when that item is edited and saved in the web interface.
393      </description>
394    </about>
395    <action-factory>
396      <factory-class>
397        net.sf.basedb.examples.extensions.edit.LastUpdatedByOnSaveActionFactory
398      </factory-class>
399    </action-factory>
400  </extension>
401
402  <extension
403    id="list.owner-registration-date"
404    extends="net.sf.basedb.clients.web.listcolumn.ownable"
405    >
406    <index>1</index>
407    <about>
408      <name>Owner registration date</name>
409      <description>
410        Add a column to the list page of all ownable items that display
411        the registration date of the owner of the item.
412      </description>
413    </about>
414    <action-factory>
415      <factory-class>
416        net.sf.basedb.clients.web.extensions.list.PropertyPathActionFactory
417      </factory-class>
418      <parameters>
419        <id>owner.entryDate</id>
420        <title>Owner registration date</title>
421        <property>owner.entryDate</property>
422        <valueType>DATE</valueType>
423      </parameters>
424    </action-factory>
425  </extension>
426 
427  <extension
428    id="list.owner-email"
429    extends="net.sf.basedb.clients.web.listcolumn.ownable"
430    >
431    <index>2</index>
432    <about>
433      <name>Owner email</name>
434      <description>
435        Add a column to the list page of all ownable items that display
436        the owner's email address.
437      </description>
438    </about>
439    <action-factory>
440      <factory-class>
441        net.sf.basedb.clients.web.extensions.list.PropertyPathActionFactory
442      </factory-class>
443      <parameters>
444        <id>owner.email</id>
445        <title>Owner email</title>
446        <property>owner.email</property>
447        <valueType>STRING</valueType>
448        <formatterClass>net.sf.basedb.clients.web.formatter.NiceFormatter</formatterClass>
449        <exportFormatterClass>net.sf.basedb.examples.formatter.ToUpperCaseFormatter</exportFormatterClass>
450      </parameters>
451    </action-factory>
452  </extension>
453 
454  <extension
455    id="list.rawbioassay-data-files"
456    extends="net.sf.basedb.clients.web.listcolumn.rawbioassay"
457    >
458    <index>10</index>
459    <about>
460      <name>Data files</name>
461      <description>
462        Adds a column to the rawbioassays list that display data files attached to
463        each raw bioassay.
464      </description>
465    </about>
466    <action-factory>
467      <factory-class>
468        net.sf.basedb.examples.extensions.list.DataFilesActionFactory
469      </factory-class>
470    </action-factory>
471  </extension>
472 
473  <extension
474    id="list.extra-id"
475    extends="net.sf.basedb.clients.web.listcolumn.all"
476    >
477    <index>99</index>
478    <about>
479      <name>Extra id</name>
480      <description>
481        Add an extra id column to all lists. Useful for
482        testing that the extension system is working.
483      </description>
484    </about>
485    <action-factory>
486      <factory-class>
487        net.sf.basedb.clients.web.extensions.list.PropertyPathActionFactory
488      </factory-class>
489      <parameters>
490        <id>xid</id>
491        <title>XID</title>
492        <property>id</property>
493        <valueType>INT</valueType>
494      </parameters>
495    </action-factory>
496  </extension>
497
498  <extension 
499    id="loader.user"
500    extends="net.sf.basedb.util.overview.loader">
501    <index>1</index>
502    <about>
503      <name>Owner of item</name>
504      <description>
505        Load the owner of each item as a property
506        node in the item overview.
507      </description>
508    </about>
509    <action-factory>
510      <factory-class>
511        net.sf.basedb.examples.extensions.overview.OwnerNodeLoaderFactory
512      </factory-class>
513    </action-factory>
514  </extension>
515
516  <extension 
517    id="validator.user"
518    extends="net.sf.basedb.util.overview.validator">
519    <index>1</index>
520    <about>
521      <name>Check the owner of an item</name>
522      <description>
523        This validator check the following things:
524        * Missing and denied access to the owner of an item
525        * That an URL has been specified for the user and has a valid syntax
526      </description>
527    </about>
528    <action-factory>
529      <factory-class>
530        net.sf.basedb.examples.extensions.overview.OwnerValidatorFactory
531      </factory-class>
532    </action-factory>
533  </extension>
534 
535  <extension
536    id="validationrule.missing-owner"
537    extends="net.sf.basedb.util.overview.validationrule">
538    <index>1</index>
539    <about>
540      <name>Missing owner</name>
541      <description>
542        Checks if an owner has been set for an item. Can't really happen
543        since an owner is always set by the core API.
544      </description>
545    </about>
546    <action-factory>
547      <factory-class>
548        net.sf.basedb.util.overview.extensions.ReflectValidationRuleActionFactory
549      </factory-class>
550      <parameters>
551        <field>net.sf.basedb.examples.extensions.overview.OwnerValidator.MISSING_OWNER</field>
552      </parameters>
553    </action-factory>
554  </extension>
555 
556  <extension
557    id="validationrule.denied-owner"
558    extends="net.sf.basedb.util.overview.validationrule">
559    <index>2</index>
560    <about>
561      <name>Access denied to owner</name>
562      <description>Checks if the user is denied access to the owner of an item.</description>
563    </about>
564    <action-factory>
565      <factory-class>
566        net.sf.basedb.util.overview.extensions.ReflectValidationRuleActionFactory
567      </factory-class>
568      <parameters>
569        <field>net.sf.basedb.examples.extensions.overview.OwnerValidator.DENIED_OWNER</field>
570      </parameters>
571    </action-factory>
572  </extension>
573 
574  <extension
575    id="validationrule.missing-url"
576    extends="net.sf.basedb.util.overview.validationrule">
577    <index>3</index>
578    <about>
579      <name>Missing URL</name>
580      <description>Check that an URL has been set for a user</description>
581    </about>
582    <action-factory>
583      <factory-class>
584        net.sf.basedb.util.overview.extensions.ReflectValidationRuleActionFactory
585      </factory-class>
586      <parameters>
587        <field>net.sf.basedb.examples.extensions.overview.OwnerValidator.MISSING_URL</field>
588      </parameters>
589    </action-factory>
590  </extension>
591
592  <extension
593    id="validationrule.invalid-url"
594    extends="net.sf.basedb.util.overview.validationrule">
595    <index>4</index>
596    <about>
597      <name>Invalid URL</name>
598      <description>Checks if an URL has a valid syntax.</description>
599    </about>
600    <action-factory>
601      <factory-class>
602        net.sf.basedb.util.overview.extensions.ReflectValidationRuleActionFactory
603      </factory-class>
604      <parameters>
605        <field>net.sf.basedb.examples.extensions.overview.OwnerValidator.INVALID_URL</field>
606      </parameters>
607    </action-factory>
608  </extension>
609
610  <extension 
611    id="loader.role"
612    extends="net.sf.basedb.util.overview.loader">
613    <index>2</index>
614    <about>
615      <name>Role membership</name>
616      <description>
617        Load the role membership of users as a folder-node with one item-node
618        for each role.
619      </description>
620    </about>
621    <action-factory>
622      <factory-class>
623        net.sf.basedb.examples.extensions.overview.RoleNodeLoaderFactory
624      </factory-class>
625    </action-factory>
626  </extension>
627
628  <extension 
629    id="validator.role"
630    extends="net.sf.basedb.util.overview.validator">
631    <index>2</index>
632    <about>
633      <name>Check the role membership of a user</name>
634      <description>
635        This validator check the following things:
636        * The the user is a member of at least one role
637      </description>
638    </about>
639    <action-factory>
640      <factory-class>
641        net.sf.basedb.examples.extensions.overview.RoleValidatorFactory
642      </factory-class>
643    </action-factory>
644  </extension>
645
646  <extension
647    id="validationrule.missing-role"
648    extends="net.sf.basedb.util.overview.validationrule">
649    <index>5</index>
650    <about>
651      <name>Missing role</name>
652      <description>Checks if a user is a member of at least one role.</description>
653    </about>
654    <action-factory>
655      <factory-class>
656        net.sf.basedb.util.overview.extensions.ReflectValidationRuleActionFactory
657      </factory-class>
658      <parameters>
659        <field>net.sf.basedb.examples.extensions.overview.RoleValidator.MISSING_ROLE</field>
660      </parameters>
661    </action-factory>
662  </extension>
663
664</extensions>
Note: See TracBrowser for help on using the repository browser.