Package com.dotmarketing.tag.model

Examples of com.dotmarketing.tag.model.TagInode


      //Ensure the tag exists in the tag table
      Tag existingTag = getTag(tagName, "", hostId);

      //validates the tagInode already exists
    TagInode existingTagInode = getTagInode(existingTag.getTagId(), inode);

      if (existingTagInode.getTagId() == null) {

        //the tagInode does not exists, so creates a new TagInode
        TagInode tagInode = new TagInode();
        tagInode.setTagId(existingTag.getTagId());
        /*long i = 0;
        try{
          i =Long.parseLong(inode);
        }catch (Exception e) {
        Logger.error(this, "Unable to get Long value from " + inode, e);
      }*/
        tagInode.setInode(inode);
          HibernateUtil.saveOrUpdate(tagInode);

          return tagInode;
      }
      else {
View Full Code Here


      Logger.error(TagFactory.class,"getTagInode failed:" + e, e);
    }
        dh.setParam(tagId);
        dh.setParam(inode);

        TagInode tagInode;
        try {
          tagInode = (TagInode) dh.load();
        }
        catch (Exception ex) {
          tagInode = new TagInode();
        }
        return tagInode;
  }
View Full Code Here

  public static List deleteTagInode(String tagName, String inode) {
    StringTokenizer tagNameToken = new StringTokenizer(tagName, ",");
    if (tagNameToken.hasMoreTokens()) {
        for (; tagNameToken.hasMoreTokens();) {
          String tagTokenized = tagNameToken.nextToken().trim();
          TagInode tagInode = getTagInode(tagTokenized, inode);
            if (tagInode.getTagId() != null) {
                try {
            HibernateUtil.delete(tagInode);
          } catch (DotHibernateException e) {
            Logger.error(TagFactory.class,"deleteTagInode failed:" + e, e);
          }
View Full Code Here

      //Ensure the tag exists in the tag table
      Tag existingTag = getTag(tagName, "", hostId);

      //validates the tagInode already exists
    TagInode existingTagInode = getTagInode(existingTag.getTagId(), inode);

      if (existingTagInode.getTagId() == null) {

        //the tagInode does not exists, so creates a new TagInode
        TagInode tagInode = new TagInode();
        tagInode.setTagId(existingTag.getTagId());
        /*long i = 0;
        try{
          i =Long.parseLong(inode);
        }catch (Exception e) {
        Logger.error(this, "Unable to get Long value from " + inode, e);
      }*/
        tagInode.setInode(inode);
          HibernateUtil.saveOrUpdate(tagInode);

          return tagInode;
      }
      else {
View Full Code Here

        HibernateUtil dh = new HibernateUtil(TagInode.class);
        dh.setQuery("from tag_inode in class com.dotmarketing.tag.model.TagInode where tag_id = ? and inode = ?");
        dh.setParam(tagId);
        dh.setParam(inode);

        TagInode tagInode;
        try {
          tagInode = (TagInode) dh.load();
        }
        catch (Exception ex) {
          tagInode = new TagInode();
        }
        return tagInode;
  }
View Full Code Here

    StringTokenizer tagNameToken = new StringTokenizer(tagName, ",");
    if (tagNameToken.hasMoreTokens()) {
        for (; tagNameToken.hasMoreTokens();) {
          String tagTokenized = tagNameToken.nextToken().trim();
          Tag tag = getTag(tagTokenized,"","");
          TagInode tagInode = getTagInode(tag.getTagId(), inode);
            if (tagInode.getTagId() != null) {
                HibernateUtil.delete(tagInode);
          }
        }
    }
    return getTagInodeByInode(inode);
View Full Code Here

      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    final TagInode other = (TagInode) obj;
    if (tagId == null) {
      if (other.tagId != null)
        return false;
    } else if (!tagId.equals(other.tagId))
      return false;
    if (!InodeUtils.isSet(inode) ) {
      if (InodeUtils.isSet(inode))
        return false;
    } else if (inode.equalsIgnoreCase(other.getInode()))
      return false;
    return true;
  }
View Full Code Here

TOP

Related Classes of com.dotmarketing.tag.model.TagInode

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.