Package com.dotmarketing.business

Source Code of com.dotmarketing.business.RelationshipAPIImpl

package com.dotmarketing.business;

import com.dotmarketing.beans.Tree;
import com.dotmarketing.exception.DotDataException;
import com.dotmarketing.factories.TreeFactory;
import com.dotmarketing.util.InodeUtils;

public class RelationshipAPIImpl implements RelationshipAPI {

  public void addRelationship(String parent,String child, String relationType)throws DotDataException {   
    Tree tree = TreeFactory.getTree(parent, child,relationType);
    if (!InodeUtils.isSet(tree.getParent()) || !InodeUtils.isSet(tree.getChild())) {
      tree.setParent(parent);
      tree.setChild(child);
      tree.setRelationType(relationType);
      TreeFactory.saveTree(tree);
    } else {
      tree.setRelationType(relationType);
      TreeFactory.saveTree(tree);
    }
  }

}
TOP

Related Classes of com.dotmarketing.business.RelationshipAPIImpl

TOP
Copyright © 2018 www.massapi.com. 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.