Package ch.entwine.weblounge.common.impl.content

Examples of ch.entwine.weblounge.common.impl.content.SearchQueryImpl.withVersion()


    Site site = getSite(request);
    SearchQuery q = new SearchQueryImpl(site);

    q.withTypes(Page.TYPE);
    if (version != -1)
      q.withVersion(version);

    if (preferredVersion != -1)
      q.withPreferredVersion(preferredVersion);

    // Path
View Full Code Here


    // Filter query
    if (StringUtils.isNotBlank(filter)) {
      if ("/".equals(filter)) {
        q.withPath("/");
      } else if (filter.contains("state:work")) {
        q.withVersion(Resource.WORK);
        q.withPreferredVersion(-1);
      } else if (filter.contains("state:live")) {
        q.withVersion(Resource.LIVE);
        q.withPreferredVersion(-1);
      } else if (filter.contains("state:locked")) {
View Full Code Here

        q.withPath("/");
      } else if (filter.contains("state:work")) {
        q.withVersion(Resource.WORK);
        q.withPreferredVersion(-1);
      } else if (filter.contains("state:live")) {
        q.withVersion(Resource.LIVE);
        q.withPreferredVersion(-1);
      } else if (filter.contains("state:locked")) {
        q.withLockOwner();
      }
View Full Code Here

    }

    // Make sure the resource is not being referenced elsewhere
    if (allRevisions || uri.getVersion() == Resource.LIVE) {
      SearchQuery searchByResource = new SearchQueryImpl(uri.getSite());
      searchByResource.withVersion(Resource.LIVE);
      searchByResource.withProperty("resourceid", uri.getIdentifier());
      if (searchIndex.getByQuery(searchByResource).getDocumentCount() > 0) {
        logger.debug("Resource '{}' is still being referenced", uri);
        throw new ReferentialIntegrityException(uri.getIdentifier());
      }
View Full Code Here

      @QueryParam("offset") @DefaultValue("0") int offset) {

    // Create search query
    Site site = getSite(request);
    SearchQuery q = new SearchQueryImpl(site);
    q.withVersion(Resource.LIVE);

    // Type
    q.withoutTypes(Page.TYPE);
    if (StringUtils.isNotBlank(type))
      q.withTypes(type);
View Full Code Here

      @QueryParam("offset") @DefaultValue("0") int offset) {

    // Create search query
    Site site = getSite(request);
    SearchQuery q = new SearchQueryImpl(site);
    q.withVersion(Resource.LIVE);

    // Only take resources that have not been modified
    q.withoutModification();

    // Type
View Full Code Here

    if (resourceId == null)
      return Response.status(Status.BAD_REQUEST).build();

    Site site = getSite(request);
    SearchQuery q = new SearchQueryImpl(site);
    q.withVersion(Resource.LIVE);
    q.withTypes(Page.TYPE);
    q.withProperty("resourceid", resourceId);

    ContentRepository repository = getContentRepository(site, false);
    SearchResult result = null;
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.