Ignore:
Timestamp:
Apr 18, 2012, 11:38:55 AM (11 years ago)
Author:
Nicklas Nordborg
Message:

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.

File:
1 edited

Legend:

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

    r1602 r1603  
    512512      </factory-class>
    513513    </action-factory>
    514  
     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>
    515608  </extension>
    516609
     
    531624      </factory-class>
    532625    </action-factory>
    533  
    534   </extension>
    535 
     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>
    536663
    537664</extensions>
Note: See TracChangeset for help on using the changeset viewer.