Package com.dotmarketing.beans

Examples of com.dotmarketing.beans.Host



  public Host getTemplateHost(Template template) throws DotDataException {

    try {
      Host host = APILocator.getHostAPI().findParentHost(template, APILocator.getUserAPI().getSystemUser(), false);
      return host;
    } catch (DotSecurityException e1) {
      Logger.error(TemplateAPIImpl.class, e1.getMessage(), e1);
      throw new DotRuntimeException(e1.getMessage(), e1);
    }
View Full Code Here


    }
   
    public List<NavResult> getChildren() throws Exception {
        if(children==null && hostId!=null && folderId!=null) {
            // lazy loadinge children
            Host host=APILocator.getHostAPI().find(hostId, sysuser, true);
            Folder folder=APILocator.getFolderAPI().find(folderId, sysuser, true);
            Identifier ident=APILocator.getIdentifierAPI().find(folder);
            NavResult lazyMe=NavTool.getNav(host, ident.getPath());
            children=lazyMe.getChildren();
            childrenFolderIds=lazyMe.getChildrenFolderIds();
View Full Code Here

      returnValue = true;
    } else {
      uriAux = stripMapping(uriAux);
      String hostName = getHostname(uriAux);
      Logger.debug(this, "Method isFolder: the hostname is " + hostName);
      Host host;
      try {
        host = hostAPI.findByName(hostName, user, false);
      } catch (DotDataException e) {
        Logger.error(DotWebdavHelper.class, e.getMessage(), e);
        throw new IOException(e.getMessage());
      } catch (DotSecurityException e) {
        Logger.error(DotWebdavHelper.class, e.getMessage(), e);
        throw new IOException(e.getMessage());
      }
      if (host != null && InodeUtils.isSet(host.getInode())) {
        String path = getPath(uriAux);
        Logger.debug(this, "Method isFolder: the path is " + path);
        if (path.equals("") || path.equals("/")) {
          returnValue = true;
        } else {
View Full Code Here

    }
    boolean returnValue = false;
    // Host
    String hostName = getHostname(uri);

    Host host;
    try {
      host = hostAPI.findByName(hostName, user, false);
    } catch (DotDataException e) {
      Logger.error(DotWebdavHelper.class, e.getMessage(), e);
      throw new IOException(e.getMessage());
    } catch (DotSecurityException e) {
      Logger.error(DotWebdavHelper.class, e.getMessage(), e);
      throw new IOException(e.getMessage());
    }

    if(host == null){
      Logger.debug(this, "isResource Method: Host is NULL");
    }else{
      Logger.debug(this, "isResource Method: host id is " + host.getIdentifier() + " and the host name is " + host.getHostname());
    }
    // Folder
    String path = getPath(uri);
    String folderName = getFolderName(path);
    Folder folder;
    try {
      folder = folderAPI.findFolderByPath(folderName, host, user,false);
    } catch (Exception e) {
      Logger.error(DotWebdavHelper.class, e.getMessage(), e);
      throw new IOException(e.getMessage());
    }
    if(folder!=null && InodeUtils.isSet(folder.getInode())) {
        // FileName
        String fileName = getFileName(path);
        fileName = deleteSpecialCharacter(fileName);

        if (InodeUtils.isSet(host.getInode())) {
          try {
            returnValue = fileAPI.fileNameExists(folder, fileName);
            if(!returnValue){
              returnValue = APILocator.getFileAssetAPI().fileNameExists(host, folder, fileName, "");
            }
View Full Code Here

            String themeHostId = APILocator.getFolderAPI().find( theme, user, false ).getHostId();
            String themePath;
            if ( themeHostId.equals( hostId ) ) {
                themePath = Template.THEMES_PATH + themeName + "/";
            } else {
                Host themeHost = APILocator.getHostAPI().find( themeHostId, user, false );
                themePath = "//" + themeHost.getHostname() + Template.THEMES_PATH + themeName + "/";
            }

            /*
            // get the imported files
            List<PreviewFileAsset> savedFiles = new ArrayList<PreviewFileAsset>();
View Full Code Here

      Folder parentFolder = APILocator.getFolderAPI().findParentFolder(this,APILocator.getUserAPI().getSystemUser(),false);
     
      if(parentFolder != null && InodeUtils.isSet(parentFolder.getInode()))
        return parentFolder;
     
      Host host =  APILocator.getHostAPI().findParentHost(this, APILocator.getUserAPI().getSystemUser(), false);
 
      if(host != null && InodeUtils.isSet(host.getIdentifier()))
        return host;
   
      return APILocator.getHostAPI().findSystemHost(APILocator.getUserAPI().getSystemUser(), false);
    } catch (DotSecurityException e) {
      Logger.error(File.class, e.getMessage(), e);
View Full Code Here

      boolean isFolder = false;
      boolean isResource = false;
      boolean isWebDavRoot = url.equals(AUTOPUB_PATH) || url.equals(NONPUB_PATH) || url.equals(AUTOPUB_PATH + "/") || url.equals(NONPUB_PATH + "/");
      boolean autoPub = url.startsWith(AUTOPUB_PATH);
      boolean nonPub = url.startsWith(NONPUB_PATH);
      Host host =null;
      String actualPath = "";
     
      // DAV ROOT
      if(isWebDavRoot){
        WebdavRootResourceImpl wr = new WebdavRootResourceImpl(url);
View Full Code Here

    String hostId=folder.getHostId();
    boolean isRootHost=APILocator.getFolderAPI().findSystemFolder().equals(folder);
    if(isRootHost)
        hostId=(String)session.getAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID);

    Host host=APILocator.getHostAPI().find(hostId, user, false);

    //check permissions
    if(isRootHost) {
        if(!APILocator.getPermissionAPI().doesUserHavePermission(host, PERMISSION_CAN_ADD_CHILDREN, user))
            throw new ActionException(WebKeys.USER_PERMISSIONS_EXCEPTION);
View Full Code Here

   
    if(req.getParameter("parent") != null) {
      parentFolder = folderAPI.find(req.getParameter("parent"),user,false);
    } else if(UtilMethods.isSet(file.getIdentifier())){
      Identifier tempId = APILocator.getIdentifierAPI().find(file.getIdentifier());
      Host fileHost = APILocator.getHostAPI().find(tempId.getHostId(), user, false);
      parentFolder = fileAPI.getFileFolder(file,fileHost, user, false);
    }

    // setting parent folder path and inode on the form bean
    if(parentFolder != null) {
View Full Code Here

    boolean respectFrontendRoles = userWebAPI.isLoggedToFrontend(req);
    if(count<=0)count=10;

    List<Template> fullListTemplates = new ArrayList<Template>();
    List<Template> totalTemplates = new ArrayList<Template>();
    Host host = hostAPI.find(query.get("hostId"), user, respectFrontendRoles);

    try{
      String filter = query.get("fullTitle");
      if(UtilMethods.isSet(filter)){
        filter = filter.replaceAll("\\*", "");
        filter = filter.replaceAll("\\?", "");
      }


      if(UtilMethods.isSet(query.get("hostId"))) {
          int startF=start;
          int countF=count;
          if(start==0){
                    Template t = new Template();
                    t.setOwner(user.getUserId());
                    t.setModUser(user.getUserId());
                    t.setInode("0");
                    t.setTitle("--- " + LanguageUtil.get(user, "All-Hosts") +" ---");
                    t.setIdentifier("0");
                    fullListTemplates.add(t);
                    totalTemplates.add(t);
                    countF=count-1;
                }
          else {
              startF=start-1;
          }
        fullListTemplates.addAll(templateAPI.findTemplatesUserCanUse(user, host.getHostname(), filter, true, startF, countF));
        totalTemplates.addAll(templateAPI.findTemplatesUserCanUse(user, host.getHostname(), filter, true, 0, 1000));

      }

      //doesn't currently respect archived
      if(fullListTemplates.size() ==0){
View Full Code Here

TOP

Related Classes of com.dotmarketing.beans.Host

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.