fr.paris.lutece.plugins.workflow.modules.editrecord.service
Class EditRecordService

java.lang.Object
  extended by fr.paris.lutece.plugins.workflow.modules.editrecord.service.EditRecordService
All Implemented Interfaces:
IEditRecordService

public class EditRecordService
extends java.lang.Object
implements IEditRecordService

EditRecordService


Field Summary
static java.lang.String BEAN_SERVICE
           
 
Constructor Summary
EditRecordService()
           
 
Method Summary
 void create(EditRecord editRecord)
          Create an edit record
 void doChangeRecordState(EditRecord editRecord, java.util.Locale locale)
          Do change the record state
 void doCompleteEditRecord(EditRecord editRecord)
          Do change the edit record to complete
 boolean doEditRecordData(javax.servlet.http.HttpServletRequest request, EditRecord editRecord)
          Do edit the record data
 EditRecord find(int nIdHistory, int nIdTask)
          Find an edit record
 java.util.List<EditRecord> findByIdTask(int nIdTask)
          Find edit records by a given id task
 fr.paris.lutece.plugins.directory.business.IEntry getEntry(int nIdEntry)
          Get the entry from a given id entry
 fr.paris.lutece.plugins.directory.business.EntryType getEntryTypeDownloadUrl()
          Get the entry type download url
 java.util.List<fr.paris.lutece.plugins.directory.business.IEntry> getFormListEntries(int nIdRecord, int nIdTask, javax.servlet.http.HttpServletRequest request)
          Get the list of entries for the form
 java.util.List<fr.paris.lutece.plugins.directory.business.IEntry> getInformationListEntries(int nIdHistory)
          Get the list of entries for information
 java.util.List<fr.paris.lutece.plugins.directory.business.IEntry> getListEntriesToEdit(javax.servlet.http.HttpServletRequest request, java.util.List<EditRecordValue> listEditRecordValues)
          Get the list of entries to edit
 java.util.List<java.lang.Integer> getListIdEntriesToNotEdit(javax.servlet.http.HttpServletRequest request, int nIdRecord, java.util.List<EditRecordValue> listEditRecordValues)
          Get the list of entries to not edit
 java.util.List<fr.paris.lutece.plugins.directory.business.RecordField> getListRecordFieldsToNotEdit(javax.servlet.http.HttpServletRequest request, int nIdRecord, java.util.List<EditRecordValue> listEditRecordValues)
          Get the list of record fieds to not edit
 fr.paris.lutece.util.ReferenceList getListStates(int nIdAction)
          Get the list of states
 java.util.Map<java.lang.String,java.util.List<fr.paris.lutece.plugins.directory.business.RecordField>> getMapIdEntryListRecordField(java.util.List<fr.paris.lutece.plugins.directory.business.IEntry> listEntries, int nIdHistory)
          Get the map id entry - list record fields
 fr.paris.lutece.plugins.directory.business.RecordField getRecordFieldDownloadUrl(int nIdHistory, int nIdEntry)
          Get the record field associated to the entry type download url.
 java.util.List<fr.paris.lutece.plugins.directory.business.RecordField> getRecordFieldsList(int nIdHistory, int nIdEntry)
          Get the list of record fields from a given id history and id entry
 fr.paris.lutece.plugins.directory.business.Record getRecordFromIdHistory(int nIdHistory)
          Get the record from a given id history
 boolean isRecordStateValid(EditRecord editRecord, java.util.Locale locale)
          Check if the record has the same state before executing the action
 boolean isRequestAuthenticated(javax.servlet.http.HttpServletRequest request)
          Check if the request is authenticated or not
 void removeByIdHistory(int nIdHistory, int nIdTask)
          Remove an edit record
 void removeByIdTask(int nIdTask)
          Remove an edit record by id task
 void setSiteMessage(javax.servlet.http.HttpServletRequest request, java.lang.String strMessage, int nTypeMessage, java.lang.String strUrlReturn)
          Set the site message
 void update(EditRecord editRecord)
          Update an edit record
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEAN_SERVICE

public static final java.lang.String BEAN_SERVICE
See Also:
Constant Field Values
Constructor Detail

EditRecordService

public EditRecordService()
Method Detail

setSiteMessage

public void setSiteMessage(javax.servlet.http.HttpServletRequest request,
                           java.lang.String strMessage,
                           int nTypeMessage,
                           java.lang.String strUrlReturn)
                    throws fr.paris.lutece.portal.service.message.SiteMessageException
Set the site message

Specified by:
setSiteMessage in interface IEditRecordService
Parameters:
request - the HTTP request
strMessage - the message
nTypeMessage - the message type
strUrlReturn - the url return
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - the site message

create

@Transactional(value="workflow-editrecord.transactionManager")
public void create(EditRecord editRecord)
Create an edit record

Specified by:
create in interface IEditRecordService
Parameters:
editRecord - the edit record

update

@Transactional(value="workflow-editrecord.transactionManager")
public void update(EditRecord editRecord)
Update an edit record

Specified by:
update in interface IEditRecordService
Parameters:
editRecord - the edit record

find

public EditRecord find(int nIdHistory,
                       int nIdTask)
Find an edit record

Specified by:
find in interface IEditRecordService
Parameters:
nIdHistory - the id history
nIdTask - the id task
Returns:
a edit record

findByIdTask

public java.util.List<EditRecord> findByIdTask(int nIdTask)
Find edit records by a given id task

Specified by:
findByIdTask in interface IEditRecordService
Parameters:
nIdTask - the id task
Returns:
the list of edit records

removeByIdHistory

@Transactional(value="workflow-editrecord.transactionManager")
public void removeByIdHistory(int nIdHistory,
                                            int nIdTask)
Remove an edit record

Specified by:
removeByIdHistory in interface IEditRecordService
Parameters:
nIdHistory - the id history
nIdTask - the id task

removeByIdTask

@Transactional(value="workflow-editrecord.transactionManager")
public void removeByIdTask(int nIdTask)
Remove an edit record by id task

Specified by:
removeByIdTask in interface IEditRecordService
Parameters:
nIdTask - the id task

getListStates

public fr.paris.lutece.util.ReferenceList getListStates(int nIdAction)
Get the list of states

Specified by:
getListStates in interface IEditRecordService
Parameters:
nIdAction - the id action
Returns:
a ReferenceList

getFormListEntries

public java.util.List<fr.paris.lutece.plugins.directory.business.IEntry> getFormListEntries(int nIdRecord,
                                                                                            int nIdTask,
                                                                                            javax.servlet.http.HttpServletRequest request)
Get the list of entries for the form

Specified by:
getFormListEntries in interface IEditRecordService
Parameters:
nIdRecord - the id record
nIdTask - the id task
request - the HTTP request
Returns:
a list of entries

getInformationListEntries

public java.util.List<fr.paris.lutece.plugins.directory.business.IEntry> getInformationListEntries(int nIdHistory)
Get the list of entries for information

Specified by:
getInformationListEntries in interface IEditRecordService
Parameters:
nIdHistory - the id edit record
Returns:
a list of entries

getListEntriesToEdit

public java.util.List<fr.paris.lutece.plugins.directory.business.IEntry> getListEntriesToEdit(javax.servlet.http.HttpServletRequest request,
                                                                                              java.util.List<EditRecordValue> listEditRecordValues)
Get the list of entries to edit

Specified by:
getListEntriesToEdit in interface IEditRecordService
Parameters:
request - the HTTP request
listEditRecordValues - the list of edit record values
Returns:
a list of entries

getListIdEntriesToNotEdit

public java.util.List<java.lang.Integer> getListIdEntriesToNotEdit(javax.servlet.http.HttpServletRequest request,
                                                                   int nIdRecord,
                                                                   java.util.List<EditRecordValue> listEditRecordValues)
Get the list of entries to not edit

Specified by:
getListIdEntriesToNotEdit in interface IEditRecordService
Parameters:
request - the HTTP request
nIdRecord - the id record
listEditRecordValues - the list of edit record values
Returns:
a list of entries

getListRecordFieldsToNotEdit

public java.util.List<fr.paris.lutece.plugins.directory.business.RecordField> getListRecordFieldsToNotEdit(javax.servlet.http.HttpServletRequest request,
                                                                                                           int nIdRecord,
                                                                                                           java.util.List<EditRecordValue> listEditRecordValues)
Get the list of record fieds to not edit

Specified by:
getListRecordFieldsToNotEdit in interface IEditRecordService
Parameters:
request - the HTTP request
nIdRecord - the id record
listEditRecordValues - the list of edit record values
Returns:
a list of record fields

getMapIdEntryListRecordField

public java.util.Map<java.lang.String,java.util.List<fr.paris.lutece.plugins.directory.business.RecordField>> getMapIdEntryListRecordField(java.util.List<fr.paris.lutece.plugins.directory.business.IEntry> listEntries,
                                                                                                                                           int nIdHistory)
Get the map id entry - list record fields

Specified by:
getMapIdEntryListRecordField in interface IEditRecordService
Parameters:
listEntries - the list of entries to edit
nIdHistory - the id history
Returns:
a map of id entry - list record fields

getEntry

public fr.paris.lutece.plugins.directory.business.IEntry getEntry(int nIdEntry)
Get the entry from a given id entry

Specified by:
getEntry in interface IEditRecordService
Parameters:
nIdEntry - the id entry
Returns:
an IEntry

getEntryTypeDownloadUrl

public fr.paris.lutece.plugins.directory.business.EntryType getEntryTypeDownloadUrl()
Get the entry type download url

Specified by:
getEntryTypeDownloadUrl in interface IEditRecordService
Returns:
the entry type downlaod url

getRecordFromIdHistory

public fr.paris.lutece.plugins.directory.business.Record getRecordFromIdHistory(int nIdHistory)
Get the record from a given id history

Specified by:
getRecordFromIdHistory in interface IEditRecordService
Parameters:
nIdHistory - the id history
Returns:
the record

getRecordFieldsList

public java.util.List<fr.paris.lutece.plugins.directory.business.RecordField> getRecordFieldsList(int nIdHistory,
                                                                                                  int nIdEntry)
Get the list of record fields from a given id history and id entry

Specified by:
getRecordFieldsList in interface IEditRecordService
Parameters:
nIdHistory - the id history
nIdEntry - the id entry
Returns:
the list of record fields

getRecordFieldDownloadUrl

public fr.paris.lutece.plugins.directory.business.RecordField getRecordFieldDownloadUrl(int nIdHistory,
                                                                                        int nIdEntry)
Get the record field associated to the entry type download url.
There is currently only on record field per record for the entry type download url. So, this method will only fetch the first record field.

Specified by:
getRecordFieldDownloadUrl in interface IEditRecordService
Parameters:
nIdHistory - the id history
nIdEntry - the id entry
Returns:
the record field

doEditRecordData

public boolean doEditRecordData(javax.servlet.http.HttpServletRequest request,
                                EditRecord editRecord)
                         throws fr.paris.lutece.portal.service.message.SiteMessageException
Do edit the record data

Specified by:
doEditRecordData in interface IEditRecordService
Parameters:
request - the HTTP request
editRecord - the edit record
Returns:
true if the user the record must be updated, false otherwise
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - site message if there is a problem

doChangeRecordState

public void doChangeRecordState(EditRecord editRecord,
                                java.util.Locale locale)
Do change the record state

Specified by:
doChangeRecordState in interface IEditRecordService
Parameters:
editRecord - edit record
locale - the locale

doCompleteEditRecord

public void doCompleteEditRecord(EditRecord editRecord)
Do change the edit record to complete

Specified by:
doCompleteEditRecord in interface IEditRecordService
Parameters:
editRecord - the edit record

isRequestAuthenticated

public boolean isRequestAuthenticated(javax.servlet.http.HttpServletRequest request)
Check if the request is authenticated or not

Specified by:
isRequestAuthenticated in interface IEditRecordService
Parameters:
request - the HTTP request
Returns:
true if the requet is authenticated, false otherwise

isRecordStateValid

public boolean isRecordStateValid(EditRecord editRecord,
                                  java.util.Locale locale)
Check if the record has the same state before executing the action

Specified by:
isRecordStateValid in interface IEditRecordService
Parameters:
editRecord - the edit record
locale - the locale
Returns:
true if the record has a valid state, false otherwise


Copyright © 2012 Mairie de Paris. All Rights Reserved.