Package com.dotmarketing.portlets.links.struts

Examples of com.dotmarketing.portlets.links.struts.LinkForm


    //calls edit method from super class that returns parent folder
    Folder parentFolder = super._editWebAsset(req, res, config, form, user,
        WebKeys.LINK_EDIT);

    //setting parent folder path and inode on the form bean
    LinkForm lf = (LinkForm) form;
    lf.setParent(parentFolder.getInode());

    //This can't be done on the WebAsset so it needs to be done here.
    Link link = (Link) req.getAttribute(WebKeys.LINK_EDIT);
    link.setParent(parentFolder.getInode());
    if (InodeUtils.isSet(link.getInode())) {
      if (InodeUtils.isSet(link.getInternalLinkIdentifier())) {
        lf.setInternalLinkIdentifier(link.getInternalLinkIdentifier());
      }
    } else {
      lf.setLinkType (LinkType.INTERNAL);
      link.setLinkType (LinkType.INTERNAL.toString());
    }

  }
View Full Code Here


   
    //wraps request to get session object
    ActionRequestImpl reqImpl = (ActionRequestImpl) req;
    HttpServletRequest httpReq = reqImpl.getHttpServletRequest();

    LinkForm linkForm = (LinkForm) form;
   
    //gets the new information for the link from the request object
    Link link = new Link();
    link.setTitle(((LinkForm) form).getTitle());   
    BeanUtils.copyProperties(link,form);
    req.setAttribute(WebKeys.LINK_FORM_EDIT,link);
   
    boolean previousShowMenu = link.isShowOnMenu();

    //gets the current link being edited from the request object
    Link currentLink = (Link) req.getAttribute(WebKeys.LINK_EDIT);
   
    //parent folder or inode for this file
    Folder parent = APILocator.getFolderAPI().find(req.getParameter("parent"), user, false);
    //http://jira.dotmarketing.net/browse/DOTCMS-5899
    if(UtilMethods.isSet(currentLink.getInode())){
      Identifier id = APILocator.getIdentifierAPI().find(currentLink);
      String URI = id.getURI();
      String uriPath = URI.substring(0,URI.lastIndexOf("/")+1);
      if(!uriPath.equals(APILocator.getIdentifierAPI().find(parent).getPath())){
        id.setURI(APILocator.getIdentifierAPI().find(parent).getPath()+currentLink.getProtocal() + currentLink.getUrl());
        APILocator.getIdentifierAPI().save(id);
      }
    }
   
    //Checking permissions
    _checkPermissions(currentLink, parent, user, httpReq);

    //gets user id from request for mod user
    String userId = user.getUserId();

    // take care of internal links
    if (InodeUtils.isSet(linkForm.getInternalLinkIdentifier())) {

      Identifier internalLinkIdentifier = identifierAPI.findFromInode(linkForm.getInternalLinkIdentifier());
      //link.setLinkType(LinkType.INTERNAL.toString());
      link.setInternalLinkIdentifier(internalLinkIdentifier.getInode());
      link.setProtocal("http://");

      StringBuffer myURL = new StringBuffer();
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.links.struts.LinkForm

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.