Package org.wso2.carbon.ui

Examples of org.wso2.carbon.ui.JSPContextFinder$Finder


public class CmsFriendlinkCtgDaoImpl extends
    HibernateBaseDao<CmsFriendlinkCtg, Integer> implements
    CmsFriendlinkCtgDao {
  @SuppressWarnings("unchecked")
  public List<CmsFriendlinkCtg> getList(Integer siteId) {
    Finder f = Finder.create("from CmsFriendlinkCtg bean");
    if (siteId != null) {
      f.append(" where bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    f.append(" order by bean.priority asc");
    return find(f);
  }
View Full Code Here


@Repository
public class CmsAdvertisingDaoImpl extends
    HibernateBaseDao<CmsAdvertising, Integer> implements CmsAdvertisingDao {
  public Pagination getPage(Integer siteId, Integer adspaceId,
      Boolean enabled, int pageNo, int pageSize) {
    Finder f = Finder.create("from CmsAdvertising bean where 1=1");
    if (siteId != null && adspaceId == null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    } else if (adspaceId != null) {
      f.append(" and bean.adspace.id=:adspaceId");
      f.setParam("adspaceId", adspaceId);
    }
    if (enabled != null) {
      f.append(" and bean.enabled=:enabled");
      f.setParam("enabled", enabled);
    }
    f.append(" order by bean.id desc");
    return find(f, pageNo, pageSize);
  }
View Full Code Here

    return find(f, pageNo, pageSize);
  }

  @SuppressWarnings("unchecked")
  public List<CmsAdvertising> getList(Integer adspaceId, Boolean enabled) {
    Finder f = Finder.create("from CmsAdvertising bean where 1=1");
    if (adspaceId != null) {
      f.append(" and bean.adspace.id=:adspaceId");
      f.setParam("adspaceId", adspaceId);
    }
    if (enabled != null) {
      f.append(" and bean.enabled=:enabled");
      f.setParam("enabled", enabled);
    }
    return find(f);
  }
View Full Code Here

public class CmsKeywordDaoImpl extends HibernateBaseDao<CmsKeyword, Integer>
    implements CmsKeywordDao {
  @SuppressWarnings("unchecked")
  public List<CmsKeyword> getList(Integer siteId, boolean onlyEnabled,
      boolean cacheable) {
    Finder f = Finder.create("from CmsKeyword bean where 1=1");
    if (siteId != null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    if (onlyEnabled) {
      f.append(" and bean.disabled=false");
    }
    f.append(" order by bean.id desc");
    f.setCacheable(cacheable);
    return find(f);
  }
View Full Code Here

    return find(f);
  }

  @SuppressWarnings("unchecked")
  public List<CmsKeyword> getListGlobal(boolean onlyEnabled, boolean cacheable) {
    Finder f = Finder
        .create("from CmsKeyword bean where bean.site.id is null");
    if (onlyEnabled) {
      f.append(" and bean.disabled=false");
    }
    f.append(" order by bean.id desc");
    return find(f);
  }
View Full Code Here

public class CmsCommentDaoImpl extends HibernateBaseDao<CmsComment, Integer>
    implements CmsCommentDao {
  public Pagination getPage(Integer siteId, Integer contentId,
      Integer greaterThen, Boolean checked, boolean recommend,
      boolean desc, int pageNo, int pageSize, boolean cacheable) {
    Finder f = getFinder(siteId, contentId, null,null,greaterThen, checked,
        recommend, desc, cacheable);
    return find(f, pageNo, pageSize);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<CmsComment> getList(Integer siteId, Integer contentId,
      Integer greaterThen, Boolean checked, boolean recommend,
      boolean desc, int count, boolean cacheable) {
    Finder f = getFinder(siteId, contentId, null,null,greaterThen, checked,
        recommend, desc, cacheable);
    f.setMaxResults(count);
    return find(f);
  }
View Full Code Here

    return find(f);
  }
  public Pagination getPageForMember(Integer siteId, Integer contentId,Integer toUserId,Integer fromUserId,
      Integer greaterThen, Boolean checked, Boolean recommend,
      boolean desc, int pageNo, int pageSize,boolean cacheable){
    Finder f = getFinder(siteId, contentId, toUserId,fromUserId,greaterThen, checked,
        recommend, desc, cacheable);
    return find(f, pageNo, pageSize);
  }
View Full Code Here

        recommend, desc, cacheable);
    return find(f, pageNo, pageSize);
  }
  public List<CmsComment> getListForDel(Integer siteId, Integer userId,
      Integer commentUserId, String ip){
    Finder f = Finder.create("from CmsComment bean where 1=1");
    if (siteId != null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    if(commentUserId!=null){
      f.append(" and bean.commentUser.id=:commentUserId");
      f.setParam("commentUserId", commentUserId);
    }
    if(userId!=null){
      f.append(" and bean.content.user.id=:fromUserId");
      f.setParam("fromUserId", userId);
    }
    f.setCacheable(false);
    return find(f);
  }
View Full Code Here

  }

  private Finder getFinder(Integer siteId, Integer contentId,Integer toUserId,Integer fromUserId,
      Integer greaterThen, Boolean checked, Boolean recommend,
      boolean desc, boolean cacheable) {
    Finder f = Finder.create("from CmsComment bean where 1=1");
    if (contentId != null) {
      f.append(" and bean.content.id=:contentId");
      f.setParam("contentId", contentId);
    } else if (siteId != null) {
      f.append(" and bean.site.id=:siteId");
      f.setParam("siteId", siteId);
    }
    if(toUserId!=null){
      f.append(" and bean.commentUser.id=:commentUserId");
      f.setParam("commentUserId", toUserId);
    }else if(fromUserId!=null){
      f.append(" and bean.content.user.id=:fromUserId");
      f.setParam("fromUserId", fromUserId);
    }
    if (greaterThen != null) {
      f.append(" and bean.ups>=:greatTo");
      f.setParam("greatTo", greaterThen);
    }
    if (checked != null) {
      f.append(" and bean.checked=:checked");
      f.setParam("checked", checked);
    }
    if(recommend!=null){
      if (recommend) {
        f.append(" and bean.recommend=true");
      }
    }
    if (desc) {
      f.append(" order by bean.id desc");
    } else {
      f.append(" order by bean.id asc");
    }
    f.setCacheable(cacheable);
    return f;
  }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.ui.JSPContextFinder$Finder

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.