Package org.compass.core

Examples of org.compass.core.CompassSession.beginTransaction()


  }
 
  public void removeItem(Item item) {
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();
    String query = "+itemId:" + item.getItemId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
      DefaultCompassHit defaultCompassHit = (DefaultCompassHit) iterator.next();
View Full Code Here


    if (siteProfileClasses == null) {
      siteProfileClasses = getSiteProfileClasses();
    }
   
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();

    String query = "+itemId:" + master.getItemId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
View Full Code Here

    compassSession.close();
  }
 
  public void removeContent(Content content) {
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();
    String query = "+contentId:" + content.getContentId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
      DefaultCompassHit defaultCompassHit = (DefaultCompassHit) iterator.next();
View Full Code Here

  public void updateContent(Content master, SiteProfileClass siteProfileClasses[]) throws Exception {
    if (siteProfileClasses == null) {
      siteProfileClasses = getSiteProfileClasses();
    }
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();

    String query = "+contentId:" + master.getContentId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
View Full Code Here

        updateIndexerInfo(indexerInfo);
  }
 
  public QueryResult search(String criteria, Long siteProfileClassId, Long siteDomainId, int pageNum, int pageSize) throws Exception {
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();
   
    Calendar calendar = Calendar.getInstance();
    String infoPublishTo = dateFormat.format(calendar.getTime());
    calendar.add(Calendar.DATE, 1);
    String infoExpireFrom = dateFormat.format(calendar.getTime());
View Full Code Here

    }

    public List executeQuery (ObjectContext context, QuerySpecification spec)
    {
        CompassSession session = getCompass(context).openSession();
        CompassTransaction tr = session.beginTransaction();
        CompassQueryBuilder builder = session.queryBuilder();
        CompassQuery query = queryForPredicate(builder, spec.getPredicate());

        Class targetClass = ClassUtil.classForName(spec.getEntityName());
        query.setTypes(targetClass);
View Full Code Here

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.