Package com.dotmarketing.beans

Examples of com.dotmarketing.beans.Identifier


        }
    }

    public String getPath() {

        Identifier id = null;

        try {
            id = APILocator.getIdentifierAPI().find(this.getIdentifier());
        } catch (DotDataException e) {
            Logger.error(Folder.class, e.getMessage(), e);
        } catch (Exception e) {
            Logger.debug(this, " This is usually not a problem as it is usually just the identifier not being found" +  e.getMessage(), e);
        }

        //TODO: New code in this class!
        Logger.info( this, "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" );
        Logger.info( this, "Modified Code, this class was redefined." );
        Logger.info( this, "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" );
        //TODO: New code in this class!

        return id!=null?id.getPath():null;
    }
View Full Code Here


    public static TemplateLayout themeLayout ( String themeInode, Boolean isPreview ) throws DotDataException, DotSecurityException {

        String title = null;
        String drawedBody;
        if ( UtilMethods.isSet( themeInode ) ) {
            Identifier ident = APILocator.getIdentifierAPI().findFromInode( themeInode );
           
            Template template = APILocator.getTemplateAPI().findWorkingTemplate(ident.getId(), sysUser, false);

            if ( !template.getInode().equals( themeInode ) ) {
                template = (Template) InodeFactory.getInode( themeInode, Template.class );
            }
View Full Code Here

        if (htmlPage != null && UtilMethods.isSet(htmlPage.getTitle())) {
          html = true;
          Logger.debug(DeliverCampaignThread.class, "Got htmlPage:"+ htmlPage.getTitle());

          // get the newsletter and the attachments
          Identifier id = APILocator.getIdentifierAPI().find(htmlPage);

          serverName = APILocator.getHostAPI().find(id.getHostId(), APILocator.getUserAPI().getSystemUser(), false).getHostname();

          //rewrite the urls
          try {
            Logger.debug(DeliverCampaignThread.class, "Retrieving page from url " + "http://"+ serverName + UtilMethods.encodeURIComponent(id.getURI()));
            message = new StringBuffer(UtilMethods.escapeUnicodeCharsForHTML(UtilMethods.getURL("http://"+ serverName + UtilMethods.encodeURIComponent(id.getURI())).toString()));
            Logger.debug(DeliverCampaignThread.class, "Page retrieved " + message);
            message = EmailFactory.alterBodyHTML(message, serverName);
            Logger.debug(DeliverCampaignThread.class, "Page altered " + message);
            alternateTextMessage = "If you are having trouble reading this message, click here: "+ "http://"+ serverName + UtilMethods.encodeURIComponent(id.getURI());
          }catch(Exception e){
            /**
             * This condition was included to avoid send 
             * campaigns without content
             * */
 
View Full Code Here

        }
      }
     
   
      if (structure != null && UtilMethods.isSet(structure.getDetailPage())) {
        Identifier ident;
        try {
          ident = APILocator.getIdentifierAPI().find(structure.getDetailPage());
          if(ident ==null || ! UtilMethods.isSet(ident.getInode())){
            throw new DotRuntimeException("No valid detail page for structure '" + structure.getName() + "'. Looking for detail page id=" + structure.getDetailPage());
          }

         
          if((cons != null && cons.size() > 0) || !urlFallthrough){
           
            if (request.getParameter("livePage") != null && request.getParameter("livePage").equals("1")) {
              EDIT_MODE = false;
              session.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, null);
              request.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, null);
              session.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, null);
              request.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, null);
              LogFactory.getLog(this.getClass()).debug("URLMAP FILTER Cleaning PREVIEW_MODE_SESSION LIVE!!!!");

            }

            if (request.getParameter("previewPage") != null && request.getParameter("previewPage").equals("1")) {
              EDIT_MODE = true;
              session.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, null);
              request.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, null);
              session.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, "true");
              request.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, "true");
              LogFactory.getLog(this.getClass()).debug("URLMAP FILTER Cleaning EDIT_MODE_SESSION PREVIEW!!!!");
            }

            if (request.getParameter("previewPage") != null && request.getParameter("previewPage").equals("2")) {
              EDIT_MODE = false;
              session.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, "true");
              request.setAttribute(com.dotmarketing.util.WebKeys.PREVIEW_MODE_SESSION, "true");
              session.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, null);
              request.setAttribute(com.dotmarketing.util.WebKeys.EDIT_MODE_SESSION, null);
              LogFactory.getLog(this.getClass()).debug("URLMAP FILTER Cleaning PREVIEW_MODE_SESSION PREVIEW!!!!");
            }
           
            request.getRequestDispatcher(ident.getURI()).forward(req, res);
          }else{
            chain.doFilter(req, res);
          }
          return;
        } catch (Exception e) {
View Full Code Here

    ActionRequestImpl reqImpl = (ActionRequestImpl) req;
    HttpServletRequest httpReq = reqImpl.getHttpServletRequest();

    // gets the current container being edited from the request object
    WebAsset webAsset = (WebAsset) req.getAttribute(webKey);
    Identifier identifier = com.dotmarketing.business.APILocator.getIdentifierAPI().find(webAsset);

    // gets working container
    WebAsset workingWebAsset = (WebAsset) APILocator.getVersionableAPI().findWorkingVersion(identifier,APILocator.getUserAPI().getSystemUser(),false);
    // gets live container
    WebAsset liveWebAsset = (WebAsset) APILocator.getVersionableAPI().findLiveVersion(identifier,APILocator.getUserAPI().getSystemUser(),false);

    // gets folder parent
    String parentInode = req.getParameter("parent");

    if (parentInode != null && parentInode.length() != 0 && !parentInode.equals("")) {
      // the new parent is being passed through the request
      Folder parent = (Folder) InodeFactory.getInode(parentInode, Folder.class);

      // Checking permissions
      _checkCopyAndMovePermissions(webAsset, parent, user, httpReq, "move");

      // gets old parent
      Folder oldParent = APILocator.getFolderAPI().findParentFolder(workingWebAsset, user, false);
      Logger.debug(this, "Old Parent Folder=" + oldParent.getInode());
      oldParent.deleteChild(workingWebAsset);
      if ((liveWebAsset != null) && (InodeUtils.isSet(liveWebAsset.getInode()))) {
        oldParent.deleteChild(liveWebAsset);
      }

      // Adding to new parent
      Logger.debug(this, "Parent Folder=" + parent.getInode());
      parent.addChild(workingWebAsset);
      if ((liveWebAsset != null) && (InodeUtils.isSet(liveWebAsset.getInode()))) {
        parent.addChild(liveWebAsset);
      }

      // gets identifier for this webasset and changes the uri and
      // persists it
      Host newHost = hostAPI.findParentHost(parent, user, false);
      identifier.setHostId(newHost.getIdentifier());
      identifier.setURI(workingWebAsset.getURI(parent));
      APILocator.getIdentifierAPI().save(identifier);

      SessionMessages.add(httpReq, "message", "message." + webAsset.getType() + ".move");
    }
View Full Code Here

    String inode=req.getParameter("inode");
   
    if(InodeUtils.isSet(inode)) {
      // editing existing asset
     
      Identifier ident=APILocator.getIdentifierAPI().findFromInode(inode);
      webAsset = (WebAsset) APILocator.getVersionableAPI().findWorkingVersion(ident, user, false);
      if(!webAsset.getInode().equals(inode)){
        webAsset = (WebAsset)InodeFactory.getInode(inode, myClass);
      }
     
View Full Code Here

   * @return The identifier or an empty (inode = 0) identifier if it wasn't
   *         found in momory and db.
   */
  protected Identifier getIdentifier( String hostId, String URI ) {

    Identifier value = null;
    try {
        final String key = getPrimaryGroup() + hostId + "-" + URI;
      value = (Identifier) cache.get(key, getPrimaryGroup());
      if(value ==null) {
          value = (Identifier) cache.get(key, get404Group());
View Full Code Here

  }


  protected Identifier getIdentifier(String identId)  {

    Identifier value = null;
    try {
        final String key = getPrimaryGroup() + identId;
      value = (Identifier) cache.get(key, getPrimaryGroup());
      if(value==null) {
          value = (Identifier) cache.get(key, get404Group());
View Full Code Here

    }
  }
 
  public void removeFromCacheByIdentifier(String ident) {
   
    Identifier id = getIdentifier(ident);
    if(id==null){
      id=new Identifier();
      id.setId(ident);
    }
   
    removeFromCacheByIdentifier(id);

  }
View Full Code Here

  }
 


  protected void removeFromCacheByURI(String hostId,String URI) {
    Identifier id = getIdentifier(hostId,URI);
    if(id==null) {
        String key = getPrimaryGroup() + hostId + "-" + URI;
        cache.remove(key, getPrimaryGroup());
        cache.remove(key, get404Group());
    }
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.