com.jurismarches.vradi.services.managers
Class BindingManager

java.lang.Object
  extended by com.jurismarches.vradi.services.managers.BindingManager

public class BindingManager
extends java.lang.Object

Class containing the methods to manage the binding of the xml streams fields with the form fields : - xml field bindings creation, update and retrieving - xml streams retrieving - form creation with the data from an xml stream

Version:
$Revision: 1317 $ $Date: 2010-09-10 10:29:46 +0200 (ven., 10 sept. 2010) $
Author:
schorlet

Constructor Summary
BindingManager(FormTypeManager formTypeManager, FormManager formManager)
           
BindingManager(org.nuiton.wikitty.WikittyProxy proxy, FormTypeManager formTypeManager, FormManager formManager)
           
 
Method Summary
protected  void autoLoadFormsFromXmlStreams(long delay, long period)
          Regularly retrieves the information from all the xml streams and create new forms
 void autoLoadFormsFromXmlStreams(java.lang.String intervalUnit, int intervalValue, java.lang.Integer hour, java.lang.Integer minute)
          Regularly retrieves the information from all the xml streams and create new forms
protected  FormImpl createForm(org.nuiton.wikitty.WikittyExtension formType, java.util.List<XmlFieldBinding> bindings, org.jdom.Element feed, org.jdom.Namespace namespace, com.jurismarches.vradi.services.managers.BindingManager.BindingContext bindingContext)
          Create from from feed element.
 java.io.File createPreviewFile(WebHarvestStream webHarvestStream)
          Creates file result of webharvest scrip
protected  java.io.File createPreviewFile(WebHarvestStream webHarvestStream, boolean override)
           
protected  void fillFormField(org.nuiton.wikitty.Wikitty wikitty, org.nuiton.wikitty.FieldType fieldType, XmlFieldBinding binding, org.jdom.Element feed, org.jdom.Namespace namespace, com.jurismarches.vradi.services.managers.BindingManager.BindingContext bindingContext)
          Fill form with feed element.
 java.util.List<WebHarvestStream> getAllWebHarvestStreams()
           
 java.util.List<XmlStream> getAllXmlStreams()
           
<E extends XmlStream>
int[]
getFormsFromStream(E stream, org.jdom.Document document)
          Creates forms with the data of an stream
 int[] getFormsFromWebHarvestStream(WebHarvestStream webHarvestStream)
          Creates forms with the data of an xml stream
 int[] getFormsFromXmlStream(XmlStream xmlStream)
          Creates forms with the data of an xml stream
 java.lang.String getWebHarvestPreviewPath(WebHarvestStream stream)
           
 java.net.URI getWebHarvestPreviewUrl(WebHarvestStream stream)
           
 java.lang.String getWebHarvestPreviewUrlAsString(WebHarvestStream stream)
           
 XmlFieldBinding getXmlFieldBinding(java.lang.String xmlFieldBindingId)
          Retrieves the xml field binding whose id is xmlFieldBindingId
 java.util.List<XmlFieldBinding> getXmlFieldBindings(XmlStream xmlStream)
          Retrieves the xml field bindings whose xml stream is xmlStream
 XmlStream getXmlStream(java.lang.String xmlStreamId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindingManager

public BindingManager(org.nuiton.wikitty.WikittyProxy proxy,
                      FormTypeManager formTypeManager,
                      FormManager formManager)

BindingManager

public BindingManager(FormTypeManager formTypeManager,
                      FormManager formManager)
Method Detail

getXmlFieldBindings

public java.util.List<XmlFieldBinding> getXmlFieldBindings(XmlStream xmlStream)
Retrieves the xml field bindings whose xml stream is xmlStream

Parameters:
xmlStream - the xml stream associated with the xml field bindings we want to retrieve
Returns:
a list containing the xml field bindings associated with the xml stream xmlStream

getXmlFieldBinding

public XmlFieldBinding getXmlFieldBinding(java.lang.String xmlFieldBindingId)
Retrieves the xml field binding whose id is xmlFieldBindingId

Parameters:
xmlFieldBindingId - the id of the xml field binding we want to retrieve
Returns:
the xml field binding whose id is xmlFieldBindingId

getAllXmlStreams

public java.util.List<XmlStream> getAllXmlStreams()

getAllWebHarvestStreams

public java.util.List<WebHarvestStream> getAllWebHarvestStreams()

getWebHarvestPreviewUrl

public java.net.URI getWebHarvestPreviewUrl(WebHarvestStream stream)
                                     throws VradiException
Throws:
VradiException

getWebHarvestPreviewUrlAsString

public java.lang.String getWebHarvestPreviewUrlAsString(WebHarvestStream stream)
                                                 throws VradiException
Throws:
VradiException

getWebHarvestPreviewPath

public java.lang.String getWebHarvestPreviewPath(WebHarvestStream stream)

getXmlStream

public XmlStream getXmlStream(java.lang.String xmlStreamId)
                       throws VradiException
Throws:
VradiException

createForm

protected FormImpl createForm(org.nuiton.wikitty.WikittyExtension formType,
                              java.util.List<XmlFieldBinding> bindings,
                              org.jdom.Element feed,
                              org.jdom.Namespace namespace,
                              com.jurismarches.vradi.services.managers.BindingManager.BindingContext bindingContext)
                       throws VradiException
Create from from feed element.

Parameters:
formType -
bindings -
feed -
namespace - namespace for getting correct field with fieldnames
bindingContext -
Returns:
Throws:
VradiException

fillFormField

protected void fillFormField(org.nuiton.wikitty.Wikitty wikitty,
                             org.nuiton.wikitty.FieldType fieldType,
                             XmlFieldBinding binding,
                             org.jdom.Element feed,
                             org.jdom.Namespace namespace,
                             com.jurismarches.vradi.services.managers.BindingManager.BindingContext bindingContext)
                      throws VradiException
Fill form with feed element.

Parameters:
wikitty -
fieldType -
binding -
feed -
namespace - namespace to get field from feed element
bindingContext -
Throws:
VradiException

getFormsFromWebHarvestStream

public int[] getFormsFromWebHarvestStream(WebHarvestStream webHarvestStream)
                                   throws VradiException
Creates forms with the data of an xml stream

Parameters:
webHarvestStream -
vradiUser -
Returns:
An array containing : - the number of created forms - the number of already existing forms - the number of forms created with date parsing error - the number of forms created with number parsing error
Throws:
VradiException - for various possible errors

createPreviewFile

public java.io.File createPreviewFile(WebHarvestStream webHarvestStream)
                               throws VradiException
Creates file result of webharvest scrip

Parameters:
webHarvestStream -
Returns:
Preview file
Throws:
VradiException - for various possible errors

createPreviewFile

protected java.io.File createPreviewFile(WebHarvestStream webHarvestStream,
                                         boolean override)
                                  throws VradiException
Throws:
VradiException

getFormsFromXmlStream

public int[] getFormsFromXmlStream(XmlStream xmlStream)
                            throws VradiException
Creates forms with the data of an xml stream

Parameters:
xmlStream -
Returns:
An array containing : - the number of created forms - the number of already existing forms - the number of forms created with date parsing error - the number of forms created with number parsing error
Throws:
VradiException - for various possible errors

getFormsFromStream

public <E extends XmlStream> int[] getFormsFromStream(E stream,
                                                      org.jdom.Document document)
                         throws VradiException
Creates forms with the data of an stream

Parameters:
stream -
document - of rss
Returns:
An array containing : - the number of created forms - the number of already existing forms - the number of forms created with date parsing error - the number of forms created with number parsing error
Throws:
VradiException - for various possible errors

autoLoadFormsFromXmlStreams

public void autoLoadFormsFromXmlStreams(java.lang.String intervalUnit,
                                        int intervalValue,
                                        java.lang.Integer hour,
                                        java.lang.Integer minute)
                                 throws VradiException
Regularly retrieves the information from all the xml streams and create new forms

Parameters:
intervalUnit - unit of te interval between 2 retrievings (minute, hour or day)
intervalValue - interval value between two retrievings
hour - hour of the retrieving if the unit is day
minute - of the retrieving if the unit is day or hour
Throws:
VradiException

autoLoadFormsFromXmlStreams

protected void autoLoadFormsFromXmlStreams(long delay,
                                           long period)
                                    throws VradiException
Regularly retrieves the information from all the xml streams and create new forms

Parameters:
delay - the delay before the first retrieving
period - interval between two retrievings
Throws:
VradiException


Copyright © 2009-2010 JurisMarches. All Rights Reserved.