Package com.dotmarketing.portlets.links.model

Examples of com.dotmarketing.portlets.links.model.Link


              // recursive method here
              buildSubFolderSiteMapMenu(folderChild, 100, 1, 1);

            } else if (itemChild instanceof Link) {
              Link link = (Link) itemChild;
              if (link.isLive() && !link.isDeleted()) {
                if (link.getUrl()
                    .startsWith(host.getHostname())) {
                  stringbuf = "<url><loc>"
                      + XMLUtils.xmlEscape(link
                          .getProtocal()
                          + link.getUrl())
                      + "</loc><lastmod>"
                      + modifiedDateStringValue
                      + "</lastmod><changefreq>daily</changefreq></url>\n";
                  writeFile(stringbuf);
                  addRegistryProcessed();
View Full Code Here


            writeFile(stringbuf);
            addRegistryProcessed();
          }
        } else if (childChild2 instanceof Link) {
          Link link2 = (Link) childChild2;
          if (link2.isLive() && !link2.isDeleted()) {
            if (link2.getUrl().startsWith(host.getHostname())) {
              stringbuf = "<url><loc>"
                  + XMLUtils.xmlEscape(link2.getProtocal()
                      + link2.getUrl())
                  + "</loc><lastmod>"
                  + modifiedDateStringValue
                  + "</lastmod><changefreq>daily</changefreq></url>\n";
              writeFile(stringbuf);
              addRegistryProcessed();
View Full Code Here

        } catch (DotSecurityException e) {
          Logger.error(getClass(), "Couldn't add the Host to the Bundle. Bundle ID: " + config.getId() + ", Host ID: " + asset.getAsset(), e);
        }
      } else if(asset.getType().equals("links")) {
        try {
          Link link = (Link) APILocator.getVersionableAPI().findLiveVersion(asset.getAsset(), user, false);
         
          if(link == null || !InodeUtils.isSet(link.getInode())) {
            link = APILocator.getMenuLinkAPI().findWorkingLinkById(asset.getAsset(), user, false);
          }
         
          if(link == null || !InodeUtils.isSet(link.getInode())) {
            Logger.warn(getClass(), "Link id: "+ (asset.getAsset() != null ? asset.getAsset() : "N/A") +" does NOT have working or live version, not Pushed");
          } else {
            links.add(asset.getAsset(),link.getModDate());
            linksSet.add(asset.getAsset());
          }
         
        } catch (DotSecurityException e) {
          Logger.error(getClass(), "Couldn't add the Host to the Bundle. Bundle ID: " + config.getId() + ", Host ID: " + asset.getAsset(), e);
View Full Code Here

        Host hh=APILocator.getHostAPI().find(ident.getHostId(), user, false);
                hosts.addOrClean( hh.getIdentifier(), hh.getModDate());
        hostsSet.add(hh.getIdentifier());

        Link link = APILocator.getMenuLinkAPI().findWorkingLinkById(linkId, user, false);

        if(link!=null) {

          if(link.getLinkType().equals(Link.LinkType.INTERNAL.toString())) {
            Identifier id = APILocator.getIdentifierAPI().find(link.getInternalLinkIdentifier());

            // add file/content dependencies
            if (InodeUtils.isSet(id.getInode()) && id.getAssetType().equals("contentlet")) {
              List<Contentlet> contentList = APILocator.getContentletAPI().search("+identifier:"+id.getId(), 0, 0, "moddate", user, false);
View Full Code Here

    public void addLinkToContentlet(Contentlet contentlet, String linkInode, String relationName, User user, boolean respectFrontendRoles)throws DotSecurityException, DotDataException {
        if(contentlet.getInode().equals(""))
            throw new DotContentletStateException(CAN_T_CHANGE_STATE_OF_CHECKED_OUT_CONTENT);
        if (InodeUtils.isSet(linkInode)) {
            Link link = (Link) InodeFactory.getInode(linkInode, Link.class);
            Identifier identifier = APILocator.getIdentifierAPI().find(link);
            relAPI.addRelationship(contentlet.getInode(),identifier.getInode(), relationName);
            ContentletServices.invalidate(contentlet, true);
            // writes the contentlet object to a file
            ContentletMapServices.invalidate(contentlet, true);
View Full Code Here

      return (Link) dh.load();
    } catch (Exception e) {
      Logger.error(LinkFactory.class, "getLinkByLiveAndFolderAndTitle failed:" + e, e);
    }

    return new Link();
  }
View Full Code Here

    }
   
   
    public static Link getLinkByFriendlyName(String friendlyName) {
        HibernateUtil dh = new HibernateUtil(Link.class);
        Link link =null;
        try {
      dh.setQuery("from inode in class com.dotmarketing.portlets.links.model.Link where friendly_name = ? and type='links' and live=" + com.dotmarketing.db.DbConnectionFactory.getDBTrue());
      dh.setParam(friendlyName);
      link = (Link) dh.load();
    } catch (DotHibernateException e) {
View Full Code Here

      if(inode instanceof HTMLPage){
        return ((com.dotmarketing.portlets.links.model.Link) LinkFactory.getLinkFromHTMLPage((HTMLPage) inode, userId))
      }
     
      return (new Link());


    }
View Full Code Here

     
      if(linkURIs.size() > 0){
         Identifier linkIdentifier = (Identifier) linkURIs.get(0);
         return ((Link) APILocator.getVersionableAPI().findWorkingVersion(linkIdentifier,APILocator.getUserAPI().getSystemUser(),false));       
      }else{
        Link link = new Link();
       
        link.setTitle(inFile.getTitle());
        link.setFriendlyName(inFile.getFriendlyName());
        link.setProtocal(protocol);
        link.setUrl(url.toString());
        link.setTarget("_self");
        link.setInternal(true);
       
       // WebAssetFactory.createAsset(link,userId,parentFolder);
        return ((Link) link)
      }
    }
View Full Code Here

         Identifier linkIdentifier = (Identifier) linkURIs.get(0);
        
              
         return ((Link) APILocator.getVersionableAPI().findWorkingVersion(linkIdentifier,systemUser,false));       
      }else{
        Link link = new Link();
        Folder parentFolder = APILocator.getFolderAPI().findParentFolder(inHTMLPage,systemUser,false);
       
        link.setTitle(inHTMLPage.getTitle());
        link.setFriendlyName(inHTMLPage.getFriendlyName());
        link.setProtocal(protocol);
        link.setUrl(url.toString());
        link.setTarget("_self");
      link.setInternal(true);
       
       WebAssetFactory.createAsset(link,userId,parentFolder);
        return ((Link) link)
      }
    }
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.links.model.Link

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.