Package com.dotcms.repackage.org.directwebremoting

Examples of com.dotcms.repackage.org.directwebremoting.WebContext


 
  public Map<String, Object> getCategoryMap (String catInode)
      throws DotDataException, DotSecurityException, PortalException, SystemException {
   
    Map<String,Object> categoryMap = new HashMap<String,Object>();
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();   
    //Retrieving the current user
    User user = userWebAPI.getLoggedInUser(request);
    boolean respectFrontendRoles = !userWebAPI.isLoggedToBackend(request);

   
View Full Code Here


    return mapOfUserRoles;
  }

  public void removeUsersFromRole(String[] userIds, String roleId) throws DotDataException, NoSuchUserException, DotRuntimeException, PortalException, SystemException, DotSecurityException {

    WebContext ctx = WebContextFactory.get();
    RoleAPI roleAPI = APILocator.getRoleAPI();
    UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
    HttpServletRequest request = ctx.getHttpServletRequest();
    UserAPI uAPI = APILocator.getUserAPI();

    Role role = roleAPI.loadRoleById(roleId);

    for(String userId : userIds) {
View Full Code Here

      roleAPI.removeRoleFromUser(role, user);
    }
  }

  public Map<String, Object> addUserToRole(String userId, String roleId) throws DotDataException, DotRuntimeException, PortalException, SystemException, DotSecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    WebContext ctx = WebContextFactory.get();
    RoleAPI roleAPI = APILocator.getRoleAPI();
    UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
    HttpServletRequest request = ctx.getHttpServletRequest();
    UserAPI uAPI = APILocator.getUserAPI();

    Role role = roleAPI.loadRoleById(roleId);
    User user = uAPI.loadUserById(userId, uWebAPI.getLoggedInUser(request), !uWebAPI.isLoggedToBackend(request));
View Full Code Here

   
   
  }

  private User getUser() throws PortalException, SystemException {
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();
    User user = WebAPILocator.getUserWebAPI().getLoggedInUser(request);
    return user;
  }
View Full Code Here

   */
  public List<Map<String, Object>> getAllAvailablePortletInfoList() throws SystemException, LanguageException, DotRuntimeException, PortalException {

    PortletAPI portletAPI = APILocator.getPortletAPI();
    UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();

    List<Map<String, Object>> listOfPortletsInfo = new ArrayList<Map<String,Object>>();

    List<Portlet> portlets = portletAPI.findAllPortlets();
    for(Portlet p: portlets) {
View Full Code Here

   * @throws DotRuntimeException
   */
  public List<Map<String, Object>> getRolePermissions(String roleId) throws DotDataException, DotSecurityException, PortalException, SystemException {

    UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI();
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();

    UserAPI userAPI = APILocator.getUserAPI();
    HostAPI hostAPI = APILocator.getHostAPI();
    FolderAPI folderAPI = APILocator.getFolderAPI();

View Full Code Here

  }

  private List<String> getPorletTitlesFromLayout (Layout l) throws LanguageException, DotRuntimeException, PortalException, SystemException {

    UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();

    List<String> portletIds = l.getPortletIds();
    List<String> portletTitles = new ArrayList<String>();
    if(portletIds != null) {
      for(String id: portletIds) {
View Full Code Here

  }

  public Map<String, Object>  isPermissionableInheriting(String assetId) throws DotDataException, DotRuntimeException, PortalException, SystemException, DotSecurityException{

    UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI();
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();

    Map<String, Object> ret =  new HashMap<String, Object>();
    ret.put("isInheriting", false);

View Full Code Here

          major = "";
        }
      }
    }
   
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest req = ctx.getHttpServletRequest();
    req.getSession().setAttribute("_autoupdater_showUpdate", showUpdate);
    req.getSession().setAttribute("_autoupdater_major", major);
    req.getSession().setAttribute("_autoupdater_minor", minor);
    req.getSession().setAttribute("_autoupdater_buildNumber", '0');
    toReturn.put("showUpdate", showUpdate);
View Full Code Here

   * @throws DotSecurityException
   */
  public List<Map<String, Object>> getAssetPermissions(String assetId, Long languageId) throws DotDataException, DotRuntimeException, PortalException, SystemException, DotSecurityException {

    UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI();
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();

    //Retrieving the current user
    User user = userWebAPI.getLoggedInUser(request);
    boolean respectFrontendRoles = !userWebAPI.isLoggedToBackend(request);

View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.directwebremoting.WebContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.