Changeset 1019


Ignore:
Timestamp:
Apr 3, 2009, 9:14:51 AM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #189: Add toolbar extension examples

Added "Annotation filter" and "More info" examples. Restructured the project.

Location:
extensions/net.sf.basedb.examples/trunk
Files:
9 added
6 edited
4 moved

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.examples/trunk/META-INF/extensions.xml

    r682 r1019  
    11<?xml version="1.0" encoding="UTF-8" ?>
    2 <extensions xmlns="http://base.thep.lu.se/extensions.xsd">
     2<extensions xmlns="http://base.thep.lu.se/extensions.xsd"
     3  id-base="net.sf.basedb.examples.extensions.">
    34  <about>
    45    <name>Extensions example package</name>
     
    1213  </about>
    1314  <extension
    14     id="net.sf.basedb.clients.web.menu.extensions.helloworld"
     15    id="menu.helloworld"
    1516    extends="net.sf.basedb.clients.web.menu.extensions"
    1617    >
     
    3031  </extension>
    3132  <extension
    32     id="net.sf.basedb.clients.web.menu.extensions.helloworldsimple"
     33    id="menu.helloworldsimple"
    3334    extends="net.sf.basedb.clients.web.menu.extensions"
    3435    >
     
    5758 
    5859  <extension
    59     id="net.sf.basedb.clients.web.menu.extensions.helloworldfactory"
     60    id="menu.helloworldfactory"
    6061    extends="net.sf.basedb.clients.web.menu.extensions"
    6162    >
     
    7071    <action-factory>
    7172      <factory-class>
    72         net.sf.basedb.examples.extensions.HelloWorldFactory
     73        net.sf.basedb.examples.extensions.menu.HelloWorldFactory
    7374      </factory-class>
    7475    </action-factory>
     
    7677 
    7778  <extension
    78     id="net.sf.basedb.clients.web.menu.extensions.hellouser"
     79    id="menu.hellouser"
    7980    extends="net.sf.basedb.clients.web.menu.extensions"
    8081    >
     
    9091    <action-factory>
    9192      <factory-class>
    92         net.sf.basedb.examples.extensions.HelloUserFactory
     93        net.sf.basedb.examples.extensions.menu.HelloUserFactory
    9394      </factory-class>
    9495      <parameters>
     
    100101
    101102  <extension
    102     id="net.sf.basedb.clients.web.menu.extensions.hellojspworld"
     103    id="menu.hellojspworld"
    103104    extends="net.sf.basedb.clients.web.menu.extensions"
    104105    >
     
    125126  </extension>
    126127  <extension
    127     id="net.sf.basedb.clients.web.menu.extensions.helloxjspworld"
     128    id="menu.helloxjspworld"
    128129    extends="net.sf.basedb.clients.web.menu.extensions"
    129130    >
     
    153154  </extension>
    154155  <extension
    155     id="net.sf.basedb.clients.web.menu.extensions.helloservletworld"
     156    id="menu.helloservletworld"
    156157    extends="net.sf.basedb.clients.web.menu.extensions"
    157158    >
     
    178179  </extension>
    179180
     181  <extension
     182    id="toolbar.iteminfo"
     183    extends="net.sf.basedb.clients.web.toolbar.item.all"
     184    >
     185    <index>1</index>
     186    <about>
     187      <name>Show item info</name>
     188      <description>
     189        This example creates a toolbar button on all single-item
     190        pages that opens a JSP page that displays some information
     191        about the item.
     192      </description>
     193    </about>
     194    <action-factory>
     195      <factory-class>
     196        net.sf.basedb.examples.extensions.toolbar.InfoButtonFactory
     197      </factory-class>
     198      <parameters>
     199        <title>More info...</title>
     200        <tooltip>Show some information about $NAME</tooltip>
     201        <icon>/images/info.gif</icon>
     202        <onClick>Examples.showItemInfo('$TYPE', $ID)</onClick>
     203        <script>~/scripts/examples.jsp</script>
     204      </parameters>
     205    </action-factory>
     206  </extension>
     207  <extension
     208    id="toolbar.filterselected"
     209    extends="net.sf.basedb.clients.web.toolbar.list.annotatable"
     210    >
     211    <index>1</index>
     212    <about>
     213      <name>Annotation filter</name>
     214      <description>
     215        This example creates a toolbar button that can apply a
     216        special filter for showing only items that has been
     217        annotated or only items that has no annotations.
     218      </description>
     219    </about>
     220    <action-factory>
     221      <factory-class>
     222        net.sf.basedb.examples.extensions.toolbar.InfoButtonFactory
     223      </factory-class>
     224      <parameters>
     225        <title>Annotation filter...</title>
     226        <tooltip>Filter items based on if they have been annotated or not</tooltip>
     227        <icon>/images/filter.gif</icon>
     228        <onClick>Examples.filterAnnotated('$TYPE')</onClick>
     229        <script>~/scripts/examples.jsp</script>
     230      </parameters>
     231    </action-factory>
     232  </extension>
     233
    180234</extensions>
  • extensions/net.sf.basedb.examples/trunk/META-INF/servlets.xml

    r656 r1019  
    33  <servlet>
    44    <servlet-name>HelloWorld</servlet-name>
    5     <servlet-class>net.sf.basedb.examples.extensions.HelloWorldServlet</servlet-class>
     5    <servlet-class>net.sf.basedb.examples.extensions.servlet.HelloWorldServlet</servlet-class>
    66    <init-param>
    77      <param-name>template</param-name>
  • extensions/net.sf.basedb.examples/trunk/README

    r691 r1019  
    11== Requirements ==
    22
    3  1. BASE 2.7.0 or later.
     3 1. BASE 2.12.0 or later.
    44 
    55== Introduction ==
     
    1616 * Hello Servlet world! - Uses a servlet to generate the message
    1717
     18There are also a few toolbar button extensions:
     19
     20 * More info - A toolbar button on all single-item toolbars and
     21   displays some information in a popup window about the current item.
     22 * Annotation filter - A toolbar button on all list pages for annotatable
     23   items which allows a user to show only items with/without annotations.
     24
    1825== Installation ==
    1926
    2027 1. Unpack the tar.gz file to a directory of your choice.
    2128 2. Copy the extension-examples.jar to your BASE extensions directory: WEB-INF/extensions.
    22  3. Run the 'Extensions -> Manual scan' command if you have disabled automatic
     29 3. Run the ''Extensions -> Manual scan'' command if you have disabled automatic
    2330    installation. Otherwise, just wait a bit and the automatic installation will
    2431    find and install the new extensions.
    2532 4. If you are logged in, you may have to logout and then login again to see
    26     the new menu items.
    27  5. The 'Hello X-JSP world' example requires that the X-JSP compiler is installed
     33    the new menu items, or use the ''File -> Reload permissions'' menu.
     34 5. The ''Hello X-JSP world'' example requires that the X-JSP compiler is installed
    2835    on the server. Read in the documentation how to do this.
    2936    http://base.thep.lu.se/chrome/site/latest/html/admindoc/extensions/admin.extensions.html
  • extensions/net.sf.basedb.examples/trunk/RELEASE

    r694 r1019  
    1111    sure.
    1212
    13  2. Update the version number in build.xml.
     13 2. Update the version number.
    1414   
    15     <property name="version" value="A.B" />
     15    * In build.xml: <property name="version" value="A.B" />
     16    * In META-INF/extensions.xml: <version>A.B</version>
    1617
    1718 3. Make sure that the code compiles and can be packaged.
  • extensions/net.sf.basedb.examples/trunk/build.xml

    r694 r1019  
    2222  <property name="javac.encoding" value="ISO-8859-1" />
    2323  <property name="depend.jars"
    24     value="http://base2.thep.lu.se/base/jars/2.7.0"
     24    value="http://base2.thep.lu.se/base/jars/2.12.0"
    2525    description="The location of the BASE core JARs that we depend on"
    2626  />
  • extensions/net.sf.basedb.examples/trunk/resources/hello_world.xjsp

    r682 r1019  
    22  import="net.sf.basedb.core.User"
    33  import="net.sf.basedb.clients.web.util.HTML"
    4   import="net.sf.basedb.examples.extensions.HelloXJspWorld"
     4  import="net.sf.basedb.examples.extensions.servlet.HelloXJspWorld"
    55%>
    66<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    77<%
    8 
    98final HelloXJspWorld hello = new HelloXJspWorld(pageContext);
    109final String ID = hello.getSessionId();
    1110final User current = hello.getLoggedInUser();
    12 
    1311%>
    1412  <base:page type="popup" title="Hello X-JSP world">
  • extensions/net.sf.basedb.examples/trunk/src/net/sf/basedb/examples/extensions/menu/HelloUserFactory.java

    r690 r1019  
    1 package net.sf.basedb.examples.extensions;
     1package net.sf.basedb.examples.extensions.menu;
    22
    33import net.sf.basedb.clients.web.extensions.AbstractJspActionFactory;
  • extensions/net.sf.basedb.examples/trunk/src/net/sf/basedb/examples/extensions/menu/HelloWorldFactory.java

    r690 r1019  
    1 package net.sf.basedb.examples.extensions;
     1package net.sf.basedb.examples.extensions.menu;
    22
    33import net.sf.basedb.clients.web.extensions.JspContext;
  • extensions/net.sf.basedb.examples/trunk/src/net/sf/basedb/examples/extensions/servlet/HelloWorldServlet.java

    r690 r1019  
    1 package net.sf.basedb.examples.extensions;
     1package net.sf.basedb.examples.extensions.servlet;
    22
    33import java.io.IOException;
  • extensions/net.sf.basedb.examples/trunk/src/net/sf/basedb/examples/extensions/xjsp/HelloXJspWorld.java

    r690 r1019  
    1 package net.sf.basedb.examples.extensions;
     1package net.sf.basedb.examples.extensions.xjsp;
    22
    33import javax.servlet.jsp.PageContext;
Note: See TracChangeset for help on using the changeset viewer.