fr.paris.lutece.plugins.jcr.business.admin
Class AdminJcrHome

java.lang.Object
  extended by fr.paris.lutece.plugins.jcr.business.admin.AdminJcrHome

public final class AdminJcrHome
extends Object

Home class for JCR administration


Field Summary
static String ROLE_NONE
           
 
Method Summary
 int countAdminViewRoleByRole(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the number of AdminViewRole linked with the specified Lutece Role
 void createView(AdminView view, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 void createWorkspace(AdminWorkspace workspace, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 void deleteView(int id, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 void deleteWorkspace(int id, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 boolean existsViewWithWorkspaceId(int nWorkspaceId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Test if given workspace has attached views
 Collection<AdminView> findAllViews(fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 Collection<AdminView> findAllViewsByWorkSpaceId(int nWorkspaceId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 Collection<AdminWorkspace> findAllWorkspaces(fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 String findJcrType(int nViewId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 AdminView findViewById(int nViewId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 AdminWorkspace findWorkspaceById(int nWorkspaceId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 String[] getAuthorizedRoles(AdminView adminView, String strAccess, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns a list of roles authorized on this view
 Boolean getAvailableAccess(AdminView adminView, String[] userRoles, String strAccessRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Computes authorizations
static AdminJcrHome getInstance()
           
 Map<String,AdminWorkspace> getWorkspacesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 Map<String,AdminWorkspace> getWorkspacesListByNameKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 void modifyView(AdminView view, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 void modifyWorkspace(AdminWorkspace workspace, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 void updateRoles(AdminView adminView, String strAccess, String[] roles, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update roles of a view
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE_NONE

public static final String ROLE_NONE
See Also:
Constant Field Values
Method Detail

getInstance

public static AdminJcrHome getInstance()
Returns:
an instance of AdminJcrHome

createWorkspace

public void createWorkspace(AdminWorkspace workspace,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
workspace - the workspace to create
plugin - the plugin

modifyWorkspace

public void modifyWorkspace(AdminWorkspace workspace,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
workspace - the workspace to modify
plugin - the plugin

deleteWorkspace

public void deleteWorkspace(int id,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
id - of the workspace to delete
plugin - the plugin

createView

public void createView(AdminView view,
                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
view - the view to create
plugin - the plugin

modifyView

public void modifyView(AdminView view,
                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
view - the view to modify
plugin - the plugin

deleteView

public void deleteView(int id,
                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
id - the id of the view to delete
plugin - the plugin

findAllViews

public Collection<AdminView> findAllViews(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
plugin - the plugin
Returns:
all available views

findAllViewsByWorkSpaceId

public Collection<AdminView> findAllViewsByWorkSpaceId(int nWorkspaceId,
                                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
plugin - the plugin
nWorkspaceId - the workspace id to find
Returns:
all available views

findAllWorkspaces

public Collection<AdminWorkspace> findAllWorkspaces(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
plugin - the plugin
Returns:
all available workspaces

getWorkspacesList

public Map<String,AdminWorkspace> getWorkspacesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
plugin - the plugin
Returns:
a map of all workspaces

getWorkspacesListByNameKey

public Map<String,AdminWorkspace> getWorkspacesListByNameKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
plugin - the plugin
Returns:
a map of all workspaces

findWorkspaceById

public AdminWorkspace findWorkspaceById(int nWorkspaceId,
                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
nWorkspaceId - the workspace id to find
plugin - the plugin
Returns:
an AdminWorkspace

findViewById

public AdminView findViewById(int nViewId,
                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
nViewId - the view ID to fin
plugin - the plugin
Returns:
the adminView

findJcrType

public String findJcrType(int nViewId,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Parameters:
nViewId - the view ID to search the jcr type for
plugin - the plugin
Returns:
the jcr type

existsViewWithWorkspaceId

public boolean existsViewWithWorkspaceId(int nWorkspaceId,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Test if given workspace has attached views

Parameters:
nWorkspaceId - the workspace id
plugin - the plugin
Returns:
true if there are some views attached

getAvailableAccess

public Boolean getAvailableAccess(AdminView adminView,
                                  String[] userRoles,
                                  String strAccessRight,
                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Computes authorizations

Parameters:
adminView - the view
userRoles - an array of roles to test
strAccessRight - the permission to check
plugin - the plugin
Returns:
true if user if authorized

updateRoles

public void updateRoles(AdminView adminView,
                        String strAccess,
                        String[] roles,
                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update roles of a view

Parameters:
adminView - the view
strAccess - the permission
roles - the roles to attach
plugin - the plugin

getAuthorizedRoles

public String[] getAuthorizedRoles(AdminView adminView,
                                   String strAccess,
                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns a list of roles authorized on this view

Parameters:
adminView - the vie
strAccess - the permission
plugin - the plugin
Returns:
an array of roles

countAdminViewRoleByRole

public int countAdminViewRoleByRole(String strRoleKey,
                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of AdminViewRole linked with the specified Lutece Role

Parameters:
strRoleKey - The Lutece Role key
plugin - The plugin
Returns:
the count of AdminViewRole


Copyright © 2014 Mairie de Paris. All Rights Reserved.