Examples of existsInAnyVersion()


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

          }

          // Is this a request with potential path clashes?
          if (requestedURI != null) {
            long version = requestedURI.getVersion();
            if (contentRepository.existsInAnyVersion(requestedURI)) {
              if (!isEditing && version == Resource.LIVE && contentRepository.exists(requestedURI)) {
                pageURI = requestedURI;
                ((WebloungeRequestImpl) request).setLanguage(request.getSessionLanguage());
              } else if (isEditing && version == Resource.WORK && !contentRepository.exists(requestedURI)) {
                requestedURI.setVersion(Resource.LIVE);
View Full Code Here

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

              }
            }
          }

          // Does the page exist?
          if (pageURI == null && contentRepository.existsInAnyVersion(requestURI)) {
            long version = requestURI.getVersion();

            // If the work version is requested, we need to make sure
            // a) it exists and b) the user is in editing mode
            if (version == Resource.WORK && isEditing) {
View Full Code Here

Examples of ch.entwine.weblounge.common.repository.WritableContentRepository.existsInAnyVersion()

    pageURI = new PageURIImpl(site, path, uuid, Resource.WORK);

    // Make sure the page doesn't exist
    try {
      if (contentRepository.existsInAnyVersion(new GeneralResourceURIImpl(site, pageURI.getPath()))) {
        logger.warn("Tried to create already existing page {} in site '{}'", pageURI, site);
        throw new WebApplicationException(Status.CONFLICT);
      }
    } catch (IllegalArgumentException e) {
      logger.warn("Tried to create a page with an invalid path '{}': {}", path, e.getMessage());
View Full Code Here

Examples of ch.entwine.weblounge.common.repository.WritableContentRepository.existsInAnyVersion()

    ResourceURI livePageURI = new PageURIImpl(site, null, pageId, Resource.LIVE);
    ResourceURI workPageURI = new PageURIImpl(site, null, pageId, Resource.WORK);

    try {
      if (!contentRepository.existsInAnyVersion(livePageURI)) {
        logger.warn("Tried to delete non existing page {} in site '{}'", livePageURI, site);
        throw new WebApplicationException(Status.NOT_FOUND);
      }
    } catch (ContentRepositoryException e) {
      logger.warn("Page lookup {} failed for site '{}'", livePageURI, site);
View Full Code Here

Examples of ch.entwine.weblounge.common.repository.WritableContentRepository.existsInAnyVersion()

    ResourceURI workURI = new PageURIImpl(site, null, pageId, Resource.WORK);

    // Does the page exist at all?
    Page workPage = null;
    try {
      if (!contentRepository.existsInAnyVersion(workURI))
        throw new WebApplicationException(Status.NOT_FOUND);
    } catch (ContentRepositoryException e) {
      logger.warn("Error looking up page {} from repository: {}", workURI, e.getMessage());
      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
    }
View Full Code Here

Examples of ch.entwine.weblounge.common.repository.WritableContentRepository.existsInAnyVersion()

    ResourceURI workURI = new PageURIImpl(site, null, pageId, Resource.WORK);

    // Does the work page exist?
    Page workPage = null;
    try {
      if (!contentRepository.existsInAnyVersion(workURI))
        throw new WebApplicationException(Status.NOT_FOUND);
      workPage = (Page) contentRepository.get(workURI);
      if (workPage == null)
        throw new WebApplicationException(Status.PRECONDITION_FAILED);
      workURI.setPath(workPage.getURI().getPath());
View Full Code Here

Examples of ch.entwine.weblounge.common.repository.WritableContentRepository.existsInAnyVersion()

    ResourceURI liveURI = new PageURIImpl(site, null, pageId, Resource.LIVE);

    // Does the page exist?
    Page livePage = null;
    try {
      if (!contentRepository.existsInAnyVersion(liveURI))
        throw new WebApplicationException(Status.NOT_FOUND);
      livePage = (Page) contentRepository.get(liveURI);
      if (livePage == null)
        throw new WebApplicationException(Status.PRECONDITION_FAILED);
      liveURI.setPath(livePage.getURI().getPath());
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.