Package com.dotmarketing.beans

Examples of com.dotmarketing.beans.Identifier


  public File getFile() {
//    if (_file != null){
//      return _file;
//    }
    String uri;
    Identifier ident = new Identifier();
    try {
      ident = APILocator.getIdentifierAPI().find(host, getPath());
    } catch (Exception e1) {
      Logger.error(this, e1.getMessage(), e1);
    }
    try{
       uri = LiveCache.getPathFromCache(ident.getURI(), host);
    }catch (Exception e) {
      return null;
    }

    if(!UtilMethods.isSet(uri)){
View Full Code Here


    } else if (UtilMethods.isSet(request.getParameter("inode")) || UtilMethods.isSet(request.getParameter("id"))) {

      Contentlet cont = new Contentlet();
      if(InodeUtils.isSet(request.getParameter("id"))) {
        try {
          Identifier id = APILocator.getIdentifierAPI().find(request.getParameter("id"));
          long languageId = 0;
          try{
            languageId = ((Language) request.getSession(false).getAttribute(com.dotmarketing.util.WebKeys.HTMLPAGE_LANGUAGE)).getId();
          }catch (Exception e) {
            languageId = langAPI.getDefaultLanguage().getId();
          }
          cont = conAPI.findContentletByIdentifier(id.getInode(), true,languageId , user, true);
        } catch (Exception e) { }
      } else {
        String inode = request.getParameter("inode");
                try{
                  cont = conAPI.find(inode, user, true);
View Full Code Here

    String folderChildPath = thisFolderPath.substring(0, thisFolderPath.length() - 1);
    folderChildPath = folderChildPath.substring(0, folderChildPath.lastIndexOf("/"));

    Host host = WebAPILocator.getHostWebAPI().findParentHost(thisFolder, user, true);//DOTCMS-4099
    Identifier id = APILocator.getIdentifierAPI().find(host,thisFolderPath + "index." + Config.getStringProperty("VELOCITY_PAGE_EXTENSION"));
    if(id != null && InodeUtils.isSet(id.getInode()))
      stringbuf.append("<a href=\"" + UtilMethods.encodeURIComponent(thisFolderPath) + "\">");
    stringbuf.append(UtilHTML.escapeHTMLSpecialChars(thisFolder.getTitle()));
    if(id != null && InodeUtils.isSet(id.getInode()))
      stringbuf.append("</a>");

    if (currentLevel < numberOfLevels) {

      if (nextLevelItems) {
View Full Code Here

        map.put("title", "Home");
        map.put("url", "/");
        list.add(map);
        FolderAPI folderAPI = APILocator.getFolderAPI();
       
        Identifier id = APILocator.getIdentifierAPI().find((String) request.getAttribute("idInode"));
        HTMLPage htmlPage = (HTMLPage) APILocator.getVersionableAPI().findWorkingVersion(id,APILocator.getUserAPI().getSystemUser(),false);
        Folder folder = folderAPI.findParentFolder(htmlPage, APILocator.getUserAPI().getSystemUser(), false);
       
        String folderPath = APILocator.getIdentifierAPI().find(folder).getPath();
View Full Code Here

      }
        } else {
          Host h = APILocator.getHostAPI().find(hostId, APILocator.getUserAPI().getSystemUser(), false);
        Folder folder = fapi.findFolderByPath(openPath, h,user,true);
   
        Identifier identifier = APILocator.getIdentifierAPI().find(h, APILocator.getIdentifierAPI().find(folder).getPath() + pagePath);
        HTMLPage htmlpage = (HTMLPage) APILocator.getVersionableAPI().findWorkingVersion(identifier,APILocator.getUserAPI().getSystemUser(),false);
       
        if (htmlpage!=null) {
          if (listItems.add(htmlpage.getTitle())) {
                stringbuffer.append("<li>" + htmlpage.getTitle() + "</li>");
View Full Code Here

   * @throws DotSecurityException
   * @throws DotStateException
   */
  public boolean canUserPublish(String pageId, boolean respectedFrontendRoles) throws DotDataException, DotStateException, DotSecurityException{
    PermissionAPI perAPI = APILocator.getPermissionAPI();
    Identifier pageIdentifier;
    try {
      pageIdentifier = APILocator.getIdentifierAPI().find(pageId);
    } catch (DotHibernateException e) {
      Logger.error("Unable to retrieve identifier : ",e.getMessage() ,e);
      return false;
View Full Code Here

    //String videoURI = videoFile.getURI();
    String imageURI = videoURI.substring(0,videoURI.length()-4) + ".jpg";
    IFileAsset img = null;
    try {
      Host host = APILocator.getHostAPI().find(hostId,userAPI.getSystemUser(),false);
      Identifier id = APILocator.getIdentifierAPI().find(host, imageURI);
      if(id!=null && InodeUtils.isSet(id.getId()) && id.getAssetType().equals("contentlet")){
        Contentlet cont = APILocator.getContentletAPI().findContentletByIdentifier(id.getId(), true, APILocator.getLanguageAPI().getDefaultLanguage().getId(), userAPI.getSystemUser(),false);
        if(cont!=null && InodeUtils.isSet(cont.getInode())){
          img = APILocator.getFileAssetAPI().fromContentlet(cont);
        }
      }else{
        img = APILocator.getFileAPI().getFileByURI(imageURI, hostId, true, userAPI.getSystemUser(),false);
View Full Code Here

          if (skip)
            continue;

          Map<String, Object> fileMap = fileAsset.getMap();

          Identifier ident = APILocator.getIdentifierAPI().find(
              fileAsset.getVersionId());

          fileMap.put("wfMandatoryWorkflow", wfScheme!=null && wfScheme.isMandatory());
          fileMap.put("permissions", permissions);
          fileMap.put("mimeType", APILocator.getFileAPI()
              .getMimeType(fileAsset.getFileName()));
          fileMap.put("name", ident.getAssetName());
          fileMap.put("fileName", ident.getAssetName());
          fileMap.put("title", fileAsset.getFriendlyName());
          fileMap.put("description", fileAsset instanceof Contentlet ?
                                     ((Contentlet)fileAsset).getStringProperty(FileAssetAPI.DESCRIPTION)
                                     : "");
          fileMap.put("extension", UtilMethods
View Full Code Here

        }catch(DotDataException e){
          Logger.error(this, "Unable to look up content with inode " + inode, e);
        }
     
        Structure contentletStructure = StructureCache.getStructureByInode(contentlet.getStructureInode());
        Identifier contentletIdentifier = APILocator.getIdentifierAPI().find(contentlet);
          Field field;
         
          /* Validate if a NumberOfClicks field exists in the contentlet structure
           if not, then create it and populate it.*/
         
View Full Code Here

   * @throws IOException
   * @throws DotDataException
   * @throws NoSuchUserException
   */
  public static String readFile(String filePath, Host host) throws IOException,DotSecurityException, NoSuchUserException, DotDataException {
    Identifier ident = APILocator.getIdentifierAPI().find(host, filePath);
    String uri = LiveCache.getPathFromCache(ident.getURI(), host);

    String inode = UtilMethods.getFileName(new File(FileUtil.getRealPath(assetPath + uri)).getName());
    com.dotmarketing.portlets.files.model.File file = APILocator.getFileAPI().find(inode, APILocator.getUserAPI().getSystemUser(), false);

    if(!Config.getBooleanProperty("ENABLE_SCRIPTING", false)){
View Full Code Here

TOP

Related Classes of com.dotmarketing.beans.Identifier

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.