Package fr.norsys.mapper.console.model

Examples of fr.norsys.mapper.console.model.Application


    String currentResource = resource.getId();
    resources.add(resource);
    Resource resource2 = new Resource("test2");
    String currentResource2 = resource2.getId();
    resources.add(resource2);
    Application application = new Application("test");
    application.setResources(resources);
    Resource resource3 = new Resource("test3");
    String currentResource3 = resource.getId();
    resources2.add(resource3);
    Resource resource4 = new Resource("test4");
    String currentResource4 = resource2.getId();
    resources2.add( resource4);
    Application application2 = new Application("test2");
    application2.setResources(resources2);
    applications.add(application);
    applications.add(application2);
    applicationService.deleteRes(currentResource,application);
    assertNull("must be null object",resourceService.get(resource.getId(),application));
  }
View Full Code Here


        appliMenu.setTitle("Applications");
        appliMenu.setLocation("javascript:saveBeforeLoad('"+isAppliModified+"','"+currentAppli+"','application.do?method=init')");
    repository.addMenu(appliMenu);
    for(Iterator it=applications.iterator();it.hasNext();) {
          MenuComponent mc = new MenuComponent();
          Application application = (Application) it.next();
          String name = application.getName();
          mc.setName(name);
          mc.setTitle(name);
          mc.setLocation("javascript:saveBeforeLoad('"+isAppliModified+"','"+currentAppli+"','application.do?method=loadAppli&id="+URLEncoderUtil.escape(application.getId())+"')");
          mc.setParent(appliMenu);
    }
    return repository;
  }
View Full Code Here

          appliMenu.setTitle("Applications");
          appliMenu.setLocation("javascript:saveConBeforeLoad('"+isConModified+"','"+con+"','application.do?method=init')");
      repository.addMenu(appliMenu);
      for(Iterator it=applications.iterator();it.hasNext();) {
            MenuComponent mc = new MenuComponent();
            Application application = (Application) it.next();
            String name = application.getName();
            mc.setName(name);
            mc.setTitle(name);
            mc.setLocation("javascript:saveConBeforeLoad('"+isConModified+"','"+con+"','application.do?method=loadAppli&id="+URLEncoderUtil.escape(application.getId())+"')");
            mc.setParent(appliMenu);
      }
      return repository;
    }
View Full Code Here

    List applications = new ArrayList();
    Collection resources =new  TreeSet(new ResourceNameComparator());
    Resource resource = new Resource("test");
    String currentResource = resource.getId();
    resources.add(resource);
    Application application = new Application("test");
    application.setResources(resources);
    applications.add(application);
    Resource r=resourceService.get(currentResource,application);
    String name = r.getName();
    assertTrue("must be same object",name.equals(resource.getName()));
  }
View Full Code Here

    String currentResource = resource.getId();
    resources.add(resource);
    Resource resource2 = new Resource("test2");
    String currentResource2 = resource2.getId();
    resources.add(resource2);
    Application application = new Application("test");
    application.setResources(resources);
    applications.add(application);
    Resource r=resourceService.get(currentResource,application);
    String name = r.getName();
    assertTrue("must be same object",name.equals(resource.getName()));
    assertEquals("name must be equals to test","test",r.getName());
View Full Code Here

    String currentResource = resource.getId();
    resources.add(resource);
    Resource resource2 = new Resource("test2");
    String currentResource2 = resource2.getId();
    resources.add(resource2);
    Application application = new Application("test");
    application.setResources(resources);
    Resource resource3 = new Resource("test3");
    String currentResource3 = resource.getId();
    resources2.add(resource3);
    Resource resource4 = new Resource("test4");
    String currentResource4 = resource2.getId();
    resources2.add(resource4);
    Application application2 = new Application("test2");
    application2.setResources(resources2);
    applications.add(application);
    applications.add(application2);
    Resource r=resourceService.get(currentResource2,application);
    assertTrue("must be same object",r.equals(resource2));
    assertEquals("name must be equals to test2","test2",r.getName());
View Full Code Here

  }
 
  public void test01Add() throws Exception {
    if(log.isDebugEnabled()) log.debug("*** test01Add ***");
    List applications = new ArrayList();
    Application application = new Application("test");
    applications.add(application);
    Resource r = new Resource();
    r.setName("resource");
    Application a = applicationService.get(application.getId(), applications);
    resourceService.save(r,a);
   
    assertTrue("size must be superior to 0",application.getResources().size() > 0);
    assertTrue("size must be superior to 0",applicationService.get(a.getId(),applications).getResources().size() > 0);
  }
View Full Code Here

    Collection attributes =new  TreeSet(new AttributeNameComparator());
    Attribute attribute = new Attribute("test");
    attributes.add(attribute);
    resource2.setAttributes(attributes);
    resources.add(resource2);
    Application application = new Application("test");
    application.setResources(resources);
   
    Resource resource3 = new Resource("test3");
    String currentResource3 = resource.getId();
    resources2.add(resource3);
    Resource resource4 = new Resource("test4");
    String currentResource4 = resource2.getId();
    resources2.add(resource4);
    Application application2 = new Application("test2");
    application2.setResources(resources2);
    applications.add(application);
    applications.add(application2);

    resource2.setBaseDn("BaseDn");
    Application a = applicationService.get(application.getId(), applications);
    resourceService.save(resource2,a);
     
    assertEquals("BaseDn must be equals to BaseDn","BaseDn",resourceService.get(resource2.getId(),a).getBaseDn());
    assertFalse("Attributes must not be null",resourceService.get(resource2.getId(),a).getAttributes().size()==0);
 
View Full Code Here

   * @param applications :
   *            Collection of application beans
   */
  private void add(Application application, Collection applications)
      throws ApplicationException {
    Application a = null;
    try {
      a = (Application) BeanUtils.cloneBean(application);
    } catch (Exception e) {
      throw new ApplicationException(
          "Impossible to clone application bean:" + application
              + "=> " + e);
    }
    a.setId(UIDGenerator.generateId());
    applications.add(a);
    try {
      fileService.createNewFile(a.getName() + xmlFileExt, appliDirPath);
    } catch (FileException e1) {
      throw new ApplicationException(e1.toString());
    }
    try {
      mappingService.saveMapping(a, appliDirPath + a.getName()
          + xmlFileExt);
    } catch (MappingException e) {
      throw new ApplicationException(e.toString());
    }
  }
View Full Code Here

    Collection attributes = new TreeSet(new AttributeNameComparator());
    Attribute attribute = new Attribute("test");
    String currentAttribute = attribute.getId();
    Resource resource = new Resource("test");
    String currentResource = resource.getId();
    Application application = new Application("test");
    attributes.add(attribute);
    resource.setAttributes(attributes);
    resources.add(resource);
    application.setResources(resources);
    applications.add(application);
    if(log.isDebugEnabled()) log.debug("applications :"+applications);
    if(log.isDebugEnabled()) log.debug("application :"+application);
   
    Application appli = applicationService.get(application.getId(),applications);
    Resource res = resourceService.get(currentResource, appli);
    resourceService.deleteAttr(currentAttribute,res);
    if(log.isDebugEnabled()) log.debug("application :"+application);
   
    assertNull("must be null object",attributeService.get(currentAttribute,resource));
View Full Code Here

TOP

Related Classes of fr.norsys.mapper.console.model.Application

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.