Package com.dotmarketing.portlets.contentlet.business

Examples of com.dotmarketing.portlets.contentlet.business.HostAPI.find()


             
        if (UtilMethods.isSet(req.getParameter("query"))){
          if(UtilMethods.isSet(req.getParameter("host_name"))){
            hostId =req.getParameter("host_name");
          }
          Host h = hostAPI.find(hostId, user, false);

          List<VirtualLink> listVar = virtualLinkAPI.getVirtualLinks(req.getParameter("query"), url, orderby);
          List<VirtualLink> listV = new ArrayList<VirtualLink>();
          Iterator listvs = listVar.iterator();
          if(h != null && InodeUtils.isSet(h.getInode()))
View Full Code Here


        }
        else{
         
          List<VirtualLink> listTemp = new ArrayList<VirtualLink>();
          List<VirtualLink> list = new ArrayList<VirtualLink>();
          Host h = hostAPI.find(hostId, user, false);
          if (InodeUtils.isSet(req.getParameter("inode"))) {
            HTMLPage htmlPage = (HTMLPage) InodeFactory.getInode(req.getParameter("inode"),HTMLPage.class);
            Identifier identifier = APILocator.getIdentifierAPI().find(htmlPage);
            listTemp = VirtualLinkFactory.getIncomingVirtualLinks(identifier.getURI());
          }
View Full Code Here

    if( !url.startsWith("/") ) {
      url = "/" + url;
    }
   
    if (InodeUtils.isSet(mlForm.getHostId())) {
        Host host = hostAPI.find(mlForm.getHostId(), user, false);
        completeUrl = host.getHostname() + ":" + url;
    } else {
        completeUrl = url;
    }
   
View Full Code Here

        return fAPI.find(this.getFolder(), APILocator.getUserAPI().getSystemUser(), false);
      }

      // if this contentlet is being saved in a host, inherit from the host
      if(InodeUtils.isSet(this.getHost()) && ! this.getHost().equals(systemHost.getIdentifier())) {
        return hostAPI.find(this.getHost(), systemUser, false);
      }

      // if this contentlet has a structure, inherit from that
      if(st != null && InodeUtils.isSet(st.getInode())){
        return st;
View Full Code Here

          boolean copyFiles = copyParams.get("copy_files").equals("on");
          boolean copyPages = copyParams.get("copy_pages").equals("on");
          boolean copyVirtualLinks = copyParams.get("copy_virtual_links").equals("on");
          boolean copyHostVariables = copyParams.get("copy_host_variables").equals("on");

          Host source = hostAPI.find(copyFromHostId, user, false);
          HostCopyOptions hostCopyOptions = null;
          if (copyAll)
            hostCopyOptions = new HostCopyOptions(copyAll);
          else
            hostCopyOptions = new HostCopyOptions(copyTemplatesContainers, copyFolders, copyFiles, copyPages, copyContentOnPages, copyContentOnHost,
View Full Code Here

    Host host = null;
    // if someone is changing hosts as a parameter, check permissions
    if(UtilMethods.isSet(req.getParameter("host_id"))){
      try{
        host = hostAPI.find(req.getParameter("host_id"), user, false);

        if(host != null && pAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, false)){
          req.getSession().setAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID, req.getParameter("host_id"));
          UserUtil.setLastHost(user, host);
        }
View Full Code Here

    }
    // else check if the user as permissions to the host in their session (can change, login as, etc..)
    else if(UtilMethods.isSet(req.getSession().getAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID)) ){
      String x = (String) req.getSession().getAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID);
      try{
        host = hostAPI.find(x, user, false);
        if(host != null && pAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, false)){
          req.getSession().setAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID, host.getIdentifier());
        }
        else{
          Logger.error(this.getClass(), "user " + user.getUserId() + " does not have permission to host " +req.getSession().getAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.