Package org.jdesktop.wonderland.common.modules

Examples of org.jdesktop.wonderland.common.modules.ModuleInfo$Version


  }
 
  public static Version toWGAVersion(VersionCompliance versionCompliance) {
    if (versionCompliance != null) {
      if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA3)) {
        return new Version(3, 0, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA4)) {
        return new Version(4, 0, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA41)) {
        return new Version(4, 1, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA50)) {
        return new Version(5, 0 ,0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA51)) {
                return new Version(5, 1 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA52)) {
                return new Version(5, 2 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA53)) {
                return new Version(5, 3 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA54)) {
                return new Version(5, 4 ,0);
            }
    }
    return null;
  }
View Full Code Here


        bean.setUniqueName(sValue)
        update(bean);
        break;
      case 1:
        try {       
          bean.setVersion(new Version((String)value));
          update(bean);
        } catch (RuntimeException e) {
          // unparsable version
            throw new IllegalArgumentException("Unparseable plugin version");
        }
View Full Code Here

        mf.write(jos);
    }
   
    public static void main(String[] args) throws IOException, JAXBException {
        ModuleJarWriter mjw = new ModuleJarWriter();
        ModuleInfo info = new ModuleInfo("Fubar", 1, 0, 0, "Fubar module");
        mjw.setModuleInfo(info);
        mjw.addArtFile("models/castle.tiff", new File("/Users/jordanslott/Desktop/yuval.tiff"));
        mjw.addArtFile("models/castle/mystuff.tiff", new File("/Users/jordanslott/Desktop/yuval.tiff"));
        mjw.writeToJar(new File("mymodule.jar"));
    }
View Full Code Here

    public CachedModule getModule(String moduleName) {
        // Look for the cached module. If we can't find it, see if it exists
        // on the server nevertheless.
        CachedModule cm = this.cachedModules.get(moduleName);
        if (cm == null) {
            ModuleInfo info = ModuleUtils.fetchModuleInfo(this.serverURL, moduleName);
            if (info == null) {
                logger.info("[MODULES] No module information found for " + moduleName);
                return null;
            }
            cm = new CachedModule(serverURL, info);
View Full Code Here

        this.setFile(root);
       
        /*
         * Fetch the module info, this is pretty bad if module.xml doesn't exist
         */
        ModuleInfo info = this.fetchModuleInfo();
        if (info == null) {
            info = new ModuleInfo();
        }
        this.setInfo(info);
       
        /*
         * Fetch the module dependencies, this isn't terrible if it doesn't exist
View Full Code Here

        // TODO calculate checksums?       
        super.execute();
    }
   
    private void writeModuleInfo() throws IOException, JAXBException {
        ModuleInfo mi = new ModuleInfo(name, majorVersion, minorVersion,
                miniVersion, moduleDescription);
       
        File moduleInfoFile;
        if (buildDir == null) {
            moduleInfoFile = File.createTempFile("moduleInfo", "xml");
            moduleInfoFile.deleteOnExit();
        } else {
            moduleInfoFile = new File(buildDir, "moduleInfo.xml");
        }
       
        if (overwrite || !compareModuleInfo(mi, moduleInfoFile)) {
            log("Rewriting moduleInfo file", Project.MSG_VERBOSE);
            FileWriter writer = new FileWriter(moduleInfoFile);
            mi.encode(writer);
            writer.close();
        }
       
        ZipFileSet zfs = new ZipFileSet();
        zfs.setFile(moduleInfoFile);
View Full Code Here

        }

        FileReader reader = null;
        try {
            reader = new FileReader(oldMIFile);
            ModuleInfo oldMI = ModuleInfo.decode(reader);
           
            log("New desc:|" + newMI.getDescription() + "|Old desc:|" + oldMI.getDescription() + "|", Project.MSG_VERBOSE);
           
            // ModuleInfo.equals() doesn't check the description field,
            // but we want to re-write the file if the description has
            // changed.
            boolean descChanged = (newMI.getDescription() == null) ?
                (oldMI.getDescription() != null) :
                (!newMI.getDescription().equals(oldMI.getDescription()));
           
            log("ModuleInfo: descChanged: " + descChanged + " " +
                "equals: " + newMI.equals(oldMI), Project.MSG_VERBOSE);
           
            return (!descChanged && newMI.equals(oldMI));
View Full Code Here

    }
   
    private void writeRequires() throws IOException, JAXBException {
        Set<ModuleInfo> mis = new HashSet<ModuleInfo>();
        for (Requires r : requires) {
            mis.add(new ModuleInfo(r.name, r.majorVersion, r.minorVersion,
                    r.miniVersion));
        }
       
        ModuleRequires mr = new ModuleRequires(mis.toArray(new ModuleInfo[0]));
       
View Full Code Here

                    if (f.isDirectory()) {
                        mjw.addDirectory(f);
                    }
                }
            }
            ModuleInfo mi =
                    new ModuleInfo(moduleName, 1, 0, 0, descriptionTF.getText());
            mjw.setModuleInfo(mi);
            try {
                if (targetDir == null) {
                    targetDir = tmpDir.getParentFile();
                }
View Full Code Here

                continue;
            }
           
            /* See if we want to set attributes on the module and add if so */
            if (attributes != null) {
                ModuleInfo info = module.getInfo();
                info.putAttibutes(attributes);
                File infoFile = module.getFile(Module.MODULE_INFO);
                try {
                    FileWriter writer = new FileWriter(infoFile);
                    info.encode(writer);
                    writer.close();
                } catch (Exception ex) {
                    logger.log(Level.WARNING, "[MODULES] INSTALL Failed to update module.xml", ex);
                }
            }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.modules.ModuleInfo$Version

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.