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: 1715 $ $Date: 2010-10-27 21:21:28 +0200 (mer., 27 oct. 2010) $
Author:
schorlet

Field Summary
protected  FormManager formManager
           
protected  FormTypeManager formTypeManager
           
protected  java.util.Timer timer
           
protected  org.nuiton.wikitty.WikittyProxy wikittyProxy
           
protected  java.util.TimerTask xmlStreamTask
           
 
Constructor Summary
BindingManager(org.nuiton.wikitty.WikittyProxy wikittyProxy, FormTypeManager formTypeManager, FormManager formManager)
           
 
Method Summary
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()
          Retourne toutes les instance de stream avec leur réelle entité.
<E extends XmlStream>
XmlStreamImportResult
getFormsFromStream(E stream, org.jdom.Document document)
          Creates and store forms from an stream by using the XmlStreamBinding to link xml stream field values with form fields.
 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)
           
 XmlStreamImportResult importFormsFromWebHarvestStream(WebHarvestStream webHarvestStream)
          Creates and store forms from an WebHarvestStream by using the XmlStreamBinding to link xml stream field values with form fields.
 XmlStreamImportResult importFormsFromXmlStream(XmlStream xmlStream)
          Creates and store forms from an XmlStream by using the XmlStreamBinding to link xml stream field values with form fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wikittyProxy

protected org.nuiton.wikitty.WikittyProxy wikittyProxy

formTypeManager

protected FormTypeManager formTypeManager

formManager

protected FormManager formManager

timer

protected java.util.Timer timer

xmlStreamTask

protected java.util.TimerTask xmlStreamTask
Constructor Detail

BindingManager

public BindingManager(org.nuiton.wikitty.WikittyProxy wikittyProxy,
                      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()
Retourne toutes les instance de stream avec leur réelle entité.


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

importFormsFromWebHarvestStream

public XmlStreamImportResult importFormsFromWebHarvestStream(WebHarvestStream webHarvestStream)
                                                      throws VradiException
Creates and store forms from an WebHarvestStream by using the XmlStreamBinding to link xml stream field values with form fields. Input xmlStream is modified by this method (wikitty obselete).

Parameters:
webHarvestStream - stream to import
Returns:
a structure 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

importFormsFromXmlStream

public XmlStreamImportResult importFormsFromXmlStream(XmlStream xmlStream)
                                               throws VradiException
Creates and store forms from an XmlStream by using the XmlStreamBinding to link xml stream field values with form fields. Input xmlStream is modified by this method (wikitty obselete).

Parameters:
xmlStream - stream to import
Returns:
a structure 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> XmlStreamImportResult getFormsFromStream(E stream,
                                                                      org.jdom.Document document)
                                         throws VradiException
Creates and store forms from an stream by using the XmlStreamBinding to link xml stream field values with form fields. Input xmlStream is modified by this method (wikitty obselete).

Type Parameters:
E - xml stream type (XmlStream or WebHarvestStream).
Parameters:
stream - stream to import
document - of rss
Returns:
a structure 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


Copyright © 2009-2010 JurisMarches. All Rights Reserved.