Class MyLinksWebManager
- java.lang.Object
-
- org.silverpeas.core.webapi.mylinks.MyLinksWebManager
-
@Service public class MyLinksWebManager extends Object
Permits to centralize WEB service processing betweenMyLinksResource
and the WAR controller.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MyLinksWebManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CategoryDetail
createCategory(CategoryEntity newCategory)
Creates a category into persistence.LinkDetail
createLink(MyLinkEntity newLink)
Creates a link into persistence.void
deleteCategories(String[] categoryIds)
Deletes categories into persistence.void
deleteLinks(String[] links)
Deletes links into persistence.static MyLinksWebManager
get()
List<CategoryDetail>
getAllCategoriesOfCurrentUser()
Gets all the categories of the current user.List<LinkDetail>
getAllLinksOfCurrentUser()
Gets all the links of the current user.List<LinkDetail>
getAllLinksOfInstance(String instanceId)
Gets all the links associated to given component instance identifier.List<LinkDetail>
getAllLinksOfResourceOnInstance(String resourceId, String instanceId)
Gets all the links associated to given resource identifier hosted into to given component instance identifier.CategoryDetail
getAuthorizedCategory(String categoryId)
Gets category details from its id by verifying user modification rights.LinkDetail
getAuthorizedLink(String linkId)
Gets link details from its id by verifying user modification rights.CategoryDetail
updateCategory(CategoryEntity updatedCategory)
Updates a category into persistence.LinkDetail
updateLink(MyLinkEntity updatedLink)
Updates a link into persistence
-
-
-
Method Detail
-
get
public static MyLinksWebManager get()
-
getAllCategoriesOfCurrentUser
public List<CategoryDetail> getAllCategoriesOfCurrentUser()
Gets all the categories of the current user.- Returns:
- List of category.
-
getAuthorizedCategory
public CategoryDetail getAuthorizedCategory(String categoryId)
Gets category details from its id by verifying user modification rights.- Parameters:
categoryId
- the identifier of a category.- Returns:
- a
CategoryDetail
instance or null if id is unknown.
-
createCategory
public CategoryDetail createCategory(CategoryEntity newCategory)
Creates a category into persistence.- Parameters:
newCategory
- data of a new category.- Returns:
- the persisted data.
-
updateCategory
public CategoryDetail updateCategory(CategoryEntity updatedCategory)
Updates a category into persistence.- Parameters:
updatedCategory
- data of a updated category.- Returns:
- the saved data.
-
deleteCategories
public void deleteCategories(String[] categoryIds)
Deletes categories into persistence.- Parameters:
categoryIds
- category identifiers.
-
getAllLinksOfInstance
public List<LinkDetail> getAllLinksOfInstance(String instanceId)
Gets all the links associated to given component instance identifier.- Returns:
- List of link.
-
getAllLinksOfResourceOnInstance
public List<LinkDetail> getAllLinksOfResourceOnInstance(String resourceId, String instanceId)
Gets all the links associated to given resource identifier hosted into to given component instance identifier.- Returns:
- List of link.
-
getAllLinksOfCurrentUser
public List<LinkDetail> getAllLinksOfCurrentUser()
Gets all the links of the current user.- Returns:
- List of link.
-
getAuthorizedLink
public LinkDetail getAuthorizedLink(String linkId)
Gets link details from its id by verifying user modification rights.- Parameters:
linkId
- the identifier of a link.- Returns:
- a
LinkDetail
instance or null if id is unknown.
-
createLink
public LinkDetail createLink(MyLinkEntity newLink)
Creates a link into persistence.- Parameters:
newLink
- data of a link.- Returns:
- the persisted data.
-
updateLink
public LinkDetail updateLink(MyLinkEntity updatedLink)
Updates a link into persistence- Parameters:
updatedLink
- the updated date of a link.- Returns:
- the saved data.
-
deleteLinks
public void deleteLinks(String[] links)
Deletes links into persistence.- Parameters:
links
- list of id about links to delete.
-
-