com.jurismarches.vradi.services
Interface VradiStorageService

All Known Implementing Classes:
VradiStorageServiceImpl

public interface VradiStorageService

Vradi storage service. This service is intended to be used in remote mode. Typical usage is code that can be run only on server :

Version:
$Revision: 1522 $ $Date: 2010-09-28 18:33:42 +0200 (mar., 28 sept. 2010) $
Author:
morin

Method Summary
 void archiveQueries(QueryMaker queryMaker)
          Archives the queries of a user, client or group in a RSS file.
 Session bindForms(Session session)
          Binds all queryMaker with the forms found by their queries and not already sent.
 boolean checkTemplateExist(String extensionName)
          Check if template file form extension name in param
 List<Sending> createAllSending(Session session, Group group, List<Form> formsToBind)
          Create new Sending
 List<Status> createDefaultStatuses()
          Creation of default status Warn, dont use it otherwise for vradi initialisation !!!
 Session createNewSession()
           
 Sending createSending(Session session, User user, List<Form> formsToBind)
          Create new Sending
 VradiUser createUser(VradiUser user)
          Create a VradiUser.
 void deleteClient(String clientId)
          Delete client, users associated and user groups association
 void deleteGroup(String groupId)
          Delete group
 void deleteSession(String sessionId)
          Delete session and sending associated This method return a VradiException if session to delete is not active
 boolean deleteStatus(List<String> statusIds)
          Delete status if no form is use this
 void deleteUser(String userId)
          Delete users, and groups association
 String exportAsCSV(org.nuiton.wikitty.Criteria criteria)
          Get csv export.
 String exportClientDB()
          Export all the clients, users and groups in database
 Map<Group,List<QueryBean>> findQueriesReturningForm(Form form)
          Computes a list of queries returning the specified Form.
 String generatePDF(Form form, boolean force)
          Generate pdf file for specified form.
 void generatePDFForSession(String sessionId)
          Generate all the PDFs needed to send a session.
 List<String> getAllWebHarvestScripts()
          Get all WebHarvest script name in server's WebHarvest directory.
 Map<String,String> getAssociatedFields(String extensionName, String templateName)
          Get association between template fields and extension fields.
 List<String> getDocumentFields(org.nuiton.wikitty.WikittyExtension extension, String templateName)
          Get template document fields names.
 org.nuiton.wikitty.WikittyExtension getFormType(String name)
          Returns a form type with the specified name.
 Map<String,org.nuiton.wikitty.FieldType> getFormTypeFields(String name)
          Finds fields of a form type.
 List<Group> getGroupsForUser(String userId)
          Get all the groups a user is in.
 Session getLastCloseSession()
          Get last closed session
 Session getLastOpenSession()
          Get last opened session
 Map<Group,List<QueryBean>> getQueriesToModifyAfterThesaurusModification(String rootThesaurusName, String thesaurusName)
          Gets the query makers whose queries are potentially to modify after a thesaurus node modification
 Session getSessionOfSending(String sendingId)
          Get session contain sending
 List<Session> getSessions(Date sessionDate)
          Get all session by date
 Status getStatus(VradiConstants.FormStatus formStatus)
          Get the status passed in parameter.
 Collection<String> getTemplateFilenames(org.nuiton.wikitty.WikittyExtension extension)
          Lists the template filename (simple name) associated with the specified extension.
 String getWebHarvestPreviewURL(WebHarvestStream stream)
          Get web harvest preview url from script
 void importAsCSV(String uri)
          Import all data as CSV.
 XmlStreamImportResult importFormsFromWebHarvestStream(WebHarvestStream webHarvestStream)
          Creates and store forms from an WebHarvestXmlStream 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.
 VradiUser loginUser(String login, String md5Password)
          Checks if userName and userPassword matches a valid VradiUser.
 List<Thesaurus> proposeThesaurus(Form form)
          Propose thesaurus nodes that might be in relation with a specified form
 void receiveMessages()
           
 void reindexData()
          Reindex the datas.
 List<Sending> removeAllSending(Session session, Form form, Group group)
          Remove all sending corresponding with form and group from session
 boolean removeFormsFromSession(List<Form> forms)
          Check if template file form extension name in param
 Sending removeSending(Session session, Form form, User user)
          Remove sending corresponding with form and user from session
 Sending sendMessage(String sendingId, String sessionParagraph)
           
 Sending sendMessage(String sendingId, String sessionParagraph, String email)
           
 Session sendMessages(String sessionId)
           
 void setAssociatedFields(String extensionName, String templateName, Map<String,String> fieldMap)
          Save association between template fields and extensions fields.
 Session stopSentMail(Session session)
           
 

Method Detail

deleteClient

void deleteClient(String clientId)
                  throws VradiException
Delete client, users associated and user groups association

Parameters:
clientId - to delete
Throws:
VradiException

deleteUser

void deleteUser(String userId)
                throws VradiException
Delete users, and groups association

Parameters:
userId - to delete
Throws:
VradiException

deleteGroup

void deleteGroup(String groupId)
                 throws VradiException
Delete group

Parameters:
groupId - to delete
Throws:
VradiException

createDefaultStatuses

List<Status> createDefaultStatuses()
                                   throws VradiException
Creation of default status Warn, dont use it otherwise for vradi initialisation !!!

Returns:
list of defautl status created
Throws:
VradiException

getFormTypeFields

Map<String,org.nuiton.wikitty.FieldType> getFormTypeFields(String name)
                                                           throws VradiException
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:
VradiException

getFormType

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

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

bindForms

Session bindForms(Session session)
                  throws VradiException
Binds all queryMaker with the forms found by their queries and not already sent.

Throws:
VradiException

createAllSending

List<Sending> createAllSending(Session session,
                               Group group,
                               List<Form> formsToBind)
                               throws VradiException
Create new Sending

Parameters:
session -
group -
formsToBind -
Returns:
Throws:
VradiException

createSending

Sending createSending(Session session,
                      User user,
                      List<Form> formsToBind)
                      throws VradiException
Create new Sending

Parameters:
session -
user -
formsToBind -
Returns:
Throws:
VradiException

createNewSession

Session createNewSession()
                         throws VradiException
Throws:
VradiException

getSessions

List<Session> getSessions(Date sessionDate)
                          throws VradiException
Get all session by date

Parameters:
sessionDate - Date concerned
Returns:
a list of VradiSessionDTO
Throws:
VradiException

getLastCloseSession

Session getLastCloseSession()
                            throws VradiException
Get last closed session

Returns:
last opened session
Throws:
VradiException

getLastOpenSession

Session getLastOpenSession()
                           throws VradiException
Get last opened session

Returns:
last opened session
Throws:
VradiException

importFormsFromWebHarvestStream

XmlStreamImportResult importFormsFromWebHarvestStream(WebHarvestStream webHarvestStream)
                                                      throws VradiException
Creates and store forms from an WebHarvestXmlStream 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

importFormsFromXmlStream

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

findQueriesReturningForm

Map<Group,List<QueryBean>> findQueriesReturningForm(Form form)
                                                    throws VradiException
Computes a list of queries returning the specified Form.

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

createUser

VradiUser createUser(VradiUser user)
                     throws VradiException
Create a VradiUser.

Parameters:
user - the user to create
Returns:
the vradiUser updated or null if user can't be created (already exists)
Throws:
VradiException

loginUser

VradiUser loginUser(String login,
                    String md5Password)
                    throws VradiException
Checks if userName and userPassword matches a valid VradiUser.

Parameters:
login - the login of a WikittyUser
md5Password - the password of a WikittyUser (md5 encoded)
Returns:
a WikittyUser or null if either userName or userPassword don't match
Throws:
VradiException

importAsCSV

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

Parameters:
uri - uri used to read input stream
Throws:
VradiException - if any error happen during import

exportAsCSV

String exportAsCSV(org.nuiton.wikitty.Criteria criteria)
                   throws VradiException
Get csv export.

Parameters:
criteria - export criteria
Returns:
csv export
Throws:
VradiException - if any error happen during export

reindexData

void reindexData()
                 throws VradiException
Reindex the datas.

Throws:
VradiException

proposeThesaurus

List<Thesaurus> proposeThesaurus(Form form)
                                 throws VradiException
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
Returns:
a list of Thesaurus
Throws:
VradiException

archiveQueries

void archiveQueries(QueryMaker queryMaker)
                    throws VradiException
Archives the queries of a user, client or group in a RSS file.

Parameters:
queryMaker - the query maker whose queries are archived
Throws:
VradiException

getTemplateFilenames

Collection<String> getTemplateFilenames(org.nuiton.wikitty.WikittyExtension extension)
Lists the template filename (simple name) associated with the specified extension. This need to be called by a WS because an WikittyExtension doesn't have a files fields.

Parameters:
extension -
Returns:

setAssociatedFields

void setAssociatedFields(String extensionName,
                         String templateName,
                         Map<String,String> fieldMap)
                         throws VradiException
Save association between template fields and extensions fields.

Parameters:
extensionName -
templateName -
fieldMap -
Throws:
VradiException

getAssociatedFields

Map<String,String> getAssociatedFields(String extensionName,
                                       String templateName)
                                       throws VradiException
Get association between template fields and extension fields.

Parameters:
extensionName -
templateName -
Returns:
association map or null is there is no association yet
Throws:
VradiException

generatePDF

String generatePDF(Form form,
                   boolean force)
                   throws VradiException
Generate pdf file for specified form.

Parameters:
form - form to generate pdf
force - force regeneration
Returns:
uri to download file
Throws:
VradiException

getQueriesToModifyAfterThesaurusModification

Map<Group,List<QueryBean>> getQueriesToModifyAfterThesaurusModification(String rootThesaurusName,
                                                                        String thesaurusName)
Gets the query makers whose queries are potentially to modify after a thesaurus node modification

Parameters:
rootThesaurusName - the modified root thesaurus name node
thesaurusName - the modified thesaurus name node
Returns:
a map containing the query makers and their queries which contains the thesaurus node name

removeAllSending

List<Sending> removeAllSending(Session session,
                               Form form,
                               Group group)
                               throws VradiException
Remove all sending corresponding with form and group from session

Parameters:
session - concerned
form - concerned
queryMaker - concerned
Returns:
List of sending after deletion
Throws:
VradiException

removeSending

Sending removeSending(Session session,
                      Form form,
                      User user)
                      throws VradiException
Remove sending corresponding with form and user from session

Parameters:
session - concerned
form - concerned
queryMaker - concerned
Returns:
sending after deletion
Throws:
VradiException

getWebHarvestPreviewURL

String getWebHarvestPreviewURL(WebHarvestStream stream)
                               throws VradiException
Get web harvest preview url from script

Parameters:
stream -
Returns:
url of preview file
Throws:
VradiException

getDocumentFields

List<String> getDocumentFields(org.nuiton.wikitty.WikittyExtension extension,
                               String templateName)
                               throws VradiException
Get template document fields names.

Parameters:
extension - extension
templateName - template name
Returns:
field names
Throws:
VradiException

sendMessages

Session sendMessages(String sessionId)
                     throws VradiException
Throws:
VradiException

sendMessage

Sending sendMessage(String sendingId,
                    String sessionParagraph)
                    throws VradiException
Throws:
VradiException

sendMessage

Sending sendMessage(String sendingId,
                    String sessionParagraph,
                    String email)
                    throws VradiException
Throws:
VradiException

receiveMessages

void receiveMessages()
                     throws VradiException
Throws:
VradiException

stopSentMail

Session stopSentMail(Session session)
                     throws VradiException
Throws:
VradiException

getAllWebHarvestScripts

List<String> getAllWebHarvestScripts()
Get all WebHarvest script name in server's WebHarvest directory. All filename doesn't contains "/".

Returns:
script file names

generatePDFForSession

void generatePDFForSession(String sessionId)
Generate all the PDFs needed to send a session.

Parameters:
sessionId - the session wikitty id

getGroupsForUser

List<Group> getGroupsForUser(String userId)
                             throws VradiException
Get all the groups a user is in.

Parameters:
userId - the user we want the groups of
Returns:
the group for our user
Throws:
VradiException

exportClientDB

String exportClientDB()
                      throws VradiException
Export all the clients, users and groups in database

Returns:
the csv export as a String
Throws:
VradiException - if any error happen during export

getStatus

Status getStatus(VradiConstants.FormStatus formStatus)
                 throws VradiException
Get the status passed in parameter. Init status if it have not been done already

Parameters:
formStatus - the status from enum
Returns:
the Status object
Throws:
VradiException - if an error occur during statuses initialisation

getSessionOfSending

Session getSessionOfSending(String sendingId)
                            throws VradiException
Get session contain sending

Parameters:
sendingId - concerned
Returns:
session found
Throws:
VradiException - if an error occur

deleteSession

void deleteSession(String sessionId)
                   throws VradiException
Delete session and sending associated This method return a VradiException if session to delete is not active

Parameters:
sessionId - to delete
Throws:
VradiException - if an error occur during session deletion

deleteStatus

boolean deleteStatus(List<String> statusIds)
                     throws VradiException
Delete status if no form is use this

Parameters:
statusIds - to delete
Returns:
false if not deleted (is in use)
Throws:
VradiException - is occured if status deletion is aborded

checkTemplateExist

boolean checkTemplateExist(String extensionName)
                           throws VradiException
Check if template file form extension name in param

Parameters:
extensionName - to check
Returns:
true if file exist
Throws:
VradiException - if an error occur during checking template

removeFormsFromSession

boolean removeFormsFromSession(List<Form> forms)
                               throws VradiException
Check if template file form extension name in param

Parameters:
forms - to update
Returns:
false if no session opened found
Throws:
VradiException - if an error occur during checking template


Copyright © 2009-2010 JurisMarches. All Rights Reserved.