Class ClassifiedsSessionController
- java.lang.Object
-
- org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
-
- org.silverpeas.components.classifieds.control.ClassifiedsSessionController
-
- All Implemented Interfaces:
Serializable
,org.silverpeas.core.web.mvc.controller.ComponentSessionController
,org.silverpeas.core.web.session.SessionCloseable
public final class ClassifiedsSessionController extends org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClassifiedsSessionController(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl, org.silverpeas.core.web.mvc.controller.ComponentContext componentContext)
Standard Session Controller Constructeur
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkScope(ClassifiedDetail classified)
String
createClassified(ClassifiedDetail classified, Collection<org.apache.commons.fileupload.FileItem> listImage, ClassifiedsRole profile, boolean publish)
create classifiedvoid
createClassifiedImage(org.apache.commons.fileupload.FileItem fileImage, String classifiedId)
create classified imagevoid
createSubscribe(Subscribe subscribe)
create a subscriptionvoid
deleteClassified(String classifiedId)
delete the classified corresponding to classifiedIdvoid
deleteClassifiedImage(String imageId)
delete classified imagevoid
deleteSubscribe(String subscribeId)
delete the subscription corresponding to subscribeIdvoid
draftInClassified(String classifiedId)
pass the classified corresponding to classifiedId in draft modevoid
draftOutClassified(String classifiedId, ClassifiedsRole highestRole)
take out draft mode the classified corresponding to classifiedList<ClassifiedDetail>
getAllValidClassifieds()
get all valid classifiedsClassifiedDetail
getClassified(String classifiedId)
get classified corresponding to classifiedIdList<ClassifiedDetail>
getClassifieds(org.silverpeas.core.index.search.model.QueryDescription query, int nb)
List<ClassifiedDetail>
getClassifiedsByUser()
get all classifieds for the current user and this instanceCollection<ClassifiedDetail>
getClassifiedsToValidate()
get all classifieds to validate for this instanceClassifiedDetail
getClassifiedWithImages(String classifiedId)
get classified corresponding to classifiedId including imagesClassifiedDetail
getCurrentClassified()
int
getCurrentFirstItemIndex()
int
getCurrentScope()
org.silverpeas.core.web.util.ListIndex
getIndex()
ClassifiedsComponentSettings
getInstanceSettings()
int
getNbPerPage()
String
getNbTotalClassifieds()
get the number of classifieds for this instanceClassifiedDetail
getNext()
Collection<ClassifiedDetail>
getPage()
ClassifiedDetail
getPrevious()
org.silverpeas.core.contribution.template.publication.PublicationTemplate
getPublicationTemplate()
Gets the template of the publication based on the classified XML form.org.silverpeas.core.util.MultiSilverpeasBundle
getResources()
Gets the resources associated with this session controller.SearchContext
getSearchContext()
String
getSearchFields1()
get the name of search field1String
getSearchFields2()
get the name of search field2List<ClassifiedDetail>
getSessionClassifieds()
Collection<Subscribe>
getSubscribesByUser()
get all subscriptions for the current user and this instanceString
getXMLFormName()
get the name of xmlFormboolean
isCommentsEnabled()
return true if comments feature is enabledboolean
isDraftEnabled()
return true if draft mode is enabledboolean
isHomePageDisplayCategorized()
return true if Home page displays classifieds organized by categoryboolean
isValidationEnabled()
void
notifyOwner(String message)
void
refusedClassified(String classifiedId, String motive)
pass to status refused because the user corresponding to userId refused the classified corresponding to classifiedId for the motive ResusalMotivevoid
search(org.silverpeas.core.index.search.model.QueryDescription query)
search all classifieds corresponding to the queryvoid
setCurrentFirstItemIndex(String index)
void
setNbItemsPerPage(String nb)
void
setPagination(org.silverpeas.core.web.util.viewgenerator.html.pagination.Pagination pagination)
void
setSearchContext(SearchContext context)
void
updateClassified(ClassifiedDetail classified, boolean isUpdate, boolean isAdmin, boolean publish)
update the classified and send notification if isUpdate is true and, if isAdmin is true and classified is in status validvoid
updateClassifiedImage(org.apache.commons.fileupload.FileItem fileImage, String imageId, String classifiedId)
update classified imagevoid
validateClassified(String classifiedId)
pass to status validate because the user corresponding to userId validated the classified corresponding to classifiedId-
Methods inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
addClipboardSelection, clipboardPasteDone, close, getClipboardErrorMessage, getClipboardExceptionError, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getHighestSilverpeasUserRole, getIcon, getLanguage, getLook, getMultilang, getOrganisationController, getPersonalization, getRSSUrl, getSelection, getSettings, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserDetail, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoles, getZoneId, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardSelectedElement, setComponentRootName, setSpaceModeMaintenance
-
-
-
-
Constructor Detail
-
ClassifiedsSessionController
public ClassifiedsSessionController(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl, org.silverpeas.core.web.mvc.controller.ComponentContext componentContext)
Standard Session Controller Constructeur- Parameters:
mainSessionCtrl
- The user's profilecomponentContext
- The component's profile
-
-
Method Detail
-
getInstanceSettings
public ClassifiedsComponentSettings getInstanceSettings()
-
setPagination
public void setPagination(org.silverpeas.core.web.util.viewgenerator.html.pagination.Pagination pagination)
-
getResources
public org.silverpeas.core.util.MultiSilverpeasBundle getResources()
Gets the resources associated with this session controller.- Returns:
- all of the resources (messages, settings, icons, ...)
-
getClassified
public ClassifiedDetail getClassified(String classifiedId)
get classified corresponding to classifiedId- Parameters:
classifiedId
- : String- Returns:
- classified : ClassifiedDetail
-
getNbTotalClassifieds
public String getNbTotalClassifieds()
get the number of classifieds for this instance- Returns:
- number : String
-
search
public void search(org.silverpeas.core.index.search.model.QueryDescription query)
search all classifieds corresponding to the query- Parameters:
query
- : QueryDescription
-
getClassifieds
public List<ClassifiedDetail> getClassifieds(org.silverpeas.core.index.search.model.QueryDescription query, int nb)
-
getSessionClassifieds
public List<ClassifiedDetail> getSessionClassifieds()
-
getPage
public Collection<ClassifiedDetail> getPage()
-
getClassifiedsByUser
public List<ClassifiedDetail> getClassifiedsByUser()
get all classifieds for the current user and this instance- Returns:
- a collection of ClassifiedDetail
-
getClassifiedsToValidate
public Collection<ClassifiedDetail> getClassifiedsToValidate()
get all classifieds to validate for this instance- Returns:
- a collection of ClassifiedDetail
-
draftOutClassified
public void draftOutClassified(String classifiedId, ClassifiedsRole highestRole)
take out draft mode the classified corresponding to classified- Parameters:
classifiedId
- : StringhighestRole
- : ClassifiedsRole
-
draftInClassified
public void draftInClassified(String classifiedId)
pass the classified corresponding to classifiedId in draft mode- Parameters:
classifiedId
- : String
-
validateClassified
public void validateClassified(String classifiedId)
pass to status validate because the user corresponding to userId validated the classified corresponding to classifiedId- Parameters:
classifiedId
- : String
-
refusedClassified
public void refusedClassified(String classifiedId, String motive)
pass to status refused because the user corresponding to userId refused the classified corresponding to classifiedId for the motive ResusalMotive- Parameters:
classifiedId
- : Stringmotive
- : String
-
getXMLFormName
public String getXMLFormName()
get the name of xmlForm- Returns:
- name : String
-
getSearchFields1
public String getSearchFields1()
get the name of search field1- Returns:
- search field1 name : String
-
getSearchFields2
public String getSearchFields2()
get the name of search field2- Returns:
- search field2 name : String
-
createClassified
public String createClassified(ClassifiedDetail classified, Collection<org.apache.commons.fileupload.FileItem> listImage, ClassifiedsRole profile, boolean publish)
create classified- Parameters:
classified
- : classifiedDetailprofile
- : ClassifiedsRole- Returns:
- classifiedId : String
-
deleteClassified
public void deleteClassified(String classifiedId)
delete the classified corresponding to classifiedId- Parameters:
classifiedId
- : String
-
updateClassified
public void updateClassified(ClassifiedDetail classified, boolean isUpdate, boolean isAdmin, boolean publish)
update the classified and send notification if isUpdate is true and, if isAdmin is true and classified is in status valid- Parameters:
classified
- : ClassifiedDetailisUpdate
- : booleanisAdmin
- : boolean
-
createSubscribe
public void createSubscribe(Subscribe subscribe)
create a subscription- Parameters:
subscribe
- : Subscribe
-
deleteSubscribe
public void deleteSubscribe(String subscribeId)
delete the subscription corresponding to subscribeId- Parameters:
subscribeId
- : String
-
getSubscribesByUser
public Collection<Subscribe> getSubscribesByUser()
get all subscriptions for the current user and this instance- Returns:
- a collection of Subscribe
-
setCurrentFirstItemIndex
public void setCurrentFirstItemIndex(String index)
-
getCurrentFirstItemIndex
public int getCurrentFirstItemIndex()
-
isDraftEnabled
public boolean isDraftEnabled()
return true if draft mode is enabled- Returns:
- boolean
-
isValidationEnabled
public boolean isValidationEnabled()
-
isCommentsEnabled
public boolean isCommentsEnabled()
return true if comments feature is enabled- Returns:
- boolean
-
createClassifiedImage
public void createClassifiedImage(org.apache.commons.fileupload.FileItem fileImage, String classifiedId)
create classified image- Parameters:
fileImage
- : FileItemclassifiedId
- : String
-
getClassifiedWithImages
public ClassifiedDetail getClassifiedWithImages(String classifiedId)
get classified corresponding to classifiedId including images- Parameters:
classifiedId
- : String- Returns:
- classified : ClassifiedDetail
-
updateClassifiedImage
public void updateClassifiedImage(org.apache.commons.fileupload.FileItem fileImage, String imageId, String classifiedId)
update classified image- Parameters:
fileImage
- : FileItemimageId
- : StringclassifiedId
- : String
-
deleteClassifiedImage
public void deleteClassifiedImage(String imageId)
delete classified image- Parameters:
imageId
- : String
-
isHomePageDisplayCategorized
public boolean isHomePageDisplayCategorized()
return true if Home page displays classifieds organized by category- Returns:
- boolean
-
getAllValidClassifieds
public List<ClassifiedDetail> getAllValidClassifieds()
get all valid classifieds- Returns:
- a collection of ClassifiedDetail
-
getNbPerPage
public int getNbPerPage()
-
setNbItemsPerPage
public void setNbItemsPerPage(String nb)
-
getPublicationTemplate
public org.silverpeas.core.contribution.template.publication.PublicationTemplate getPublicationTemplate() throws org.silverpeas.core.contribution.template.publication.PublicationTemplateException
Gets the template of the publication based on the classified XML form.- Returns:
- the publication template for classifieds.
- Throws:
org.silverpeas.core.contribution.template.publication.PublicationTemplateException
- if an error occurs while getting the publication template.
-
setSearchContext
public void setSearchContext(SearchContext context)
-
getSearchContext
public SearchContext getSearchContext()
-
getIndex
public org.silverpeas.core.web.util.ListIndex getIndex()
-
getPrevious
public ClassifiedDetail getPrevious()
-
getNext
public ClassifiedDetail getNext()
-
getCurrentScope
public int getCurrentScope()
-
checkScope
public void checkScope(ClassifiedDetail classified)
-
getCurrentClassified
public ClassifiedDetail getCurrentClassified()
-
notifyOwner
public void notifyOwner(String message)
-
-