Class MyLinksWebManager
- java.lang.Object
-
- org.silverpeas.core.webapi.mylinks.MyLinksWebManager
-
@Service public class MyLinksWebManager extends Object
Permits to centralize WEB service processing betweenMyLinksResourceand the WAR controller.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMyLinksWebManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CategoryDetailcreateCategory(CategoryEntity newCategory)Creates a category into persistence.LinkDetailcreateLink(MyLinkEntity newLink)Creates a link into persistence.voiddeleteCategories(String[] categoryIds)Deletes categories into persistence.voiddeleteLinks(String[] links)Deletes links into persistence.static MyLinksWebManagerget()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.CategoryDetailgetAuthorizedCategory(String categoryId)Gets category details from its id by verifying user modification rights.LinkDetailgetAuthorizedLink(String linkId)Gets link details from its id by verifying user modification rights.CategoryDetailupdateCategory(CategoryEntity updatedCategory)Updates a category into persistence.LinkDetailupdateLink(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
CategoryDetailinstance 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
LinkDetailinstance 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.
-
-