PageMixer demonstration with Struts

pagemixer.filter
Class SubscriptionFilter

java.lang.Object
  |
  +--jp.ne.dti.lares.foozy.pagemixer.mixer.Filter
        |
        +--jp.ne.dti.lares.foozy.pagemixer.mixer.SequenceEditFilter
              |
              +--jp.ne.dti.lares.foozy.pagemixer.mixer.SequenceDataIterationFilter
                    |
                    +--pagemixer.filter.SubscriptionFilter
All Implemented Interfaces:
jp.ne.dti.lares.foozy.pagemixer.mixer.Consumer, SubscriptionConstants

public class SubscriptionFilter
extends jp.ne.dti.lares.foozy.pagemixer.mixer.SequenceDataIterationFilter
implements SubscriptionConstants

Filter for "Subscription" of struts-mailreader.

This filter consists of below filters.

See main(java.lang.String[]) to use as stand-alone application.

Below HTML files are good to examine filter behavior, according to Subscription held by User.

- src/demo/struts/war/WEB-INF/page/registration.*.html
this filter (1)iterates between <tr class="user-subscriptions"> and corresponded </tr>, (2)insets texts for "host"/"username"/"type"/"autoConnect" properties, and (3)appends "username"/"host" properties to href attributes of links to "delete"/"edit" functions.


Inner Class Summary
static class SubscriptionFilter.AddParams
          Filter to append query string to "href" attribute.
static class SubscriptionFilter.AutoConnectText
          Filter to inset "autoconnect" field value of "Subscription".
static class SubscriptionFilter.Factory
          Factory for "CommonFilter".
static class SubscriptionFilter.HostText
          Filter to inset "host" field value of "Subscription".
static class SubscriptionFilter.TypeText
          Filter to inset "type" field value of "Subscription".
static class SubscriptionFilter.UsernameText
          Filter to inset "username" field value of "Subscription".
 
Inner classes inherited from class jp.ne.dti.lares.foozy.pagemixer.mixer.Filter
jp.ne.dti.lares.foozy.pagemixer.mixer.Filter.Factory
 
Fields inherited from interface common.SubscriptionConstants
CLASS_AUTO_CONNECT, CLASS_DELETE, CLASS_EDIT, CLASS_HOST, CLASS_SUBSCRIPTIONS, CLASS_TYPE, CLASS_USERNAME, KEY_SUBSCRIPTION, KEY_USER
 
Constructor Summary
SubscriptionFilter()
          Create filter for "Subscription" of struts-mailreader.
 
Method Summary
protected  java.util.Iterator getIterator(java.lang.Object data)
           
protected  org.apache.struts.webapp.example.Subscription[] getSubscriptions(java.lang.Object data)
           
static void main(java.lang.String[] args)
          Invoke as stand-alone application.
 
Methods inherited from class jp.ne.dti.lares.foozy.pagemixer.mixer.SequenceDataIterationFilter
add, afterLast, beforeFirst, getDataProvider, onFirst, onInside, onLast, push
 
Methods inherited from class jp.ne.dti.lares.foozy.pagemixer.mixer.SequenceEditFilter
consume, flush
 
Methods inherited from class jp.ne.dti.lares.foozy.pagemixer.mixer.Filter
addCleanup, clear, connectTo, getConsumer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscriptionFilter

public SubscriptionFilter()
Create filter for "Subscription" of struts-mailreader.
Method Detail

getSubscriptions

protected org.apache.struts.webapp.example.Subscription[] getSubscriptions(java.lang.Object data)

getIterator

protected java.util.Iterator getIterator(java.lang.Object data)
Overrides:
getIterator in class jp.ne.dti.lares.foozy.pagemixer.mixer.SequenceDataIterationFilter

main

public static void main(java.lang.String[] args)
Invoke as stand-alone application.

Usage of this class is shown below.

 pagemixer.filter.SubscriptionFilter
     {Template.html}
     {UserDatabase.xml}
     {UserName}
 
{Template.html}
file path of template HTML to be processed by this filter.
{UserDatabase.xml}
XML file for MemoryUserDatabase of Struts mail-reader demo application.
{UserName}
name of user to be handled.

Please see description of pagemixer.filter about class path requirement to execute this class.


PageMixer demonstration with Struts