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: 1317 $ $Date: 2010-09-10 10:29:46 +0200 (ven., 10 sept. 2010) $
Author:
morin

Method Summary
 void archiveQueries(QueryMaker queryMaker)
          Archives the queries of a user, client or group in a RSS file.
 void autoLoadFormsFromXmlStreams(java.lang.String intervalUnit, int intervalValue, java.lang.Integer hour, java.lang.Integer minute)
          Regularly retrieves the information from all the xml streams and create new forms
 Session bindForms(Session session)
          Binds all queryMaker with the forms found by their queries and not already sent.
 java.util.List<Status> createDefaultStatuses()
          Creation of default status Warn, dont use it otherwise for vradi initialisation !!!
 Session createNewSession()
           
 java.util.List<Sending> createSending(Session session, QueryMaker queryMaker, java.util.List<Form> formsToBind)
          Create new Sending
 VradiUser createUser(VradiUser user)
          Create a VradiUser.
 java.lang.String exportAsCSV(org.nuiton.wikitty.Criteria criteria)
          Get csv export.
 java.lang.String exportClientDB()
          Export all the clients, users and groups in database
 java.util.Map<QueryMaker,java.util.List<QueryBean>> findQueriesReturningForm(Form form)
          Computes a list of queries returning the specified Form.
 java.lang.String generatePDF(Form form, boolean force)
          Generate pdf file for specified form.
 void generatePDFForSession(java.lang.String sessionId)
          Generate all the PDFs needed to send a session.
 java.util.List<java.lang.String> getAllWebHarvestScripts()
          Get all WebHarvest script name in server's WebHarvest directory.
 java.util.Map<java.lang.String,java.lang.String> getAssociatedFields(java.lang.String extensionName, java.lang.String templateName)
          Get association between template fields and extension fields.
 java.util.List<java.lang.String> getDocumentFields(org.nuiton.wikitty.WikittyExtension extension, java.lang.String templateName)
          Get template document fields names.
 int[] getFormsFromWebHarvestStream(WebHarvestStream webHarvestStream)
          Creates and store forms from an WebHarvestXmlStream by using the XmlStreamBinding to link xml stream field values with form fields.
 int[] getFormsFromXmlStream(XmlStream xmlStream)
          Creates and store forms from an XmlStream by using the XmlStreamBinding to link xml stream field values with form fields.
 org.nuiton.wikitty.WikittyExtension getFormType(java.lang.String name)
          Returns a form type with the specified name.
 java.util.Map<java.lang.String,org.nuiton.wikitty.FieldType> getFormTypeFields(java.lang.String name)
          Finds fields of a form type.
 java.util.List<Group> getGroupsForUser(java.lang.String userId)
          Get all the groups a user is in.
 Session getLastCloseSession()
          Get last closed session
 Session getLastOpenSession()
          Get last opened session
 java.util.Map<Group,java.util.List<QueryBean>> getQueriesToModifyAfterThesaurusModification(java.lang.String rootThesaurusName, java.lang.String thesaurusName)
          Gets the query makers whose queries are potentially to modify after a thesaurus node modification
 java.util.List<Session> getSessions(java.util.Date sessionDate)
          Get all session by date
 Status getStatus(VradiConstants.FormStatus formStatus)
          Get the status passed in parameter.
 java.util.Collection<java.lang.String> getTemplateFilenames(org.nuiton.wikitty.WikittyExtension extension)
          Lists the template filename (simple name) associated with the specified extension.
 java.lang.String getWebHarvestPreviewURL(WebHarvestStream stream)
          Get web harvest preview url from script
 java.lang.String[] getXmlStreamConfig()
           
 void importAsCSV(java.lang.String uri)
          Import all data as CSV.
 VradiUser loginUser(java.lang.String login, java.lang.String md5Password)
          Checks if userName and userPassword matches a valid VradiUser.
 java.util.List<Thesaurus> proposeThesaurus(Form form)
          Propose thesaurus nodes that might be in relation with a specified form
 void receiveMessages()
           
 void reindexData()
          Reindex the datas.
 java.util.List<Sending> removeAllSending(Session session, Form form, QueryMaker queryMaker)
          Remove all sending corresponding with form and query maker from session
 Sending sendMessage(java.lang.String sendingId, java.lang.String sessionParagraph)
           
 Sending sendMessage(java.lang.String sendingId, java.lang.String sessionParagraph, java.lang.String email)
           
 Session sendMessages(java.lang.String sessionId)
           
 void setAssociatedFields(java.lang.String extensionName, java.lang.String templateName, java.util.Map<java.lang.String,java.lang.String> fieldMap)
          Save association between template fields and extensions fields.
 Session stopSentMail(Session session)
           
 

Method Detail

createDefaultStatuses

java.util.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

java.util.Map<java.lang.String,org.nuiton.wikitty.FieldType> getFormTypeFields(java.lang.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(java.lang.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

createSending

java.util.List<Sending> createSending(Session session,
                                      QueryMaker queryMaker,
                                      java.util.List<Form> formsToBind)
                                      throws VradiException
Create new Sending

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

createNewSession

Session createNewSession()
                         throws VradiException
Throws:
VradiException

getSessions

java.util.List<Session> getSessions(java.util.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

getFormsFromWebHarvestStream

int[] getFormsFromWebHarvestStream(WebHarvestStream webHarvestStream)
                                   throws VradiException
Creates and store forms from an WebHarvestXmlStream by using the XmlStreamBinding to link xml stream field values with form fields.

Parameters:
webHarvestStream - the web harvest xml stream to execute
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

getFormsFromXmlStream

int[] getFormsFromXmlStream(XmlStream xmlStream)
                            throws VradiException
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
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

findQueriesReturningForm

java.util.Map<QueryMaker,java.util.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(java.lang.String login,
                    java.lang.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(java.lang.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

java.lang.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

java.util.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

autoLoadFormsFromXmlStreams

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

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

getTemplateFilenames

java.util.Collection<java.lang.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(java.lang.String extensionName,
                         java.lang.String templateName,
                         java.util.Map<java.lang.String,java.lang.String> fieldMap)
                         throws VradiException
Save association between template fields and extensions fields.

Parameters:
extensionName -
templateName -
fieldMap -
Throws:
VradiException

getAssociatedFields

java.util.Map<java.lang.String,java.lang.String> getAssociatedFields(java.lang.String extensionName,
                                                                     java.lang.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

java.lang.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

java.util.Map<Group,java.util.List<QueryBean>> getQueriesToModifyAfterThesaurusModification(java.lang.String rootThesaurusName,
                                                                                            java.lang.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

java.util.List<Sending> removeAllSending(Session session,
                                         Form form,
                                         QueryMaker queryMaker)
                                         throws VradiException
Remove all sending corresponding with form and query maker from session

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

getWebHarvestPreviewURL

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

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

getDocumentFields

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

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

sendMessages

Session sendMessages(java.lang.String sessionId)
                     throws VradiException
Throws:
VradiException

sendMessage

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

sendMessage

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

receiveMessages

void receiveMessages()
                     throws VradiException
Throws:
VradiException

stopSentMail

Session stopSentMail(Session session)
                     throws VradiException
Throws:
VradiException

getXmlStreamConfig

java.lang.String[] getXmlStreamConfig()

getAllWebHarvestScripts

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

Returns:
script file names

generatePDFForSession

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

Parameters:
sessionId - the session wikitty id

getGroupsForUser

java.util.List<Group> getGroupsForUser(java.lang.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

java.lang.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


Copyright © 2009-2010 JurisMarches. All Rights Reserved.