Package ch.entwine.weblounge.common.repository

Examples of ch.entwine.weblounge.common.repository.ContentRepository.find()


    try {
      result.append("<resources>").append(repository.getResourceCount()).append("</resources>");
      result.append("<revisions>").append(repository.getVersionCount() - repository.getResourceCount()).append("</revisions>");

      q = new SearchQueryImpl(site).withTypes(Page.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<pages>").append(repository.find(q).getDocumentCount()).append("</pages>");
      q = new SearchQueryImpl(site).withTypes(FileResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<files>").append(repository.find(q).getDocumentCount()).append("</files>");
      q = new SearchQueryImpl(site).withTypes(ImageResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<images>").append(repository.find(q).getDocumentCount()).append("</images>");
      q = new SearchQueryImpl(site).withTypes(MovieResource.TYPE).withPreferredVersion(Resource.LIVE);
View Full Code Here


      result.append("<revisions>").append(repository.getVersionCount() - repository.getResourceCount()).append("</revisions>");

      q = new SearchQueryImpl(site).withTypes(Page.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<pages>").append(repository.find(q).getDocumentCount()).append("</pages>");
      q = new SearchQueryImpl(site).withTypes(FileResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<files>").append(repository.find(q).getDocumentCount()).append("</files>");
      q = new SearchQueryImpl(site).withTypes(ImageResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<images>").append(repository.find(q).getDocumentCount()).append("</images>");
      q = new SearchQueryImpl(site).withTypes(MovieResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<movies>").append(repository.find(q).getDocumentCount()).append("</movies>");
    } catch (ContentRepositoryException e) {
View Full Code Here

      q = new SearchQueryImpl(site).withTypes(Page.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<pages>").append(repository.find(q).getDocumentCount()).append("</pages>");
      q = new SearchQueryImpl(site).withTypes(FileResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<files>").append(repository.find(q).getDocumentCount()).append("</files>");
      q = new SearchQueryImpl(site).withTypes(ImageResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<images>").append(repository.find(q).getDocumentCount()).append("</images>");
      q = new SearchQueryImpl(site).withTypes(MovieResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<movies>").append(repository.find(q).getDocumentCount()).append("</movies>");
    } catch (ContentRepositoryException e) {
      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
    }
View Full Code Here

      q = new SearchQueryImpl(site).withTypes(FileResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<files>").append(repository.find(q).getDocumentCount()).append("</files>");
      q = new SearchQueryImpl(site).withTypes(ImageResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<images>").append(repository.find(q).getDocumentCount()).append("</images>");
      q = new SearchQueryImpl(site).withTypes(MovieResource.TYPE).withPreferredVersion(Resource.LIVE);
      result.append("<movies>").append(repository.find(q).getDocumentCount()).append("</movies>");
    } catch (ContentRepositoryException e) {
      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
    }

    result.append("</index>");
View Full Code Here

    q.withProperty("resourceid", resourceId);

    ContentRepository repository = getContentRepository(site, false);
    SearchResult result = null;
    try {
      result = repository.find(q);
    } catch (ContentRepositoryException e) {
      return Response.status(Status.INTERNAL_SERVER_ERROR).build();
    }

    StringBuffer buf = new StringBuffer("<pages>");
View Full Code Here

    if (repository == null)
      throw new WebApplicationException(Status.SERVICE_UNAVAILABLE);

    SearchResult result = null;
    try {
      result = repository.find(q);
    } catch (ContentRepositoryException e) {
      logger.warn(e.getMessage());
      throw new WebApplicationException();
    }
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.