Package com.projity.server.data

Examples of com.projity.server.data.EnterpriseResourceData


      com.projity.pm.resource.Resource projityResource=null;
      int projityResourceCount=0;
      ResourcePool resourcePool = project.getResourcePool();
      project.setTemporaryLocal(true);
      Object srcResource;
      EnterpriseResourceData data;
      Map enterpriseResourceDataMap=new HashMap();
      for (Iterator i=form.getResources().iterator();i.hasNext();){
        data=(EnterpriseResourceData)i.next();
        if (data.isLocal()) {
          projityResource=ResourceImpl.getUnassignedInstance();
        } else {
//          try {
            projityResource=Serializer.deserializeResourceAndAddToPool(data,resourcePool,null);
View Full Code Here


      List<ResourceData> resources=new ArrayList<ResourceData>();
      Map<Long,ResourceData> resourceMap=new HashMap<Long,ResourceData>();

      Iterator r = form.getResources().iterator();
      while(r.hasNext()){
        EnterpriseResourceData enterpriseResource=(EnterpriseResourceData)r.next();
        if (enterpriseResource.getUniqueId()!=EnterpriseResource.UNASSIGNED_ID){
          ResourceData resource=new ResourceData();
          resource.setEnterpriseResource(enterpriseResource);
          resourceMap.put(enterpriseResource.getUniqueId(), resource);
          resources.add(resource);
        }
      }
      projectData.setResources(resources);


      Map<Long,ResourceData> idMap=new HashMap<Long,ResourceData>();
      Iterator ir = form.getImportedResources().iterator();
      Iterator sr = form.getSelectedResources().iterator();
      while(ir.hasNext()){
        EnterpriseResourceData enterpriseSrc=(EnterpriseResourceData)ir.next();
        EnterpriseResourceData enterpriseDest=(EnterpriseResourceData)sr.next();
        if (enterpriseDest.getUniqueId()!=EnterpriseResource.UNASSIGNED_ID){
          ResourceData resource=new ResourceData();
          resource.setEnterpriseResource(enterpriseDest);
          idMap.put(enterpriseSrc.getUniqueId(),resourceMap.get(enterpriseDest.getUniqueId()));
        }
      }


      //remove assignments that have lost resources
View Full Code Here

        Vector projityResources=new Vector();
        //map the existint project resourse impls for later use
        _localResourceMap = new HashMap<Long, com.projity.pm.resource.Resource>();

    EnterpriseResourceData unassigned=new EnterpriseResourceData();
    unassigned.setUniqueId(EnterpriseResource.UNASSIGNED_ID);
    unassigned.setName(Messages.getString("Text.Unassigned")); //$NON-NLS-1$
    form.setUnassignedResource(unassigned);
    projityResources.add(unassigned);

    Serializer serializer=new Serializer();

    ProjectData projectData=(ProjectData)serializer.serialize(existingProject,ProjectData.FACTORY,null);
        if (existingProject.isForceNonIncremental()) projectData.setVersion(0);
        projectData.setMaster(existingProject.isMaster());

        //resources
        Map resourceMap=serializer.saveResources(existingProject,projectData);
        List<com.projity.pm.resource.Resource> existingResources=(List<com.projity.pm.resource.Resource>)existingProject.getResourcePool().getResourceList();
        for (com.projity.pm.resource.Resource resource:existingResources){
          if (resource==null) continue;
          ResourceData r=(ResourceData)resourceMap.get(resource.getUniqueId());
          if (r!=null){
            EnterpriseResourceData er=r.getEnterpriseResource();
            er.setName(resource.getName());
            projityResources.add(er);
            _localResourceMap.put((Long)r.getUniqueId(), resource);
          }
        }
View Full Code Here

    if (form==null) return;

   
    //server resources
    Vector projityResources=new Vector();
    EnterpriseResourceData unassigned=new EnterpriseResourceData();
    unassigned.setUniqueId(EnterpriseResource.UNASSIGNED_ID);
    unassigned.setName(Messages.getString("Text.Unassigned")); //$NON-NLS-1$
    form.setUnassignedResource(unassigned);
    projityResources.add(unassigned);
    try{
      Session session=SessionFactory.getInstance().getSession(false);
      projityResources.addAll((Collection)SessionFactory.call(session,resourceDescriptorsOnly?"retrieveResourceDescriptors":"retrieveResourceHierarchy",null,null));
View Full Code Here

TOP

Related Classes of com.projity.server.data.EnterpriseResourceData

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.