com.jurismarches.vradi.services
Interface VradiStorageService

All Known Implementing Classes:
VradiStorageServiceImpl

public interface VradiStorageService

VradiStorageService.

Version:
$Revision: 495 $ $Date: 2010-02-09 11:15:15 +0100 (mar., 09 févr. 2010) $
Author:
morin

Method Summary
 void bindFormsToClients()
          Binds all clients with the forms found by their queries and not already sent.
 void changeDataDir(String newDataDir, String oldDataDir)
          Changes datas directory.
 void deleteEntity(org.sharengo.wikitty.BusinessEntity entity)
          Delete the specified BusinessEntity.
 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 exportData()
          Export the datas into an XML format.
 void findForms(String query, VradiFormPageDTO formPageDTO)
          Searches for forms with the specified query.
 void findForms(String query, org.sharengo.wikitty.WikittyExtension extension, String dateType, Date beginDate, Date endDate, List<String>[] theasurus, VradiFormPageDTO formPageDTO)
          Searches for forms with the specified filters.
 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.TreeNode> getAllThesaurus()
          Returns all TreeNode considered as thesaurus nodes.
 List<User> getAllUsers()
          Returns all the Users.
 List<XmlStream> getAllXmlStreams()
          Returns all XmlStreams.
 List<org.sharengo.wikitty.TreeNode> 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.
 Map<Form,List<Client>> getClientsByForms(String dateType, Date beginDate, Date endDate, org.sharengo.wikitty.WikittyExtension extension)
          Computes a map of Clients indexed by Forms.
 List<User> getClientUsers(String clientId)
          Returns a list of Users belonging to the specified clientId.
 org.sharengo.wikitty.BusinessEntity getEntity(String id, Class<? extends org.sharengo.wikitty.BusinessEntity> 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.
 List<VradiSendingDTO> getFormsByClients(String dateType, Date beginDate, Date endDate, org.sharengo.wikitty.WikittyExtension extension, Boolean receptionProof, Boolean paragraph, int status)
          Computes all forms by clients, status and sent date with a filter.
 Object[] getFormsFromXmlStream(XmlStream xmlStream, String lastItemRecorded, 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<Group> getGroupsByClientId(String clientId)
          Returns a list of Group that the specified clientId belongs.
 List<Group> getGroupsByUserId(String userId)
          Returns a list of Group that the specified userId belongs.
 List<User> getGroupUsers(String groupId)
          Returns a list of Users belonging to the specified groupId.
 Map<org.sharengo.wikitty.TreeNode,Integer> getNbFormsByThesaurus()
          Computes the number of forms associated with every thesaurus node.
 int getNbFormsForThesaurus(String thesaurusId)
          Computes the number of forms associated with the specified thesaurusId.
 List<String> getQueriesReturningForm(Form form)
          Computes a list of queries returning the specified Form.
 org.sharengo.wikitty.TreeNode getRootThesaurus()
          Returns the root Thesaurus Node.
 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.
 org.sharengo.wikitty.TreeNode getThesaurus(String thesaurusId)
          Returns a TreeNode with the specified thesaurusId.
 Status getToTreatStatus()
          Get the unmodifiable status 'to treat'
 User getUser(String userId)
          Returns a User with the specified userId.
 Status getValidatedStatus()
          Get the unmodifiable status 'validated'
 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 importData(File file)
          Import data from an XML file.
 VradiUser logVradiUser(String userName, String userPassword)
          Checks if userName and userPassword matches a valid VradiUser.
 List<org.sharengo.wikitty.TreeNode> proposeThesaurus(Form form, List<org.sharengo.wikitty.TreeNode> thesaurus)
          Propose thesaurus nodes that might be in relation with a specified form
 void reindexData()
          Reindex the datas.
 org.sharengo.wikitty.BusinessEntity updateEntity(org.sharengo.wikitty.BusinessEntity 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(String name, Map<String,org.sharengo.wikitty.FieldType> fields, String requires, Map<String,String> tagValues)
          Creates or Update a form type.
 org.sharengo.wikitty.WikittyExtension updateFormType(org.sharengo.wikitty.WikittyExtension extension)
          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.
 

Method Detail

getEntity

org.sharengo.wikitty.BusinessEntity getEntity(String id,
                                              Class<? extends org.sharengo.wikitty.BusinessEntity> clazz)
                                              throws TechnicalException
Returns a BusinessEntity of the specified id and clazz.

Parameters:
id - the id of the entity
clazz - the class of the entity
Returns:
a BusinessEntity
Throws:
TechnicalException

updateEntity

org.sharengo.wikitty.BusinessEntity updateEntity(org.sharengo.wikitty.BusinessEntity entity)
                                                 throws TechnicalException
Updates the specified BusinessEntity.

Parameters:
entity - the entity to update
Returns:
the updated entity
Throws:
TechnicalException

deleteEntity

void deleteEntity(org.sharengo.wikitty.BusinessEntity entity)
                  throws TechnicalException
Delete the specified BusinessEntity.

Parameters:
entity - the entity to delete
Throws:
TechnicalException

getClient

Client getClient(String clientId)
                 throws TechnicalException
Returns a Client with the specified clientId.

Parameters:
clientId - the id of the client
Returns:
a Client
Throws:
TechnicalException

getUser

User getUser(String userId)
             throws TechnicalException
Returns a User with the specified userId.

Parameters:
userId - the id of the user
Returns:
a User
Throws:
TechnicalException

getGroup

Group getGroup(String groupId)
               throws TechnicalException
Returns a Group with the specified groupId.

Parameters:
groupId - the id of the group
Returns:
a Group
Throws:
TechnicalException

getGroupUsers

List<User> getGroupUsers(String groupId)
                         throws TechnicalException
Returns a list of Users belonging to the specified groupId.

Parameters:
groupId - the id of the group
Returns:
a list of Users
Throws:
TechnicalException

getClientUsers

List<User> getClientUsers(String clientId)
                          throws TechnicalException
Returns a list of Users belonging to the specified clientId.

Parameters:
clientId - the id of the client
Returns:
a list of Users
Throws:
TechnicalException

getGroupClients

List<Client> getGroupClients(String groupId)
                             throws TechnicalException
Returns a list of Clients belonging to the specified groupId.

Parameters:
groupId - the id of the group
Returns:
a list of Clients
Throws:
TechnicalException

getClientByUserId

Client getClientByUserId(String userId)
                         throws TechnicalException
Returns a Client whose specified userId belongs.

Parameters:
userId - the id of the user
Returns:
a Client
Throws:
TechnicalException

getGroupsByUserId

List<Group> getGroupsByUserId(String userId)
                              throws TechnicalException
Returns a list of Group that the specified userId belongs.

Parameters:
userId - the id of the user
Returns:
a list of Group
Throws:
TechnicalException

getGroupsByClientId

List<Group> getGroupsByClientId(String clientId)
                                throws TechnicalException
Returns a list of Group that the specified clientId belongs.

Parameters:
clientId - the id of the client
Returns:
a list of Group
Throws:
TechnicalException

getAllClients

List<Client> getAllClients()
                           throws TechnicalException
Returns all the clients.

Returns:
all the clients
Throws:
TechnicalException

getAllGroups

List<Group> getAllGroups()
                         throws TechnicalException
Returns all the groups.

Returns:
all the groups
Throws:
TechnicalException

updateXmlFieldBindings

List<XmlFieldBinding> updateXmlFieldBindings(List<XmlFieldBinding> bindings)
                                             throws TechnicalException
Update a list of XmlFieldBinding.

Parameters:
bindings - the list of XmlFieldBinding to update
Returns:
the list of updated XmlFieldBinding
Throws:
TechnicalException

updateFormType

org.sharengo.wikitty.WikittyExtension updateFormType(org.sharengo.wikitty.WikittyExtension extension)
                                                     throws TechnicalException
Creates or Update a form type.

Parameters:
extension - the extension designing the form type
Returns:
a WikittyExtension
Throws:
TechnicalException

updateFormType

org.sharengo.wikitty.WikittyExtension updateFormType(String name,
                                                     Map<String,org.sharengo.wikitty.FieldType> fields,
                                                     String requires,
                                                     Map<String,String> tagValues)
                                                     throws TechnicalException
Creates or Update a form type.

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:
TechnicalException

updateForm

Form updateForm(Form form)
                throws TechnicalException
Creates or Update the specified form.

Parameters:
form - the form to create or update
Returns:
the stored Form
Throws:
TechnicalException

getXmlStream

XmlStream getXmlStream(String xmlStreamId)
                       throws TechnicalException
Returns a XmlStream with the specified xmlStreamId.

Parameters:
xmlStreamId - the id of the XmlStream
Returns:
a XmlStream
Throws:
TechnicalException

getXmlFieldBindings

List<XmlFieldBinding> getXmlFieldBindings(XmlStream xmlStream)
                                          throws TechnicalException
Returns a list of XmlFieldBinding belonging to the specified xmlStream.

Parameters:
xmlStream - the XmlStream
Returns:
a list of XmlFieldBinding
Throws:
TechnicalException

getXmlFieldBinding

XmlFieldBinding getXmlFieldBinding(String xmlFieldBindingId)
                                   throws TechnicalException
Returns a XmlFieldBinding with the specified xmlFieldBindingId.

Parameters:
xmlFieldBindingId - the id of the XmlFieldBinding
Returns:
a XmlFieldBinding
Throws:
TechnicalException

getThesaurus

org.sharengo.wikitty.TreeNode getThesaurus(String thesaurusId)
                                           throws TechnicalException
Returns a TreeNode with the specified thesaurusId.

Parameters:
thesaurusId - the id of the thesaurus
Returns:
a TreeNode
Throws:
TechnicalException

getRootThesaurus

org.sharengo.wikitty.TreeNode getRootThesaurus()
                                               throws TechnicalException
Returns the root Thesaurus Node.

Returns:
a TreeNode
Throws:
TechnicalException

getChildrenThesaurus

List<org.sharengo.wikitty.TreeNode> getChildrenThesaurus(String thesaurusId)
                                                         throws TechnicalException
Returns all children of the specified thesaurusId.

Returns:
all list of TreeNode
Throws:
TechnicalException

getFormTypeFields

Map<String,org.sharengo.wikitty.FieldType> getFormTypeFields(String name)
                                                             throws TechnicalException
Finds fields of a form type.

Parameters:
name - the name of the form type
Returns:
a map containing the names of the fields and their type
Throws:
TechnicalException

getFormType

org.sharengo.wikitty.WikittyExtension getFormType(String name)
                                                  throws TechnicalException
Returns a form type with the specified name.

Parameters:
name - the name of the form type
Returns:
a WikittyExtension
Throws:
TechnicalException

getForm

Form getForm(String formId)
             throws TechnicalException
Returns a Form with the specified formId.

Parameters:
formId - the id of the form
Returns:
the form whose id is id
Throws:
TechnicalException

getAllXmlStreams

List<XmlStream> getAllXmlStreams()
                                 throws TechnicalException
Returns all XmlStreams.

Returns:
a list of XmlStream
Throws:
TechnicalException

getAllThesaurus

List<org.sharengo.wikitty.TreeNode> getAllThesaurus()
                                                    throws TechnicalException
Returns all TreeNode considered as thesaurus nodes.

Returns:
a list of TreeNode
Throws:
TechnicalException

getAllFormTypes

List<org.sharengo.wikitty.WikittyExtension> getAllFormTypes()
                                                            throws TechnicalException
Returns all Form Types.

Returns:
a list of WikittyExtension
Throws:
TechnicalException

getAllForms

List<Form> getAllForms()
                       throws TechnicalException
Returns all Forms.

Returns:
a list of Form
Throws:
TechnicalException

findForms

void findForms(String query,
               org.sharengo.wikitty.WikittyExtension extension,
               String dateType,
               Date beginDate,
               Date endDate,
               List<String>[] theasurus,
               VradiFormPageDTO formPageDTO)
               throws TechnicalException,
                      UnsupportedQueryException
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.

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
formPageDTO - ...
Throws:
UnsupportedQueryException
TechnicalException

findForms

void findForms(String query,
               VradiFormPageDTO formPageDTO)
               throws TechnicalException,
                      UnsupportedQueryException
Searches for forms with the specified query.

Parameters:
query - the query to filter the forms
formPageDTO - ...
Throws:
UnsupportedQueryException
TechnicalException

deleteForm

void deleteForm(String formId)
                throws TechnicalException
Deletes a Form by the specified formId.

Parameters:
formId - the id of the Form to delete
Throws:
TechnicalException

bindFormsToClients

void bindFormsToClients()
                        throws TechnicalException
Binds all clients with the forms found by their queries and not already sent.

Throws:
TechnicalException

getFormsByClients

List<VradiSendingDTO> getFormsByClients(String dateType,
                                        Date beginDate,
                                        Date endDate,
                                        org.sharengo.wikitty.WikittyExtension extension,
                                        Boolean receptionProof,
                                        Boolean paragraph,
                                        int status)
                                        throws TechnicalException
Computes all forms by clients, status and sent date with a filter.

Parameters:
dateType - the date field. Must be fully qualified (extension.field)
beginDate - the begin date filter
endDate - the end date filter
extension - the extension filter
receptionProof - true if the sending must have a reception proof
paragraph - the paragraph sent with the forms
status - the status of the sending
Returns:
a list of VradiSendingDTO representing the forms sent to the clients
Throws:
TechnicalException

getClientsByForms

Map<Form,List<Client>> getClientsByForms(String dateType,
                                         Date beginDate,
                                         Date endDate,
                                         org.sharengo.wikitty.WikittyExtension extension)
                                         throws TechnicalException
Computes a map of Clients indexed by Forms.

Parameters:
dateType - the date field. Must be fully qualified (extension.field)
beginDate - the begin date filter
endDate - the end date filter
extension - the extension filter
Returns:
a map containing the forms and their associated list of clients
Throws:
TechnicalException

getFormsFromXmlStream

Object[] getFormsFromXmlStream(XmlStream xmlStream,
                               String lastItemRecorded,
                               VradiUser vradiUser)
                               throws TechnicalException
Creates and store forms from an XmlStream by using the XmlStreamBinding to link xml stream field values with form fields.

Parameters:
xmlStream - the xml stream to read
lastItemRecorded - the encrypted value of the last read item of the xml stream
vradiUser - the VradiUser that launched the import
Returns:
an arry containing : - the encrypted value of the last read item of the xml stream - the number of created forms - the number of forms created with date parsing error - the number of forms created with number parsing error
Throws:
TechnicalException

changeDataDir

void changeDataDir(String newDataDir,
                   String oldDataDir)
                   throws TechnicalException
Changes datas directory.

Parameters:
newDataDir - the new data directory path
oldDataDir - the old data directory path. If null, the data in the old directory will not be copied.
Throws:
TechnicalException

getAllUsers

List<User> getAllUsers()
                       throws TechnicalException
Returns all the Users.

Returns:
a list of User
Throws:
TechnicalException

getQueriesReturningForm

List<String> getQueriesReturningForm(Form form)
                                     throws TechnicalException
Computes a list of queries returning the specified Form.

Parameters:
form - the form which match queries
Returns:
a list of queries
Throws:
TechnicalException

getForms

List<Form> getForms(List<String> formIds)
                    throws TechnicalException
Returns all the Forms with the specified list of formIds.

Parameters:
formIds - the ids of the forms
Returns:
a list of Form
Throws:
TechnicalException

updateVradiUser

VradiUser updateVradiUser(VradiUser vradiUser)
                          throws TechnicalException
Updates a VradiUser.

Parameters:
vradiUser - the VradiUser to update
Returns:
the vradiUser updated
Throws:
TechnicalException

logVradiUser

VradiUser logVradiUser(String userName,
                       String userPassword)
                       throws TechnicalException
Checks if userName and userPassword matches a valid VradiUser.

Parameters:
userName - the username of a VradiUser
userPassword - the password of a VradiUser
Returns:
a VradiUser or null if either userName or userPassword don't match
Throws:
TechnicalException

updateSendings

void updateSendings(List<Sending> sendings)
                    throws TechnicalException
Update a list of Sending.

Parameters:
sendings - the list of Sending to update
Throws:
TechnicalException

importData

void importData(File file)
                throws TechnicalException
Import data from an XML file.

Parameters:
file - the XML file containing datas
Throws:
TechnicalException

exportData

String exportData()
                  throws TechnicalException
Export the datas into an XML format.

Returns:
the datas as an XML String
Throws:
TechnicalException

updateForms

List<Form> updateForms(List<Form> forms)
                       throws TechnicalException
Create or Update a list of Forms.

Parameters:
forms - the list of forms to insert or update
Returns:
an updated list of Form
Throws:
TechnicalException

reindexData

void reindexData()
                 throws TechnicalException
Reindex the datas.

Throws:
TechnicalException

getNbFormsByThesaurus

Map<org.sharengo.wikitty.TreeNode,Integer> getNbFormsByThesaurus()
                                                                 throws TechnicalException
Computes the number of forms associated with every thesaurus node.

Returns:
a map containing the thesaurus nodes and the number of forms associated with them
Throws:
TechnicalException

getNbFormsForThesaurus

int getNbFormsForThesaurus(String thesaurusId)
                           throws TechnicalException
Computes the number of forms associated with the specified thesaurusId.

Returns:
the number of forms associated
Throws:
TechnicalException

getStatus

Status getStatus(String statusId)
                 throws TechnicalException
Returns a Status with the specified statusId.

Parameters:
statusId - the id of the status
Returns:
a Status
Throws:
TechnicalException

getStatuses

List<Status> getStatuses(List<String> statusIds)
                         throws TechnicalException
Returns a list of Status with the specified statusIds.

Parameters:
statusIds - the ids of the statuses
Returns:
a list of Status
Throws:
TechnicalException

getAllStatuses

List<Status> getAllStatuses()
                            throws TechnicalException
Returns all Status.

Returns:
a list of Status
Throws:
TechnicalException

updateStatus

Status updateStatus(Status status)
                    throws TechnicalException
Updates a Status.

Parameters:
status - the Status to update
Returns:
the Status updated
Throws:
TechnicalException

updateStatuses

List<Status> updateStatuses(List<Status> statuses)
                            throws TechnicalException
Updates a list of Status.

Parameters:
statuses - the list of Status to update
Returns:
the list of the Status updated
Throws:
TechnicalException

deleteStatus

void deleteStatus(String statusId)
                  throws TechnicalException
Deletes a Status.

Parameters:
statusId - the id of the Status to delete
Throws:
TechnicalException

deleteStatuses

void deleteStatuses(List<String> statusIds)
                    throws TechnicalException
Deletes a list of Status.

Parameters:
statusIds - the list of ids of the Status to delete
Throws:
TechnicalException

getToTreatStatus

Status getToTreatStatus()
Get the unmodifiable status 'to treat'

Returns:
a Status

getValidatedStatus

Status getValidatedStatus()
Get the unmodifiable status 'validated'

Returns:
a Status

proposeThesaurus

List<org.sharengo.wikitty.TreeNode> proposeThesaurus(Form form,
                                                     List<org.sharengo.wikitty.TreeNode> thesaurus)
                                                     throws TechnicalException
Propose thesaurus nodes that might be in relation with a specified form

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 TreeNode
Throws:
TechnicalException


Copyright © 2009-2010 JurisMarches. All Rights Reserved.