Class NewsResource
java.lang.Object
org.silverpeas.core.web.rs.RESTWebService
org.silverpeas.components.quickinfo.web.NewsResource
- All Implemented Interfaces:
org.silverpeas.core.web.rs.ProtectedWebResource,org.silverpeas.core.web.rs.WebAuthenticationValidation,org.silverpeas.core.web.rs.WebAuthorizationValidation,org.silverpeas.core.web.SilverpeasWebResource
@WebService
@Path("news/{componentId}")
@Authorized
public class NewsResource
extends org.silverpeas.core.web.rs.RESTWebService
-
Nested Class Summary
Nested classes/interfaces inherited from class org.silverpeas.core.web.rs.RESTWebService
org.silverpeas.core.web.rs.RESTWebService.WebProcess<R>, org.silverpeas.core.web.rs.RESTWebService.WebTreatment<R> -
Field Summary
FieldsFields inherited from class org.silverpeas.core.web.rs.RESTWebService
RESPONSE_HEADER_ARRAYSIZEFields inherited from interface org.silverpeas.core.web.SilverpeasWebResource
BASE_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(String onNewsId) Acknowledges the specified news has been read by the user behind the request.jakarta.ws.rs.core.ResponsedeleteNews(String onNewsId) Deletes the specified news.Gets all the news published in the application.Gets the specified existing news.protected StringMethods inherited from class org.silverpeas.core.web.rs.RESTWebService
createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getLanguage, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, processMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.silverpeas.core.web.rs.ProtectedWebResource
validateUserAuthorizationMethods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation
validateUserAuthentication
-
Field Details
-
componentId
-
-
Constructor Details
-
NewsResource
public NewsResource()
-
-
Method Details
-
getComponentId
-
getAllNews
Gets all the news published in the application. A contributor gets them all whereas a reader gets only those that are currently visible.- Returns:
- a list with the news the user can see.
-
getNews
@NotFound @GET @Path("{newsId}") @Produces("application/json") public NewsEntity getNews(@PathParam("newsId") String onNewsId) Gets the specified existing news.- Parameters:
onNewsId- the unique identifier of the news.- Returns:
- the asked news.
-
acknowledge
Acknowledges the specified news has been read by the user behind the request.- Parameters:
onNewsId- the unique identifier of the news.
-
deleteNews
@DELETE @Path("{newsId}") public jakarta.ws.rs.core.Response deleteNews(@PathParam("newsId") String onNewsId) Deletes the specified news. Only a contributor can delete a news.- Parameters:
onNewsId- the unique identifier of the news.- Returns:
- the response to the HTTP DELETE request.
-
getResourceBasePath
- Specified by:
getResourceBasePathin classorg.silverpeas.core.web.rs.RESTWebService
-