Package org.vosao.entity

Examples of org.vosao.entity.FolderEntity


* @author Alexander Oleynik
*/
public class FolderPermissionBusinessTest extends AbstractBusinessTest {

  private FolderEntity addFolder(String title, FolderEntity parent) {
    FolderEntity folder = new FolderEntity(title,
        parent != null ? parent.getId() : null);
    getDao().getFolderDao().save(folder);
    return folder;
  }
View Full Code Here


    GroupEntity developers = addGroup("developers");
    addUserGroup(developer, developers);
    addUserGroup(manager, managers);
    addUserGroup(dev2, developers);
    addUserGroup(dev2, managers);
    FolderEntity home = addFolder("home", null);
    FolderEntity about = addFolder("about", home);
    FolderEntity company = addFolder("company", about);
    FolderEntity team = addFolder("team", about);
    FolderEntity services = addFolder("services", home);
    FolderEntity php = addFolder("php", services);
    addPermission(home, guests, FolderPermissionType.READ);
    addPermission(about, guests, FolderPermissionType.DENIED);
    addPermission(about, developers, FolderPermissionType.READ);
    addPermission(team, developers, FolderPermissionType.WRITE);
    FolderPermissionEntity p = getBusiness().getFolderPermissionBusiness()
View Full Code Here

          if (structure != null) {
            result.setStructureFields(structure.getFields());
          }
        }
        result.setDependencies(getDependencies(page.getFriendlyURL()));
        FolderEntity folder = getBusiness().getPageBusiness()
            .getPageFolder(page.getFriendlyURL());
        result.setFolderId(folder != null ? folder.getId() : null);
      }
      else {
        result.setPage(getPageBusiness().getPageDefaultSettings(
            parentUrl));
        result.getPage().setId(null);
View Full Code Here

    getSiteExporter().exportSite(out);
  }

  private void exportRootFolder(ZipOutStreamTaskAdapter out)
      throws IOException, TaskTimeoutException {
    FolderEntity root = getDao().getFolderDao().getByPath("/");
    if (root == null) {
      logger.error("Folder not found: /");
    } else {
      getResourceExporter().addFolder(out, root, "");
    }
View Full Code Here

import org.vosao.enums.UserRole;

public class FolderBusinessTest extends AbstractBusinessTest {

  private FolderEntity addFolder(final String name, final Long parent) {
    FolderEntity Folder = new FolderEntity(name, parent);
    getDao().getFolderDao().save(Folder);
    return Folder;
  }
View Full Code Here

   *       
   *        /photos
   *        /test
   */
  public void testFindFolderByPath() {
    FolderEntity root = addFolder("/", null);
    addGuestPerission(root);
    FolderEntity images = addFolder("images", root.getId());
    FolderEntity logos = addFolder("logos", images.getId());
    FolderEntity photos = addFolder("photos", images.getId());
    FolderEntity test = addFolder("test", images.getId());
    FolderEntity vosao = addFolder("vosao", logos.getId());
    TreeItemDecorator<FolderEntity> treeRoot = getBusiness().getFolderBusiness()
        .getTree();
   
    TreeItemDecorator<FolderEntity> result = getBusiness().getFolderBusiness()
        .findFolderByPath(treeRoot, "/images");
    assertNotNull(result);
    assertEquals(images.getId(), result.getEntity().getId());
   
    result = getBusiness().getFolderBusiness().findFolderByPath(treeRoot,
        "/images/logos");
    assertNotNull(result);
    assertEquals(logos.getId(), result.getEntity().getId());
   
    result = getBusiness().getFolderBusiness().findFolderByPath(treeRoot,
        "/images/photos");
    assertNotNull(result);
    assertEquals(photos.getId(), result.getEntity().getId());

    result = getBusiness().getFolderBusiness().findFolderByPath(treeRoot,
        "/images/test");
    assertNotNull(result);
    assertEquals(test.getId(), result.getEntity().getId());

    result = getBusiness().getFolderBusiness().findFolderByPath(treeRoot,
      "/images/logos/vosao");
    assertNotNull(result);
    assertEquals(vosao.getId(), result.getEntity().getId());

    result = getBusiness().getFolderBusiness().findFolderByPath(treeRoot,
      "/images/logos/vosao1");
    assertNull(result);
 
View Full Code Here

      "/images/logos/vosao1");
    assertNull(result);
 

  public void testCreateFolder() throws UnsupportedEncodingException {
    FolderEntity root = addFolder("/", null);
    addGuestPerission(root);
    getBusiness().getFolderBusiness().createFolder("/one/two/free/four");
    TreeItemDecorator<FolderEntity> treeRoot = getBusiness()
      .getFolderBusiness().getTree();
    TreeItemDecorator<FolderEntity> folder = getBusiness()
View Full Code Here

   *       
   *        /photos
   *        /test
   */
  public void testGetFolderPath() {
    FolderEntity root = addFolder("/", null);
    addGuestPerission(root);
    FolderEntity images = addFolder("images", root.getId());
    FolderEntity logos = addFolder("logos", images.getId());
    FolderEntity photos = addFolder("photos", images.getId());
    FolderEntity test = addFolder("test", images.getId());
    FolderEntity vosao = addFolder("vosao", logos.getId());
    assertEquals("/images", getBusiness().getFolderBusiness()
        .getFolderPath(images));
    assertEquals("/images/logos", getBusiness().getFolderBusiness()
        .getFolderPath(logos));
    assertEquals("/images/logos/vosao", getBusiness().getFolderBusiness()
View Full Code Here

           
            getImportExportBusiness().createTemplateExportFile(
                zipOutStreamTaskAdapter, templates, structures);
          }
          if (msg.getExportType().equals(TYPE_PARAM_FOLDER)) {
            FolderEntity folder = getDao().getFolderDao().getById(
                msg.getFolderId());
            getImportExportBusiness().createExportFile(
                zipOutStreamTaskAdapter, folder);
          }
          if (msg.getExportType().equals(TYPE_PARAM_SITE)) {
View Full Code Here

    return getBusiness().getFolderBusiness().getTree();
  }

  @Override
  public String getFolderPath(final Long folderId) {
    FolderEntity folder = getDao().getFolderDao().getById(folderId);
    if (folder != null) {
      return getBusiness().getFolderBusiness().getFolderPath(folder);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.vosao.entity.FolderEntity

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.