com.jurismarches.vradi.services
Interface VradiDataService

All Known Implementing Classes:
VradiDataServiceImpl

public interface VradiDataService

This service contains business code to do on data before calling WikittyProxy. It's intended to be used on a local WikittyProxy.

Version:
$Revision: 1767 $ Last update : $Date: 2010-11-12 13:05:53 +0100 (ven., 12 nov. 2010) $ By : $Author: sletellier $
Author:
chatellier

Method Summary
 boolean checkUserEmail(Sending sending)
          Check if user have email non empyt
 List<Status> createDefaultStatuses()
          Create all default status.
 org.nuiton.wikitty.WikittyExtension createFormType(String formTypeName)
          Create new form type.
 RootThesaurus createRootThesaurus(String rootThesaurusName)
          Create new thesaurus.
 void deleteAllThesaurus()
          Delete all thesauruses recursively.
 void deleteClient(String clientId)
          Delete client, users associated and user groups association
 void deleteGroup(String groupId)
          Delete group
 boolean deleteStatus(List<String> statusIds)
          Delete status if no form is use this
 List<String> deleteThesaurus(String thesaurusId)
          Delete all thesaurus and sub thesaurus.
 void deleteUser(String userId)
          Delete users, and groups association
 void deleteXmlStream(String id)
          Delete group
 List<Client> findAllClients()
          Find all clients ordered by client name.
 List<Group> findAllGroups()
          Find all groups ordered by group name.
 List<Status> findAllStatus()
          Find all status ordered by status name.
 List<User> findAllUsers()
          Find all users ordered by user name.
 List<WebHarvestStream> findAllWebHarvest()
          Find all webHarvest stream ordered by stream name.
 List<XmlStream> findAllXmlStreams()
          Find all xml streams ordered by stream name.
 List<User> findClientUsers(String clientId)
          Find all users for a client ordered by user name.
 FormPagedResult findForms(QueryParameters queryParameters, FormPagedResult formPagedResult)
          Searches for forms with the specified filters.
 Map<Group,List<QueryBean>> findQueriesReturningForm(List<Group> groups, String formId)
          Computes a list of queries returning the specified Form and groups.
 Map<Group,List<QueryBean>> findQueriesReturningForm(String formId)
          Computes a list of queries returning the specified Form.
 List<Group> findUserGroups(String userId)
          Find user group.
 List<org.nuiton.wikitty.WikittyExtension> getAllFormTypes()
          Retrieves all the form types
 List<String> getAllWebHarvestScripts()
          Get all WebHarvest script name in server's WebHarvest directory.
 Map<Thesaurus,Integer> getChildrenCartography(String thesaurusId, QueryParameters queryParameters)
          Computes the number of forms associated with every thesaurus node.
 List<Thesaurus> getChildrenThesaurus(String thesaurusId)
          Returns all children of the specified thesaurusId sorted by name.
 org.nuiton.wikitty.WikittyExtension getFormType(String name)
          Retrieves the form type whose name is the parameter 'name'
 Map<String,org.nuiton.wikitty.FieldType> getFormTypeFields(String name)
          Finds fields of a form type.
 String getFormTypeTemplateName(org.nuiton.wikitty.WikittyExtension extension)
          Get form type template name
 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
 int getNbFormsForThesaurus(String thesaurusId)
          Computes the number of forms associated with the specified thesaurusId.
 Map<Group,List<QueryBean>> getQueriesToModifyAfterThesaurusModification(String rootThesaurusName, String thesaurusName)
          Gets the query makers whose queries are potentially to modify after a thesaurus node modification
 List<String> getRelatedFormsLinkIds(String formId)
          Get all related forms ids of form in param
 List<String> getReplaceFormsLinkIds(String formId)
          Get all replace forms ids of form in param
 List<RootThesaurus> getRootThesaurus()
          Return root thesaurus ids (ie thesaurus nodes without parent) sorted by root thesaurus name.
 Session getSessionBySending(String sendingId)
          Return session corresponding of sending id in param
 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.
 List<Thesaurus> getThesaurusAttachedToForm(Form form)
          Retourne l'ensemble des thesaurus qui sont attachés a un formulaire.
 String getWebHarvestPreviewURL(WebHarvestStream stream)
          Get web harvest preview url from script
 boolean isFormTypeExists(String formTypeName)
          Check if a form type name already exists.
 boolean isFormTypeInUse(org.nuiton.wikitty.WikittyExtension formType)
          Find if form type is used
 boolean isRootThesaurusNameExists(String rootThesaurusName)
          Return true if rootThesaurusName already exists.
 boolean isRootThesaurusNameExists(String rootThesaurusName, String exceptedRootThesaurusId)
          Return true if rootThesaurusName already exists.
 boolean isThesaurusNameExistsInRootThesaurus(RootThesaurus rootThesaurus, String thesaurusName)
          Return true if thesaurusName exists in rootThesaurus children.
 boolean isThesaurusNameExistsInRootThesaurus(RootThesaurus rootThesaurus, String thesaurusName, String exceptedThesaurusId)
          Check if name of thesaurus is existing in rootThesaurus.
 List<Thesaurus> proposeThesaurus(String formId)
          Propose thesaurus nodes that might be in relation with a specified form
 org.nuiton.wikitty.WikittyExtension updateFormType(String name, Map<String,org.nuiton.wikitty.FieldType> fields, String requires, Map<String,String> tagValues)
          Creates or Update a form type.
 org.nuiton.wikitty.WikittyExtension updateFormType(org.nuiton.wikitty.WikittyExtension extension)
          Creates or Update a form type.
 org.nuiton.wikitty.WikittyExtension updateFormType(org.nuiton.wikitty.WikittyExtension extension, String templateName)
          Creates or Update a form type.
 List<XmlFieldBinding> updateXmlFieldBindings(List<XmlFieldBinding> bindings)
          Update a list of XmlFieldBinding.
 

Method Detail

findAllClients

List<Client> findAllClients()
Find all clients ordered by client name.

Returns:
all clients

deleteClient

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

Parameters:
clientId - to delete
Throws:
VradiException

findAllUsers

List<User> findAllUsers()
Find all users ordered by user name.

Returns:
all users

findClientUsers

List<User> findClientUsers(String clientId)
Find all users for a client ordered by user name.

Parameters:
clientId - client wikitty id
Returns:
all users for client

deleteUser

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

Parameters:
userId - to delete
Throws:
VradiException

findUserGroups

List<Group> findUserGroups(String userId)
Find user group.

Parameters:
userId - user wikitty id
Returns:
all groups for user

findAllGroups

List<Group> findAllGroups()
Find all groups ordered by group name.

Returns:
all groups

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

deleteGroup

void deleteGroup(String groupId)
                 throws VradiException
Delete group

Parameters:
groupId - to delete
Throws:
VradiException

deleteXmlStream

void deleteXmlStream(String id)
                     throws VradiException
Delete group

Parameters:
groupId - to delete
Throws:
VradiException

findAllStatus

List<Status> findAllStatus()
Find all status ordered by status name.

Returns:
all status

createDefaultStatuses

List<Status> createDefaultStatuses()
                                   throws VradiException
Create all default status.

Returns:
all status
Throws:
VradiException

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

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

findAllWebHarvest

List<WebHarvestStream> findAllWebHarvest()
Find all webHarvest stream ordered by stream name.

Returns:
all stream webHarvest

findAllXmlStreams

List<XmlStream> findAllXmlStreams()
Find all xml streams ordered by stream name.

Returns:
all xml streams

getRootThesaurus

List<RootThesaurus> getRootThesaurus()
                                     throws VradiException
Return root thesaurus ids (ie thesaurus nodes without parent) sorted by root thesaurus name.

Returns:
a RootThesaurus collection
Throws:
VradiException

getFormType

org.nuiton.wikitty.WikittyExtension getFormType(String name)
                                                throws VradiException
Retrieves the form type whose name is the parameter 'name'

Parameters:
name - the name of the form type we want to retrieve
Returns:
the form type whose name is the parameter
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

updateFormType

org.nuiton.wikitty.WikittyExtension updateFormType(org.nuiton.wikitty.WikittyExtension extension)
                                                   throws VradiException
Creates or Update a form type.

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

updateFormType

org.nuiton.wikitty.WikittyExtension updateFormType(org.nuiton.wikitty.WikittyExtension extension,
                                                   String templateName)
                                                   throws VradiException
Creates or Update a form type.

Parameters:
extension - the extension designing the form type
template - name
Returns:
a WikittyExtension
Throws:
VradiException

updateFormType

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

Parameters:
name - the name of the form type
fields - the fields of the form type
requires - the extension required by the extension to update
tagValues - the map containing the tags and their values
Returns:
a WikittyExtension
Throws:
VradiException

getThesaurusAttachedToForm

List<Thesaurus> getThesaurusAttachedToForm(Form form)
                                           throws VradiException
Retourne l'ensemble des thesaurus qui sont attachés a un formulaire.

Parameters:
form - form dont on veut les thesaurus
Returns:
thesaurus attachés au formulaire
Throws:
VradiException

findForms

FormPagedResult findForms(QueryParameters queryParameters,
                          FormPagedResult formPagedResult)
                          throws VradiException,
                                 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:
queryParameters - query parameters
Returns:
FormPagedResult
Throws:
UnsupportedQueryException
VradiException

getChildrenCartography

Map<Thesaurus,Integer> getChildrenCartography(String thesaurusId,
                                              QueryParameters queryParameters)
                                              throws VradiException,
                                                     UnsupportedQueryException
Computes the number of forms associated with every thesaurus node.

Parameters:
thesaurusId - thesaurusId
queryParameters - query parameters
Returns:
a map with children thesaurus and associated form count
Throws:
VradiException
UnsupportedQueryException

findQueriesReturningForm

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

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

findQueriesReturningForm

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

Parameters:
formId - id of the form which match queries
groups - concerned
Returns:
a list of queries
Throws:
VradiException

updateXmlFieldBindings

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

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

getAllFormTypes

List<org.nuiton.wikitty.WikittyExtension> getAllFormTypes()
                                                          throws VradiException
Retrieves all the form types

Returns:
a list containing all the form types
Throws:
VradiException

getChildrenThesaurus

List<Thesaurus> getChildrenThesaurus(String thesaurusId)
                                     throws VradiException
Returns all children of the specified thesaurusId sorted by name.

Parameters:
thesaurusId - thesaurus wikitty id
Returns:
all list of TreeNodeImpl
Throws:
VradiException

getNbFormsForThesaurus

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

Parameters:
thesaurusId - thesaurus id
Returns:
the number of forms associated
Throws:
VradiException

createRootThesaurus

RootThesaurus createRootThesaurus(String rootThesaurusName)
                                  throws VradiException
Create new thesaurus.

Parameters:
rootThesaurusName - root thesaurus name (must contains only alphnum characters)
Returns:
new created thesaurus
Throws:
VradiException - if name is not valid

deleteThesaurus

List<String> deleteThesaurus(String thesaurusId)
                             throws VradiException
Delete all thesaurus and sub thesaurus.

Parameters:
thesaurusId - thesaurusId to delete
Throws:
VradiException

isFormTypeExists

boolean isFormTypeExists(String formTypeName)
                         throws VradiException
Check if a form type name already exists.

Parameters:
formTypeName - form type name
Returns:
new created wikitty extension
Throws:
VradiException - if name is not valid

createFormType

org.nuiton.wikitty.WikittyExtension createFormType(String formTypeName)
                                                   throws VradiException
Create new form type.

Parameters:
formTypeName - form type name
Returns:
new created wikitty extension
Throws:
VradiException - if name is not valid

getWebHarvestPreviewURL

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

Parameters:
stream -
Returns:
url of preview file
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

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

isThesaurusNameExistsInRootThesaurus

boolean isThesaurusNameExistsInRootThesaurus(RootThesaurus rootThesaurus,
                                             String thesaurusName)
Return true if thesaurusName exists in rootThesaurus children.

Parameters:
rootThesaurus - root thesaurus
thesaurusName - thesaurus name to test
Returns:
true if thesaurusName exists in rootThesaurus children

isThesaurusNameExistsInRootThesaurus

boolean isThesaurusNameExistsInRootThesaurus(RootThesaurus rootThesaurus,
                                             String thesaurusName,
                                             String exceptedThesaurusId)
Check if name of thesaurus is existing in rootThesaurus.

Parameters:
rootThesaurus - to check
thesaurusName - name to check
exceptedThesaurusId - in case of rename, exclude exceptedThesaurusId from check
Returns:
true if thesaurus already exist

isRootThesaurusNameExists

boolean isRootThesaurusNameExists(String rootThesaurusName)
Return true if rootThesaurusName already exists.

Parameters:
rootThesaurusName - rootThesaurus name to test
Returns:
true if rootThesaurusName already exists

isRootThesaurusNameExists

boolean isRootThesaurusNameExists(String rootThesaurusName,
                                  String exceptedRootThesaurusId)
Return true if rootThesaurusName already exists.

Parameters:
rootThesaurusName - rootThesaurus name to test
exceptedRootThesaurusId - in case of rename, exclude exceptedRootThesaurusId from check
Returns:
true if rootThesaurusName already exists

proposeThesaurus

List<Thesaurus> proposeThesaurus(String formId)
                                 throws VradiException
Propose thesaurus nodes that might be in relation with a specified form

Parameters:
formId - the Form id containing the information needed to search the thesaurus nodes
Returns:
a list of Thesaurus
Throws:
VradiException

checkUserEmail

boolean checkUserEmail(Sending sending)
Check if user have email non empyt

Parameters:
sending - to check
Returns:
false if no valid email found

getSessionBySending

Session getSessionBySending(String sendingId)
Return session corresponding of sending id in param

Parameters:
sendingId - corresponding to session to find
Returns:
session found

getSessions

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

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

getSessionOfSending

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

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

getLastCloseSession

Session getLastCloseSession()
                            throws VradiException
Get last closed session

Returns:
last opened session
Throws:
VradiException - if an error occur

getLastOpenSession

Session getLastOpenSession()
                           throws VradiException
Get last opened session

Returns:
last opened session
Throws:
VradiException - if an error occur

deleteAllThesaurus

void deleteAllThesaurus()
                        throws VradiException
Delete all thesauruses recursively.

Throws:
VradiException - if an error occur

getRelatedFormsLinkIds

List<String> getRelatedFormsLinkIds(String formId)
                                    throws VradiException
Get all related forms ids of form in param

Parameters:
formId - concerned
Returns:
related forms links ids
Throws:
VradiException - if an error occur

getReplaceFormsLinkIds

List<String> getReplaceFormsLinkIds(String formId)
                                    throws VradiException
Get all replace forms ids of form in param

Parameters:
formId - concerned
Returns:
replace forms links ids
Throws:
VradiException - if an error occur

isFormTypeInUse

boolean isFormTypeInUse(org.nuiton.wikitty.WikittyExtension formType)
Find if form type is used

Parameters:
formType - concerned
Returns:
if used

getFormTypeTemplateName

String getFormTypeTemplateName(org.nuiton.wikitty.WikittyExtension extension)
Get form type template name



Copyright © 2009-2010 JurisMarches. All Rights Reserved.