Package com.liferay.portal.struts

Examples of com.liferay.portal.struts.ActionException


 
    public static boolean renameLink (Link link, String newName, User user) throws Exception {

      // Checking permissions
      if (!permissionAPI.doesUserHavePermission(link, PERMISSION_WRITE, user))
        throw new ActionException(WebKeys.USER_PERMISSIONS_EXCEPTION);

      //getting old file properties
      Folder folder = APILocator.getFolderAPI().findParentFolder(link, user,false);
      CacheLocator.getNavToolCache().removeNav(folder.getHostId(), folder.getInode());
     
View Full Code Here


      Folder parent = (Folder) InodeFactory.getInode(parentInode, Folder.class);
      if (HTMLPageFactory.moveHTMLPage(webAsset, parent, user)) {
        SessionMessages.add(httpReq, "message", "message.htmlpage.move");
      } else {
        SessionMessages.add(httpReq, "error", "message.htmlpage.error.htmlpage.exists");
        throw new ActionException("Another page with the same page url exists in this folder");
      }
    }

  }
View Full Code Here

    // if this is a new htmlpage and there is already an identifier with
    // this uri, return
    if (!InodeUtils.isSet(existingHTMLPage.getInode()) && InodeUtils.isSet(testIdentifier.getInode())) {
      existingHTMLPage.setParent(parentFolder.getInode());
      SessionMessages.add(httpReq, "error", "message.htmlpage.error.htmlpage.exists");
      throw new ActionException("Another page with the same page url exists in this folder");
    }
    // if this is an existing htmlpage and there is already an identifier
    // with this uri, return
    else if (InodeUtils.isSet(existingHTMLPage.getInode()) && (!testIdentifier.getInode().equalsIgnoreCase(identifier.getInode()))
        && InodeUtils.isSet(testIdentifier.getInode())) {
      SessionMessages.add(httpReq, "error", "message.htmlpage.error.htmlpage.exists");
      // when there is an error saving should unlock working asset
      WebAssetFactory.unLockAsset(existingHTMLPage);
      throw new ActionException("Another page with the same page url exists in this folder");
    }

    if (UtilMethods.isSet(template)) {
      newHtmlPage.setTemplateId(templateIdentifier.getInode());
    }
View Full Code Here

    @SuppressWarnings({ "unchecked", "deprecation" })
  public static boolean renameHTMLPage (HTMLPage page, String newName, User user) throws Exception {

      // Checking permissions
      if (!permissionAPI.doesUserHavePermission(page, PERMISSION_WRITE, user))
        throw new ActionException(WebKeys.USER_PERMISSIONS_EXCEPTION);

      //getting old file properties
      Folder folder = APILocator.getFolderAPI().findParentFolder(page, user, false);
     
    Host host;
View Full Code Here

      HibernateUtil.saveOrUpdate(c);

    } catch (DotHibernateException dhe) {
      SessionMessages.add(req, "error", "error.communications.not-saved");
      //setForward(req,"portlet.ext.communications.edit_communication");
      throw new ActionException(dhe.getMessage());
    }

   
    // wipe the old HTML page entries
    HTMLPage page = (HTMLPage) InodeFactory.getChildOfClass(c, HTMLPage.class);
View Full Code Here

      l = UserClickFactory.getUserClicks(userClickId, minIndex, perPage);
     
   
    catch (Exception e) {
      Logger.error(this, e.getMessage(), e);
      throw new ActionException (e.getMessage());

    }
    req.setAttribute("numrows",(new Integer(numrows)));
    req.setAttribute(WebKeys.USER_CLICKS_VIEW, l);
View Full Code Here

      clickstream = (Clickstream) ClickstreamFactory.getClickstream(clickstreamId);
     
   
    catch (Exception e) {
      Logger.error(this, e.getMessage(), e);
      throw new ActionException (e.getMessage());
    }
    req.setAttribute("clickstream",clickstream);

    Logger.debug(this, "Done with _detail ViewHTMLPageViewsAction");
   
View Full Code Here

      newTemplate.setIdentifier(currentTemplate.getIdentifier());
    } else {
      //If the asset is new checking that the user has permission to add children to the parent host
      if(!permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, false)) {
        SessionMessages.add(httpReq, "message", "message.insufficient.permissions.to.save");
        throw new ActionException(WebKeys.USER_PERMISSIONS_EXCEPTION);
      }

    }

    //gets user id from request for mod user
View Full Code Here

    if (!InodeUtils.isSet(webAsset.getInode()))
      return;
    PermissionAPI perAPI = APILocator.getPermissionAPI();
    if (!perAPI.doesUserHavePermission(webAsset, permission, user)) {
      Logger.debug(DeliverCampaignThread.class, "_checkUserPermissions: user does not have permissions ( " + permission + " ) over this asset: " + webAsset);
      throw new ActionException(WebKeys.USER_PERMISSIONS_EXCEPTION);
    }
  }
View Full Code Here

    } else {
      //If the asset is new checking that the user has permission to add children to the parent host
      if(!permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, false)
          || !permissionAPI.doesUserHavePermissions(PermissionableType.CONTAINERS, PermissionAPI.PERMISSION_EDIT, user)) {
        SessionMessages.add(httpReq, "message", "message.insufficient.permissions.to.save");
        throw new ActionException(WebKeys.USER_PERMISSIONS_EXCEPTION);
      }
    }

    // Current associated templates
    List<Template> currentTemplates = InodeFactory.getChildrenClass(currentContainer, Template.class);
View Full Code Here

TOP

Related Classes of com.liferay.portal.struts.ActionException

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.