com.jurismarches.vradi.services
Class VradiStorageServiceImpl

java.lang.Object
  extended by com.jurismarches.vradi.services.VradiStorageServiceImpl
All Implemented Interfaces:
VradiStorageService

public class VradiStorageServiceImpl
extends Object
implements VradiStorageService

Author:
morin

Field Summary
protected  BindingManager bindingManager
           
protected  ClientManager clientManager
           
protected  FormManager formManager
           
protected  FormTypeManager formTypeManager
           
protected  ImportExportManager importExportManager
           
protected  org.sharengo.wikitty.WikittyProxy proxy
          Proxy to store and retrieve data.
protected  SearchManager searchManager
           
protected  ThesaurusManager thesaurusManager
           
 
Constructor Summary
VradiStorageServiceImpl()
           
 
Method Summary
 File addTemplate(org.sharengo.wikitty.WikittyExtension extension, File template)
          Associates a new template file to the specified extension
 void archiveQueries(QueryMaker queryMaker)
          Archives the queries of a user, client or group in a RSS file.
 void autoLoadFormsFromXmlStreams(String intervalUnit, int intervalValue, Integer hour, Integer minute)
          Regularly retrieves the information from all the xml streams and create new forms
 void bindForms()
          Binds all queryMaker with the forms found by their queries and not already sent.
 List<Sending> createSending(Session session, QueryMaker queryMaker, List<Form> formsToBind)
          Create new Sending
 void deleteEntity(org.sharengo.wikitty.BusinessEntity entity)
          Delete the specified BusinessEntity.
 void deleteEntity(String id)
          Delete the specified BusinessEntity by id.
 void deleteForm(String formId)
          Deletes a Form by the specified formId.
 void deleteStatus(String statusId)
          Deletes a Status.
 void deleteStatuses(List<String> statusIds)
          Deletes a list of Status.
 String exportAsCSV(org.sharengo.wikitty.Criteria criteria)
          Get csv export.
 String exportData()
          Export the datas into an XML format.
 VradiFormPageDTO findForms(String query, VradiFormPageDTO formPageDTO)
          Searches for forms with the specified query.
 VradiFormPageDTO findForms2(String query, org.sharengo.wikitty.WikittyExtension extension, String dateType, Date beginDate, Date endDate, List<String>[] thesaurus, String[] statusIds, VradiFormPageDTO formPageDTO)
          Searches for forms with the specified filters.
 Map<QueryMaker,List<VradiQueryBean>> findQueriesReturningForm(Form form)
          Computes a list of queries returning the specified Form.
 List<Client> getAllClients()
          Returns all the clients.
 List<Form> getAllForms()
          Returns all Forms.
 List<org.sharengo.wikitty.WikittyExtension> getAllFormTypes()
          Returns all Form Types.
 List<Group> getAllGroups()
          Returns all the groups.
 List<Status> getAllStatuses()
          Returns all Status.
 List<org.sharengo.wikitty.TreeNodeImpl> getAllThesaurus()
          Returns all TreeNodeImpl considered as thesaurus nodes.
 List<VradiUserDTO> getAllUserDTOs()
          Returns all the Users.
 List<User> getAllUsers()
          Returns all the Users.
 List<XmlStream> getAllXmlStreams()
          Returns all XmlStreams.
 Map<String,String> getAssociatedFields(String extensionName, String templateName)
           
 List<org.sharengo.wikitty.TreeNodeImpl> getChildrenThesaurus(String thesaurusId)
          Returns all children of the specified thesaurusId.
 Client getClient(String clientId)
          Returns a Client with the specified clientId.
 Client getClientByUserId(String userId)
          Returns a Client whose specified userId belongs.
 List<User> getClientUsers(String clientId)
          Deprecated. since 20100507 unused
<E extends org.sharengo.wikitty.BusinessEntity>
List<E>
getEntities(List<String> ids, Class<E> clazz)
          Returns the BusinessEntity of the specified ids and clazz.
<E extends org.sharengo.wikitty.BusinessEntity>
E
getEntity(String id, Class<E> clazz)
          Returns a BusinessEntity of the specified id and clazz.
 Form getForm(String formId)
          Returns a Form with the specified formId.
 List<Form> getForms(List<String> formIds)
          Returns all the Forms with the specified list of formIds.
 int[] getFormsFromXmlStream(XmlStream xmlStream, VradiUser vradiUser)
          Creates and store forms from an XmlStream by using the XmlStreamBinding to link xml stream field values with form fields.
 org.sharengo.wikitty.WikittyExtension getFormType(String name)
          Returns a form type with the specified name.
 Map<String,org.sharengo.wikitty.FieldType> getFormTypeFields(String name)
          Finds fields of a form type.
 Group getGroup(String groupId)
          Returns a Group with the specified groupId.
 List<Client> getGroupClients(String groupId)
          Returns a list of Clients belonging to the specified groupId.
 List<User> getGroupUsers(String groupId)
          Returns a list of Users belonging to the specified groupId.
 int getNbFormsForThesaurus(String thesaurusId)
          Computes the number of forms associated with the specified thesaurusId.
 Map<QueryMaker,List<VradiQueryBean>> getQueriesToModifyAfterThesaurusModification(String thesaurusName)
          Gets the query makers whose queries are potentially to modify after a thesaurus node modification
 String getQueryHistoryFile(String id)
          Return the last part of the query history file, eg. queryHistory/ff4bb261-d6b2-42b3-be24-ab14e95cb244.rss.
 org.sharengo.wikitty.TreeNodeImpl getRootThesaurus()
          Returns the root Thesaurus Node.
 List<Session> getSessions(Date sessionDate)
          Get all session by date
 Status getStatus(String statusId)
          Returns a Status with the specified statusId.
 List<Status> getStatuses(List<String> statusIds)
          Returns a list of Status with the specified statusIds.
 File getTemplate(String extensionName, String templateName)
           
 File[] getTemplates(org.sharengo.wikitty.WikittyExtension extension)
          Lists the template files associated with the specified extension
 org.sharengo.wikitty.TreeNodeImpl getThesaurus(String thesaurusId)
          Returns a TreeNodeImpl with the specified thesaurusId.
 VradiCartographyDTO getThesaurusCartography(String query, org.sharengo.wikitty.WikittyExtension extension, String dateType, Date beginDate, Date endDate, List<String>[] thesaurus, String[] statusIds)
          Computes the number of forms associated with every thesaurus node.
 User getUser(String userId)
          Returns a User with the specified userId.
 XmlFieldBinding getXmlFieldBinding(String xmlFieldBindingId)
          Returns a XmlFieldBinding with the specified xmlFieldBindingId.
 List<XmlFieldBinding> getXmlFieldBindings(XmlStream xmlStream)
          Returns a list of XmlFieldBinding belonging to the specified xmlStream.
 XmlStream getXmlStream(String xmlStreamId)
          Returns a XmlStream with the specified xmlStreamId.
 void importAsCSV(String uri)
          Import all data as CSV.
 void importData(File file)
          Import data from an XML file.
 VradiUser logVradiUser(String vradiUserName, String vradiUserPassword)
          Checks if userName and userPassword matches a valid VradiUser.
 List<org.sharengo.wikitty.TreeNodeImpl> proposeThesaurus(Form form, List<org.sharengo.wikitty.TreeNodeImpl> thesaurus)
          Propose thesaurus nodes that might be in relation with a specified form
 void reindexData()
          Reindex the datas.
 List<Sending> removeAllSending(Session session, Form form, QueryMaker queryMaker)
           
 void setAssociatedFields(String extensionName, String templateName, Map<String,String> fieldMap)
           
<E extends org.sharengo.wikitty.BusinessEntity>
E[]
updateEntities(E... entities)
          Updates the specified BusinessEntity.
<E extends org.sharengo.wikitty.BusinessEntity>
List<E>
updateEntities(List<E> entities)
          Updates the specified BusinessEntity.
<E extends org.sharengo.wikitty.BusinessEntity>
E
updateEntity(E entity)
          Updates the specified BusinessEntity.
 Form updateForm(Form form)
          Creates or Update the specified form.
 List<Form> updateForms(List<Form> forms)
          Create or Update a list of Forms.
 org.sharengo.wikitty.WikittyExtension updateFormType(org.sharengo.wikitty.WikittyExtension extension)
          Creates or Update a form type.
 org.sharengo.wikitty.WikittyExtension updateFormType2(String name, Map<String,org.sharengo.wikitty.FieldType> fields, String requires, Map<String,String> tagValues)
          Creates or Update a form type.
 void updateSendings(List<Sending> sendings)
          Update a list of Sending.
 Status updateStatus(Status status)
          Updates a Status.
 List<Status> updateStatuses(List<Status> statuses)
          Updates a list of Status.
 VradiUser updateVradiUser(VradiUser vradiUser)
          Updates a VradiUser.
 List<XmlFieldBinding> updateXmlFieldBindings(List<XmlFieldBinding> bindings)
          Update a list of XmlFieldBinding.
 XmlStream updateXmlStream(XmlStream xmlStream, List<XmlFieldBinding> bindings)
           
 void uploadAttachments(Form form, List<File> attachments)
          Upload attachments attached to a form.
 void uploadFiles(Form form, List<File> files)
          Upload files attached to a form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proxy

protected org.sharengo.wikitty.WikittyProxy proxy
Proxy to store and retrieve data.


thesaurusManager

protected ThesaurusManager thesaurusManager

bindingManager

protected BindingManager bindingManager

formManager

protected FormManager formManager

formTypeManager

protected FormTypeManager formTypeManager

clientManager

protected ClientManager clientManager

searchManager

protected SearchManager searchManager

importExportManager

protected ImportExportManager importExportManager
Constructor Detail

VradiStorageServiceImpl

public VradiStorageServiceImpl()
Method Detail

getEntity

public <E extends org.sharengo.wikitty.BusinessEntity> E getEntity(String id,
                                                                   Class<E> clazz)
                                                        throws VradiException
Description copied from interface: VradiStorageService
Returns a BusinessEntity of the specified id and clazz.

Specified by:
getEntity in interface VradiStorageService
Parameters:
id - the id of the entity
clazz - the class of the entity
Returns:
a BusinessEntity
Throws:
VradiException

getEntities

public <E extends org.sharengo.wikitty.BusinessEntity> List<E> getEntities(List<String> ids,
                                                                           Class<E> clazz)
                                                                throws VradiException
Description copied from interface: VradiStorageService
Returns the BusinessEntity of the specified ids and clazz.

Specified by:
getEntities in interface VradiStorageService
Parameters:
ids - the id of the entities
clazz - the class of the entity
Returns:
a BusinessEntity
Throws:
VradiException

updateEntity

public <E extends org.sharengo.wikitty.BusinessEntity> E updateEntity(E entity)
                                                           throws VradiException
Description copied from interface: VradiStorageService
Updates the specified BusinessEntity.

Specified by:
updateEntity in interface VradiStorageService
Parameters:
entity - the entity to update
Returns:
the updated entity
Throws:
VradiException

updateEntities

public <E extends org.sharengo.wikitty.BusinessEntity> E[] updateEntities(E... entities)
                                                               throws VradiException
Description copied from interface: VradiStorageService
Updates the specified BusinessEntity.

Specified by:
updateEntities in interface VradiStorageService
Parameters:
entities - list of the entity to update
Returns:
the updated entities
Throws:
VradiException

updateEntities

public <E extends org.sharengo.wikitty.BusinessEntity> List<E> updateEntities(List<E> entities)
                                                                   throws VradiException
Description copied from interface: VradiStorageService
Updates the specified BusinessEntity.

Specified by:
updateEntities in interface VradiStorageService
Parameters:
entities - list of the entity to update
Returns:
the updated entities
Throws:
VradiException

deleteEntity

public void deleteEntity(String id)
                  throws VradiException
Description copied from interface: VradiStorageService
Delete the specified BusinessEntity by id.

Specified by:
deleteEntity in interface VradiStorageService
Parameters:
id - of the entity the entity to delete
Throws:
VradiException

deleteEntity

public void deleteEntity(org.sharengo.wikitty.BusinessEntity entity)
                  throws VradiException
Description copied from interface: VradiStorageService
Delete the specified BusinessEntity.

Specified by:
deleteEntity in interface VradiStorageService
Parameters:
entity - the entity to delete
Throws:
VradiException

getUser

public User getUser(String userId)
             throws VradiException
Description copied from interface: VradiStorageService
Returns a User with the specified userId.

Specified by:
getUser in interface VradiStorageService
Parameters:
userId - the id of the user
Returns:
a User
Throws:
VradiException

getClient

public Client getClient(String clientId)
                 throws VradiException
Description copied from interface: VradiStorageService
Returns a Client with the specified clientId.

Specified by:
getClient in interface VradiStorageService
Parameters:
clientId - the id of the client
Returns:
a Client
Throws:
VradiException

getGroup

public Group getGroup(String groupId)
               throws VradiException
Description copied from interface: VradiStorageService
Returns a Group with the specified groupId.

Specified by:
getGroup in interface VradiStorageService
Parameters:
groupId - the id of the group
Returns:
a Group
Throws:
VradiException

getQueryHistoryFile

public String getQueryHistoryFile(String id)
Description copied from interface: VradiStorageService
Return the last part of the query history file, eg. queryHistory/ff4bb261-d6b2-42b3-be24-ab14e95cb244.rss. The protocol, host and context of the file depends on the relation between modules vradi-swing and vradi-services and whether services are invoked locally or remotely.

Specified by:
getQueryHistoryFile in interface VradiStorageService
Parameters:
id - the id of the queryMaker

getGroupUsers

public List<User> getGroupUsers(String groupId)
                         throws VradiException
Description copied from interface: VradiStorageService
Returns a list of Users belonging to the specified groupId.

Specified by:
getGroupUsers in interface VradiStorageService
Parameters:
groupId - the id of the group
Returns:
a list of Users
Throws:
VradiException

getClientUsers

@Deprecated
public List<User> getClientUsers(String clientId)
                          throws VradiException
Deprecated. since 20100507 unused

Description copied from interface: VradiStorageService
Returns a list of Users belonging to the specified clientId.

Specified by:
getClientUsers in interface VradiStorageService
Parameters:
clientId - the id of the client
Returns:
a list of Users
Throws:
VradiException

getGroupClients

public List<Client> getGroupClients(String groupId)
                             throws VradiException
Description copied from interface: VradiStorageService
Returns a list of Clients belonging to the specified groupId.

Specified by:
getGroupClients in interface VradiStorageService
Parameters:
groupId - the id of the group
Returns:
a list of Clients
Throws:
VradiException

getClientByUserId

public Client getClientByUserId(String userId)
                         throws VradiException
Description copied from interface: VradiStorageService
Returns a Client whose specified userId belongs.

Specified by:
getClientByUserId in interface VradiStorageService
Parameters:
userId - the id of the user
Returns:
a Client
Throws:
VradiException

getAllClients

public List<Client> getAllClients()
                           throws VradiException
Description copied from interface: VradiStorageService
Returns all the clients.

Specified by:
getAllClients in interface VradiStorageService
Returns:
all the clients
Throws:
VradiException

getAllUsers

public List<User> getAllUsers()
                       throws VradiException
Description copied from interface: VradiStorageService
Returns all the Users.

Specified by:
getAllUsers in interface VradiStorageService
Returns:
a list of User
Throws:
VradiException

getAllUserDTOs

public List<VradiUserDTO> getAllUserDTOs()
                                  throws VradiException
Description copied from interface: VradiStorageService
Returns all the Users.

Specified by:
getAllUserDTOs in interface VradiStorageService
Returns:
a list of VradiUserDTO
Throws:
VradiException

getAllGroups

public List<Group> getAllGroups()
                         throws VradiException
Description copied from interface: VradiStorageService
Returns all the groups.

Specified by:
getAllGroups in interface VradiStorageService
Returns:
all the groups
Throws:
VradiException

updateForm

public Form updateForm(Form form)
                throws VradiException
Description copied from interface: VradiStorageService
Creates or Update the specified form.

Specified by:
updateForm in interface VradiStorageService
Parameters:
form - the form to create or update
Returns:
the stored Form
Throws:
VradiException

updateForms

public List<Form> updateForms(List<Form> forms)
                       throws VradiException
Description copied from interface: VradiStorageService
Create or Update a list of Forms.

Specified by:
updateForms in interface VradiStorageService
Parameters:
forms - the list of forms to insert or update
Returns:
an updated list of Form
Throws:
VradiException

findForms

public VradiFormPageDTO findForms(String query,
                                  VradiFormPageDTO formPageDTO)
                           throws UnsupportedQueryException
Description copied from interface: VradiStorageService
Searches for forms with the specified query.

Specified by:
findForms in interface VradiStorageService
Parameters:
query - the query to filter the forms
formPageDTO - ...
Returns:
VradiFormPageDTO
Throws:
UnsupportedQueryException

findForms2

public VradiFormPageDTO findForms2(String query,
                                   org.sharengo.wikitty.WikittyExtension extension,
                                   String dateType,
                                   Date beginDate,
                                   Date endDate,
                                   List<String>[] thesaurus,
                                   String[] statusIds,
                                   VradiFormPageDTO formPageDTO)
                            throws UnsupportedQueryException
Description copied from interface: VradiStorageService
Searches for forms with the specified filters. The beginDate and endDate specifies a date range filter which is applied on dateType field. The date range filter is applied only if the three parameters are not null.

Specified by:
findForms2 in interface VradiStorageService
Parameters:
query - the query filter
extension - the extension filter
dateType - the date field. Must be fully qualified (extension.field)
beginDate - the begin date filter
endDate - the end date filter
thesaurus - the thesaurus filter
statusIds - the ids of the status filters
formPageDTO - ...
Returns:
VradiFormPageDTO
Throws:
UnsupportedQueryException

getThesaurusCartography

public VradiCartographyDTO getThesaurusCartography(String query,
                                                   org.sharengo.wikitty.WikittyExtension extension,
                                                   String dateType,
                                                   Date beginDate,
                                                   Date endDate,
                                                   List<String>[] thesaurus,
                                                   String[] statusIds)
                                            throws VradiException,
                                                   UnsupportedQueryException
Description copied from interface: VradiStorageService
Computes the number of forms associated with every thesaurus node.

Specified by:
getThesaurusCartography in interface VradiStorageService
Parameters:
query - the query filter
extension - the extension filter
dateType - the date field. Must be fully qualified (extension.field)
beginDate - the begin date filter
endDate - the end date filter
thesaurus - the thesaurus filter
statusIds - the ids of the status filters
Returns:
a VradiCartographyDTO containing forms result and a map of form count indexed by thesaurus nodes
Throws:
VradiException
UnsupportedQueryException

findQueriesReturningForm

public Map<QueryMaker,List<VradiQueryBean>> findQueriesReturningForm(Form form)
                                                              throws VradiException
Description copied from interface: VradiStorageService
Computes a list of queries returning the specified Form.

Specified by:
findQueriesReturningForm in interface VradiStorageService
Parameters:
form - the form which match queries
Returns:
a list of queries
Throws:
VradiException

getAllFormTypes

public List<org.sharengo.wikitty.WikittyExtension> getAllFormTypes()
Description copied from interface: VradiStorageService
Returns all Form Types.

Specified by:
getAllFormTypes in interface VradiStorageService
Returns:
a list of WikittyExtension

getFormType

public org.sharengo.wikitty.WikittyExtension getFormType(String name)
                                                  throws VradiException
Description copied from interface: VradiStorageService
Returns a form type with the specified name.

Specified by:
getFormType in interface VradiStorageService
Parameters:
name - the name of the form type
Returns:
a WikittyExtension
Throws:
VradiException

getFormTypeFields

public Map<String,org.sharengo.wikitty.FieldType> getFormTypeFields(String name)
                                                             throws VradiException
Description copied from interface: VradiStorageService
Finds fields of a form type.

Specified by:
getFormTypeFields in interface VradiStorageService
Parameters:
name - the name of the form type
Returns:
a map containing the names of the fields and their type
Throws:
VradiException

updateFormType2

public org.sharengo.wikitty.WikittyExtension updateFormType2(String name,
                                                             Map<String,org.sharengo.wikitty.FieldType> fields,
                                                             String requires,
                                                             Map<String,String> tagValues)
                                                      throws VradiException
Description copied from interface: VradiStorageService
Creates or Update a form type.

Specified by:
updateFormType2 in interface VradiStorageService
Parameters:
name - the name of the form type
fields - the fields of the form type
requires - the extension requred by the extension to update
tagValues - the map containing the tags and their values
Returns:
a WikittyExtension
Throws:
VradiException

updateFormType

public org.sharengo.wikitty.WikittyExtension updateFormType(org.sharengo.wikitty.WikittyExtension extension)
                                                     throws VradiException
Description copied from interface: VradiStorageService
Creates or Update a form type.

Specified by:
updateFormType in interface VradiStorageService
Parameters:
extension - the extension designing the form type
Returns:
a WikittyExtension
Throws:
VradiException

getForm

public Form getForm(String formId)
Description copied from interface: VradiStorageService
Returns a Form with the specified formId.

Specified by:
getForm in interface VradiStorageService
Parameters:
formId - the id of the form
Returns:
the form whose id is id

deleteForm

public void deleteForm(String formId)
Description copied from interface: VradiStorageService
Deletes a Form by the specified formId.

Specified by:
deleteForm in interface VradiStorageService
Parameters:
formId - the id of the Form to delete

getForms

public List<Form> getForms(List<String> formIds)
Description copied from interface: VradiStorageService
Returns all the Forms with the specified list of formIds.

Specified by:
getForms in interface VradiStorageService
Parameters:
formIds - the ids of the forms
Returns:
a list of Form

getAllForms

public List<Form> getAllForms()
Description copied from interface: VradiStorageService
Returns all Forms.

Specified by:
getAllForms in interface VradiStorageService
Returns:
a list of Form

getAllXmlStreams

public List<XmlStream> getAllXmlStreams()
Description copied from interface: VradiStorageService
Returns all XmlStreams.

Specified by:
getAllXmlStreams in interface VradiStorageService
Returns:
a list of XmlStream

updateXmlFieldBindings

public List<XmlFieldBinding> updateXmlFieldBindings(List<XmlFieldBinding> bindings)
                                             throws VradiException
Description copied from interface: VradiStorageService
Update a list of XmlFieldBinding.

Specified by:
updateXmlFieldBindings in interface VradiStorageService
Parameters:
bindings - the list of XmlFieldBinding to update
Returns:
the list of updated XmlFieldBinding
Throws:
VradiException

updateXmlStream

public XmlStream updateXmlStream(XmlStream xmlStream,
                                 List<XmlFieldBinding> bindings)
                          throws VradiException
Specified by:
updateXmlStream in interface VradiStorageService
Throws:
VradiException

getXmlStream

public XmlStream getXmlStream(String xmlStreamId)
                       throws VradiException
Description copied from interface: VradiStorageService
Returns a XmlStream with the specified xmlStreamId.

Specified by:
getXmlStream in interface VradiStorageService
Parameters:
xmlStreamId - the id of the XmlStream
Returns:
a XmlStream
Throws:
VradiException

getXmlFieldBinding

public XmlFieldBinding getXmlFieldBinding(String xmlFieldBindingId)
Description copied from interface: VradiStorageService
Returns a XmlFieldBinding with the specified xmlFieldBindingId.

Specified by:
getXmlFieldBinding in interface VradiStorageService
Parameters:
xmlFieldBindingId - the id of the XmlFieldBinding
Returns:
a XmlFieldBinding

getXmlFieldBindings

public List<XmlFieldBinding> getXmlFieldBindings(XmlStream xmlStream)
Description copied from interface: VradiStorageService
Returns a list of XmlFieldBinding belonging to the specified xmlStream.

Specified by:
getXmlFieldBindings in interface VradiStorageService
Parameters:
xmlStream - the XmlStream
Returns:
a list of XmlFieldBinding

bindForms

public void bindForms()
               throws VradiException
Description copied from interface: VradiStorageService
Binds all queryMaker with the forms found by their queries and not already sent.

Specified by:
bindForms in interface VradiStorageService
Throws:
VradiException

createSending

public List<Sending> createSending(Session session,
                                   QueryMaker queryMaker,
                                   List<Form> formsToBind)
                            throws VradiException
Description copied from interface: VradiStorageService
Create new Sending

Specified by:
createSending in interface VradiStorageService
Returns:
Throws:
VradiException

removeAllSending

public List<Sending> removeAllSending(Session session,
                                      Form form,
                                      QueryMaker queryMaker)
                               throws VradiException
Specified by:
removeAllSending in interface VradiStorageService
Throws:
VradiException

getSessions

public List<Session> getSessions(Date sessionDate)
                          throws VradiException
Description copied from interface: VradiStorageService
Get all session by date

Specified by:
getSessions in interface VradiStorageService
Parameters:
sessionDate - Date concerned
Returns:
a list of VradiSessionDTO
Throws:
VradiException

getFormsFromXmlStream

public int[] getFormsFromXmlStream(XmlStream xmlStream,
                                   VradiUser vradiUser)
                            throws VradiException
Description copied from interface: VradiStorageService
Creates and store forms from an XmlStream by using the XmlStreamBinding to link xml stream field values with form fields.

Specified by:
getFormsFromXmlStream in interface VradiStorageService
Parameters:
xmlStream - the xml stream to read
vradiUser - the VradiUser that launched the import
Returns:
an array containing : - the number of created forms - the number of already existing forms (non created) - the number of forms created with date parsing error - the number of forms created with number parsing error TODO EC-20100428 return a serializable structure (easier to use)
Throws:
VradiException - for various possible errors

updateVradiUser

public VradiUser updateVradiUser(VradiUser vradiUser)
                          throws VradiException
Description copied from interface: VradiStorageService
Updates a VradiUser.

Specified by:
updateVradiUser in interface VradiStorageService
Parameters:
vradiUser - the VradiUser to update
Returns:
the vradiUser updated
Throws:
VradiException

logVradiUser

public VradiUser logVradiUser(String vradiUserName,
                              String vradiUserPassword)
Description copied from interface: VradiStorageService
Checks if userName and userPassword matches a valid VradiUser.

Specified by:
logVradiUser in interface VradiStorageService
Parameters:
vradiUserName - the username of a VradiUser
vradiUserPassword - the password of a VradiUser
Returns:
a VradiUser or null if either userName or userPassword don't match

updateSendings

public void updateSendings(List<Sending> sendings)
Description copied from interface: VradiStorageService
Update a list of Sending.

Specified by:
updateSendings in interface VradiStorageService
Parameters:
sendings - the list of Sending to update

importData

public void importData(File file)
                throws VradiException
Description copied from interface: VradiStorageService
Import data from an XML file.

Specified by:
importData in interface VradiStorageService
Parameters:
file - the XML file containing datas
Throws:
VradiException

exportData

public String exportData()
                  throws VradiException
Description copied from interface: VradiStorageService
Export the datas into an XML format.

Specified by:
exportData in interface VradiStorageService
Returns:
the datas as an XML String
Throws:
VradiException

importAsCSV

public void importAsCSV(String uri)
                 throws VradiException
Description copied from interface: VradiStorageService
Import all data as CSV. FIXME EC-20100415 will not work in remote mode (or uri maybe be valid for remote server too)

Specified by:
importAsCSV in interface VradiStorageService
Parameters:
uri - uri used to read input stream
Throws:
VradiException - if any error happen during import

exportAsCSV

public String exportAsCSV(org.sharengo.wikitty.Criteria criteria)
                   throws VradiException
Description copied from interface: VradiStorageService
Get csv export.

Specified by:
exportAsCSV in interface VradiStorageService
Parameters:
criteria - export criteria
Returns:
csv export
Throws:
VradiException - if any error happen during export

reindexData

public void reindexData()
Description copied from interface: VradiStorageService
Reindex the datas.

Specified by:
reindexData in interface VradiStorageService

getRootThesaurus

public org.sharengo.wikitty.TreeNodeImpl getRootThesaurus()
                                                   throws VradiException
Description copied from interface: VradiStorageService
Returns the root Thesaurus Node.

Specified by:
getRootThesaurus in interface VradiStorageService
Returns:
a TreeNodeImpl
Throws:
VradiException

getAllThesaurus

public List<org.sharengo.wikitty.TreeNodeImpl> getAllThesaurus()
                                                        throws VradiException
Description copied from interface: VradiStorageService
Returns all TreeNodeImpl considered as thesaurus nodes.

Specified by:
getAllThesaurus in interface VradiStorageService
Returns:
a list of TreeNodeImpl
Throws:
VradiException

getThesaurus

public org.sharengo.wikitty.TreeNodeImpl getThesaurus(String thesaurusId)
                                               throws VradiException
Description copied from interface: VradiStorageService
Returns a TreeNodeImpl with the specified thesaurusId.

Specified by:
getThesaurus in interface VradiStorageService
Parameters:
thesaurusId - the id of the thesaurus
Returns:
a TreeNodeImpl
Throws:
VradiException

getChildrenThesaurus

public List<org.sharengo.wikitty.TreeNodeImpl> getChildrenThesaurus(String thesaurusId)
                                                             throws VradiException
Description copied from interface: VradiStorageService
Returns all children of the specified thesaurusId.

Specified by:
getChildrenThesaurus in interface VradiStorageService
Returns:
all list of TreeNodeImpl
Throws:
VradiException

getNbFormsForThesaurus

public int getNbFormsForThesaurus(String thesaurusId)
                           throws VradiException
Description copied from interface: VradiStorageService
Computes the number of forms associated with the specified thesaurusId.

Specified by:
getNbFormsForThesaurus in interface VradiStorageService
Returns:
the number of forms associated
Throws:
VradiException

getStatus

public Status getStatus(String statusId)
                 throws VradiException
Description copied from interface: VradiStorageService
Returns a Status with the specified statusId.

Specified by:
getStatus in interface VradiStorageService
Parameters:
statusId - the id of the status
Returns:
a Status
Throws:
VradiException

getStatuses

public List<Status> getStatuses(List<String> statusIds)
                         throws VradiException
Description copied from interface: VradiStorageService
Returns a list of Status with the specified statusIds.

Specified by:
getStatuses in interface VradiStorageService
Parameters:
statusIds - the ids of the statuses
Returns:
a list of Status
Throws:
VradiException

getAllStatuses

public List<Status> getAllStatuses()
                            throws VradiException
Description copied from interface: VradiStorageService
Returns all Status.

Specified by:
getAllStatuses in interface VradiStorageService
Returns:
a list of Status
Throws:
VradiException

updateStatus

public Status updateStatus(Status status)
                    throws VradiException
Description copied from interface: VradiStorageService
Updates a Status.

Specified by:
updateStatus in interface VradiStorageService
Parameters:
status - the Status to update
Returns:
the Status updated
Throws:
VradiException

updateStatuses

public List<Status> updateStatuses(List<Status> statuses)
                            throws VradiException
Description copied from interface: VradiStorageService
Updates a list of Status.

Specified by:
updateStatuses in interface VradiStorageService
Parameters:
statuses - the list of Status to update
Returns:
the list of the Status updated
Throws:
VradiException

deleteStatus

public void deleteStatus(String statusId)
                  throws VradiException
Description copied from interface: VradiStorageService
Deletes a Status.

Specified by:
deleteStatus in interface VradiStorageService
Parameters:
statusId - the id of the Status to delete
Throws:
VradiException

deleteStatuses

public void deleteStatuses(List<String> statusIds)
                    throws VradiException
Description copied from interface: VradiStorageService
Deletes a list of Status.

Specified by:
deleteStatuses in interface VradiStorageService
Parameters:
statusIds - the list of ids of the Status to delete
Throws:
VradiException

proposeThesaurus

public List<org.sharengo.wikitty.TreeNodeImpl> proposeThesaurus(Form form,
                                                                List<org.sharengo.wikitty.TreeNodeImpl> thesaurus)
                                                         throws VradiException
Description copied from interface: VradiStorageService
Propose thesaurus nodes that might be in relation with a specified form

Specified by:
proposeThesaurus in interface VradiStorageService
Parameters:
form - the Form containing the information needed to search the thesaurus nodes
thesaurus - the list of all the tree nodes of the thesaurus
Returns:
a list of TreeNodeImpl
Throws:
VradiException

archiveQueries

public void archiveQueries(QueryMaker queryMaker)
                    throws VradiException
Description copied from interface: VradiStorageService
Archives the queries of a user, client or group in a RSS file.

Specified by:
archiveQueries in interface VradiStorageService
Parameters:
queryMaker - the query maker whose queries are archived
Throws:
VradiException

autoLoadFormsFromXmlStreams

public void autoLoadFormsFromXmlStreams(String intervalUnit,
                                        int intervalValue,
                                        Integer hour,
                                        Integer minute)
                                 throws VradiException
Description copied from interface: VradiStorageService
Regularly retrieves the information from all the xml streams and create new forms

Specified by:
autoLoadFormsFromXmlStreams in interface VradiStorageService
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

uploadFiles

public void uploadFiles(Form form,
                        List<File> files)
                 throws IOException
Description copied from interface: VradiStorageService
Upload files attached to a form.

Specified by:
uploadFiles in interface VradiStorageService
Throws:
IOException

uploadAttachments

public void uploadAttachments(Form form,
                              List<File> attachments)
                       throws IOException
Description copied from interface: VradiStorageService
Upload attachments attached to a form.

Specified by:
uploadAttachments in interface VradiStorageService
Throws:
IOException

addTemplate

public File addTemplate(org.sharengo.wikitty.WikittyExtension extension,
                        File template)
                 throws VradiException
Description copied from interface: VradiStorageService
Associates a new template file to the specified extension

Specified by:
addTemplate in interface VradiStorageService
Returns:
the file copied in the vradi template folder
Throws:
VradiException

getTemplates

public File[] getTemplates(org.sharengo.wikitty.WikittyExtension extension)
Description copied from interface: VradiStorageService
Lists the template files associated with the specified extension

Specified by:
getTemplates in interface VradiStorageService
Returns:

getTemplate

public File getTemplate(String extensionName,
                        String templateName)
Specified by:
getTemplate in interface VradiStorageService
Returns:

setAssociatedFields

public void setAssociatedFields(String extensionName,
                                String templateName,
                                Map<String,String> fieldMap)
                         throws VradiException,
                                IOException
Specified by:
setAssociatedFields in interface VradiStorageService
Throws:
VradiException
IOException

getAssociatedFields

public Map<String,String> getAssociatedFields(String extensionName,
                                              String templateName)
                                       throws VradiException
Specified by:
getAssociatedFields in interface VradiStorageService
Throws:
VradiException

getQueriesToModifyAfterThesaurusModification

public Map<QueryMaker,List<VradiQueryBean>> getQueriesToModifyAfterThesaurusModification(String thesaurusName)
Description copied from interface: VradiStorageService
Gets the query makers whose queries are potentially to modify after a thesaurus node modification

Specified by:
getQueriesToModifyAfterThesaurusModification in interface VradiStorageService
Parameters:
thesaurusName - the modified thesaurus name node
Returns:
a map containing the query makers and their queries which contains the thesaurus node name


Copyright © 2009-2010 JurisMarches. All Rights Reserved.