Package ch.entwine.weblounge.common.content

Examples of ch.entwine.weblounge.common.content.ResourceURI


    Site site = getSite(request);
    if (site == null)
      throw new WebApplicationException(Status.NOT_FOUND);

    // Return the editor
    ResourceURI uri = new PageURIImpl(site, null, pageURI, Resource.WORK);
    PageletEditor editor;
    try {
      editor = workbench.getEditor(site, uri, composerId, pagelet, language, environment);
    } catch (IOException e) {
      throw new WebApplicationException(e);
View Full Code Here


   * @throws IllegalStateException
   */
  @Test
  public void testDeleteResourceURIBoolean() throws IllegalStateException,
  ContentRepositoryException, IOException {
    ResourceURI workURI = new PageURIImpl(site, page1path, page1uuid, WORK);
    Page workPage = new PageImpl(workURI);
    workPage.setTemplate(template.getIdentifier());
    int resources = populateRepository();
    int revisions = resources;

View Full Code Here

   */
  @Test
  public void testMoveChildren() throws Exception {
    String root = "/root/";
    String newRoot = "/new-root/";
    ResourceURI rootURI = null;
    String subpath = null;
    int pages = 10;

    // Add 10 sub pages
    for (int i = 0; i < pages; i++) {
      String id = UUID.randomUUID().toString();
      ResourceURI uri = null;
      if (subpath != null) {
        subpath = PathUtils.concat(subpath, id);
        uri = new PageURIImpl(site, subpath, id);
      } else {
        subpath = root;
View Full Code Here

    assertEquals(pngFileSize, c.getSize());
    assertEquals(mimetype, c.getMimetype());

    // Try to add content items to non-existing resources
    try {
      ResourceURI uri = new ImageResourceURIImpl(site, "/x/y/z");
      repository.putContent(uri, jpegContent, jpegContentURL.openStream());
      fail("Managed to add content to non-existing resource");
    } catch (Throwable t) {
      // Expected
    }
View Full Code Here

   * @throws IllegalStateException
   */
  @Test
  public void testGetVersions() throws ContentRepositoryException,
  IllegalStateException, IOException {
    ResourceURI live1URI = new PageURIImpl(site, "/weblounge");
    ResourceURI live2URI = new PageURIImpl(site, "/etc/weblounge");
    ResourceURI work2URI = new PageURIImpl(site, "/etc/weblounge", WORK);

    Page page1Live = new PageImpl(live1URI);
    Page page2Live = new PageImpl(live2URI);
    Page page2Work = new PageImpl(work2URI);

View Full Code Here

   * @throws IllegalStateException
   */
  @Test
  public void testWithoutPublication() throws IllegalStateException,
  ContentRepositoryException, IOException {
    ResourceURI workURI = new PageURIImpl(site, "/etc/weblounge", WORK);
    Page work = new PageImpl(workURI);
    work.setTemplate(template.getIdentifier());

    repository.put(work);

View Full Code Here

  public void testGetRevisionCount() throws ContentRepositoryException,
  IOException {
    int count = populateRepository();
    assertEquals(count, repository.getVersionCount() - 1);

    ResourceURI page1WorkURI = new PageURIImpl(page1URI, WORK);
    Page page2Work = new PageImpl(page1WorkURI);
    page2Work.setTemplate(template.getIdentifier());

    repository.put(page2Work);
    assertEquals(count + 1, repository.getVersionCount() - 1);
View Full Code Here

   */
  @Test
  public void testLock() throws Exception {

    // Create pages and uris
    ResourceURI uriLive = new PageURIImpl(site, "/etc/weblounge");
    Page pageLive = new PageImpl(uriLive);
    pageLive.setTemplate(template.getIdentifier());
    ResourceURI uriWork = new PageURIImpl(site, "/etc/weblounge", WORK);
    Page pageWork = new PageImpl(uriWork);
    pageWork.setTemplate(template.getIdentifier());

    // Add the pages to the index
    repository.put(pageLive);
View Full Code Here

   */
  @Test
  public void testUnlock() throws Exception {

    // Create pages and uris
    ResourceURI uriLive = new PageURIImpl(site, "/etc/weblounge");
    Page pageLive = new PageImpl(uriLive);
    pageLive.setTemplate(template.getIdentifier());
    ResourceURI uriWork = new PageURIImpl(site, "/etc/weblounge", WORK);
    Page pageWork = new PageImpl(uriWork);
    pageWork.setTemplate(template.getIdentifier());

    // Add the pages to the index
    repository.put(pageLive);
View Full Code Here

   *           if the target page cannot be loaded
   */
  protected Page getTargetPage(Action action, WebloungeRequest request)
      throws ContentRepositoryException {

    ResourceURI target = null;
    Page page = null;
    Site site = request.getSite();
    boolean targetForced = false;

    // Check if a target-page parameter was passed
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.content.ResourceURI

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.