com.jurismarches.vradi.services
Class VradiDataServiceImpl

java.lang.Object
  extended by com.jurismarches.vradi.services.VradiDataServiceImpl
All Implemented Interfaces:
VradiDataService

public class VradiDataServiceImpl
extends java.lang.Object
implements VradiDataService

Vradi data service implementation (on a local wikiity proxy).

Version:
$Revision: 1274 $ Last update : $Date: 2010-09-06 14:48:32 +0200 (lun., 06 sept. 2010) $ By : $Author: jcouteau $
Author:
chatellier

Field Summary
protected  FormManager formManager
           
protected  SearchManager searchManager
           
protected  ThesaurusManager thesaurusManager
           
protected  org.nuiton.wikitty.WikittyProxy wikittyProxy
          Wikiity proxy.
 
Constructor Summary
VradiDataServiceImpl(org.nuiton.wikitty.WikittyProxy wikittyProxy)
          Constructor with a wikitty proxy.
 
Method Summary
protected  org.nuiton.wikitty.WikittyExtension computeExtension(org.nuiton.wikitty.WikittyExtension extension)
          Compute the specified extension and return a new one with ordered fields.
 java.util.List<Status> createDefaultStatuses()
          Create all default status.
protected
<T extends org.nuiton.wikitty.BusinessEntity>
java.util.List<T>
findAllByExtension(java.lang.Class<T> type, java.lang.String extension, java.lang.String... sortFields)
          Do a find all by applying a criteria to WikittyProxy.
 java.util.List<Client> findAllClients()
          Find all clients.
 java.util.List<Group> findAllGroups()
          Find all groups.
 java.util.List<Thesaurus> findAllThesaurus()
          Find all thesaurus.
 java.util.List<User> findAllUsers()
          Find all users.
 java.util.List<WebHarvestStream> findAllWebHarvest()
          Find all webHarvest stream.
 java.util.List<XmlStream> findAllXmlStreams()
          Find all xml streams.
 java.util.List<User> findClientUsers(java.lang.String clientId)
          Find all users for a client.
 FormPagedResult findForms(java.lang.String query, org.nuiton.wikitty.WikittyExtension extension, java.lang.String dateType, java.util.Date beginDate, java.util.Date endDate, java.lang.String streamId, java.util.List<java.lang.String> thesaurus, java.lang.String[] statusIds, FormPagedResult formPagedResult)
          Searches for forms with the specified filters.
 java.util.List<org.nuiton.wikitty.WikittyExtension> getAllFormTypes()
          Retrieves all the form types
 java.util.List<Thesaurus> getChildrenThesaurus(java.lang.String thesaurusId)
          Returns all children of the specified thesaurusId.
 org.nuiton.wikitty.WikittyExtension getFormType(java.lang.String name)
          Retrieves the form type whose name is the parameter 'name'
 int getNbFormsForThesaurus(java.lang.String thesaurusId)
          Computes the number of forms associated with the specified thesaurusId.
 java.util.List<RootThesaurus> getRootThesaurus()
          Return root thesaurus nodes.
 ThesaurusCartography getThesaurusCartography(java.lang.String query, org.nuiton.wikitty.WikittyExtension extension, java.lang.String dateType, java.util.Date beginDate, java.util.Date endDate, java.lang.String streamId, java.util.List<java.lang.String> thesaurus, java.lang.String[] statusIds)
          Computes the number of forms associated with every thesaurus node.
protected  void initManagers()
          Init managers.
 org.nuiton.wikitty.WikittyExtension updateFormType(java.lang.String name, java.util.Map<java.lang.String,org.nuiton.wikitty.FieldType> fields, java.lang.String requires, java.util.Map<java.lang.String,java.lang.String> tagValues)
          Updates the form type whose name is 'name'.
 org.nuiton.wikitty.WikittyExtension updateFormType(org.nuiton.wikitty.WikittyExtension extension)
          Update the form type given in parameter
 java.util.List<XmlFieldBinding> updateXmlFieldBindings(java.util.List<XmlFieldBinding> bindings)
          Updates the xml field bindings given in parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wikittyProxy

protected org.nuiton.wikitty.WikittyProxy wikittyProxy
Wikiity proxy.


thesaurusManager

protected ThesaurusManager thesaurusManager

searchManager

protected SearchManager searchManager

formManager

protected FormManager formManager
Constructor Detail

VradiDataServiceImpl

public VradiDataServiceImpl(org.nuiton.wikitty.WikittyProxy wikittyProxy)
Constructor with a wikitty proxy. Make sure that wikitty proxy doesn't access remote service.

Parameters:
wikittyProxy - wikitty proxy
Method Detail

initManagers

protected void initManagers()
Init managers.


findAllByExtension

protected <T extends org.nuiton.wikitty.BusinessEntity> java.util.List<T> findAllByExtension(java.lang.Class<T> type,
                                                                                             java.lang.String extension,
                                                                                             java.lang.String... sortFields)
Do a find all by applying a criteria to WikittyProxy. Example : List client = VradiServiceHelper.findAllByExtension(Client.class, Client.EXT_CLIENT)

Type Parameters:
T - type of result
Parameters:
type - type to search
extension - extension to search
sortFields - sort fields (ascending to sort on)
Returns:
all of entities with extension

findAllClients

public java.util.List<Client> findAllClients()
Find all clients.

Specified by:
findAllClients in interface VradiDataService
Returns:
all clients

findAllUsers

public java.util.List<User> findAllUsers()
Find all users.

Specified by:
findAllUsers in interface VradiDataService
Returns:
all users

findAllGroups

public java.util.List<Group> findAllGroups()
Find all groups.

Specified by:
findAllGroups in interface VradiDataService
Returns:
all groups

createDefaultStatuses

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

Specified by:
createDefaultStatuses in interface VradiDataService
Returns:
all status created
Throws:
VradiException

findAllWebHarvest

public java.util.List<WebHarvestStream> findAllWebHarvest()
Find all webHarvest stream.

Specified by:
findAllWebHarvest in interface VradiDataService
Returns:
all stream webHarvest

findAllXmlStreams

public java.util.List<XmlStream> findAllXmlStreams()
Find all xml streams.

Specified by:
findAllXmlStreams in interface VradiDataService
Returns:
all xml streams

findAllThesaurus

public java.util.List<Thesaurus> findAllThesaurus()
Find all thesaurus.

Specified by:
findAllThesaurus in interface VradiDataService
Returns:
all xml streams

findClientUsers

public java.util.List<User> findClientUsers(java.lang.String clientId)
Find all users for a client.

Specified by:
findClientUsers in interface VradiDataService
Parameters:
clientId - client wikitty id
Returns:
all users for client

getFormType

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

Specified by:
getFormType in interface VradiDataService
Parameters:
name - the name of the form type we want to retrieve
Returns:
the form type whose name is the parameter
Throws:
VradiException

updateFormType

public org.nuiton.wikitty.WikittyExtension updateFormType(java.lang.String name,
                                                          java.util.Map<java.lang.String,org.nuiton.wikitty.FieldType> fields,
                                                          java.lang.String requires,
                                                          java.util.Map<java.lang.String,java.lang.String> tagValues)
                                                   throws VradiException
Updates the form type whose name is 'name'.

Specified by:
updateFormType in interface VradiDataService
Parameters:
name - the name of the form type to update
fields - the new fields of the form type
requires - the new requires of the form type
tagValues - the new tag values of the form type
Returns:
the form type up to date
Throws:
VradiException

updateFormType

public org.nuiton.wikitty.WikittyExtension updateFormType(org.nuiton.wikitty.WikittyExtension extension)
                                                   throws VradiException
Update the form type given in parameter

Specified by:
updateFormType in interface VradiDataService
Parameters:
extension - the form type to update
Returns:
the form type up to date
Throws:
VradiException

findForms

public FormPagedResult findForms(java.lang.String query,
                                 org.nuiton.wikitty.WikittyExtension extension,
                                 java.lang.String dateType,
                                 java.util.Date beginDate,
                                 java.util.Date endDate,
                                 java.lang.String streamId,
                                 java.util.List<java.lang.String> thesaurus,
                                 java.lang.String[] statusIds,
                                 FormPagedResult formPagedResult)
                          throws UnsupportedQueryException,
                                 VradiException
Description copied from interface: VradiDataService
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:
findForms in interface VradiDataService
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
streamId - id of stream
thesaurus - the thesaurus filter
statusIds - the ids of the status filters
formPagedResult - ...
Returns:
FormPagedResult
Throws:
UnsupportedQueryException
VradiException

getThesaurusCartography

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

Specified by:
getThesaurusCartography in interface VradiDataService
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
streamId - id of stream
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

updateXmlFieldBindings

public java.util.List<XmlFieldBinding> updateXmlFieldBindings(java.util.List<XmlFieldBinding> bindings)
                                                       throws VradiException
Updates the xml field bindings given in parameters.

Specified by:
updateXmlFieldBindings in interface VradiDataService
Parameters:
bindings - the list of the xml field bindings to update
Returns:
the list of the xml field bindings up to date
Throws:
VradiException

getAllFormTypes

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

Specified by:
getAllFormTypes in interface VradiDataService
Returns:
a list containing all the form types
Throws:
VradiException

computeExtension

protected org.nuiton.wikitty.WikittyExtension computeExtension(org.nuiton.wikitty.WikittyExtension extension)
Compute the specified extension and return a new one with ordered fields. Fields order is specified by their tag values.


getRootThesaurus

public java.util.List<RootThesaurus> getRootThesaurus()
                                               throws VradiException
Description copied from interface: VradiDataService
Return root thesaurus nodes. Since 0.1.0, root thesaurus are not created anymore.

Specified by:
getRootThesaurus in interface VradiDataService
Returns:
a RootThesaurus
Throws:
VradiException

getNbFormsForThesaurus

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

Specified by:
getNbFormsForThesaurus in interface VradiDataService
Parameters:
thesaurusId - thesaurus id
Returns:
the number of forms associated
Throws:
VradiException

getChildrenThesaurus

public java.util.List<Thesaurus> getChildrenThesaurus(java.lang.String thesaurusId)
                                               throws VradiException
Description copied from interface: VradiDataService
Returns all children of the specified thesaurusId.

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


Copyright © 2009-2010 JurisMarches. All Rights Reserved.