Package com4j.tlbimp

Examples of com4j.tlbimp.TypeLibInfo$Version


    WGADeployment existingDefaultDeployment = getDeployment(DEFAULT_DEPLOYMENT_NAME);
    if (existingDefaultDeployment != null) {
      InputStream propIn = null;
      try {
        propIn = propFile.getURL().openStream();
        Version newDefaultDeploymentVersion = WGADeployment.determineWGAVersion(propIn);
        Version existingDefaultDeploymentVersion = existingDefaultDeployment.getWGAVersion();
        if (!newDefaultDeploymentVersion.equals(existingDefaultDeploymentVersion)) {
          // we have to update the default deployment
          createDeployment(DEFAULT_DEPLOYMENT_NAME, defaultWGAWar, monitor, true);
        }
      } finally {
View Full Code Here


    InputStream propIn = null;
    try {
      FileSystemManager fsManager = VFS.getManager();
      FileObject propFile = fsManager.resolveFile( "zip:" + wgaWar.toURI() + "!/WEB-INF/wgabuild.properties");
      propIn = propFile.getURL().openStream();
      Version version = WGADeployment.determineWGAVersion(propIn);
      if (version != null) {
        if (version.isAtLeast(Activator.SUPPORTED_WGA_VERSION_MIN.getMajor(),  Activator.SUPPORTED_WGA_VERSION_MIN.getMinor())) {
          if (version.getMajorVersion() < Activator.SUPPORTED_WGA_VERSION_MAX.getMajor()) {
            return true;
          } else if (version.getMajorVersion() == Activator.SUPPORTED_WGA_VERSION_MAX.getMajor()) {
            return version.getMinorVersion() <= Activator.SUPPORTED_WGA_VERSION_MAX.getMinor();
          } else {
            return false;
          }
        } else {
          return false;
View Full Code Here

  }


  public String getWGAVersionString() {
    String wgaVersion = "n.a.";
    Version version = getWGAVersion();
    if (version != null) {
      wgaVersion = version.getMainVersionString();
    }
    return wgaVersion;
  }
View Full Code Here

    return null;
  }
 
 
  public static String determineWGAVersion(InputStream wgabuildProperties, String delimiter, boolean includeMinorVersion, boolean includeMaintenanceVersion) throws IOException {
    Version versionObj = determineWGAVersion(wgabuildProperties);     
    StringBuffer version = new StringBuffer();
    version.append(versionObj.getMajorVersion());
    if (includeMinorVersion) {
      version.append(delimiter);
      version.append(versionObj.getMinorVersion());
    }
    if (includeMaintenanceVersion) {
      version.append(delimiter);
      version.append(versionObj.getMaintenanceVersion());
    }
    return version.toString();
  }
View Full Code Here

  }
 
  public static Version determineWGAVersion(InputStream wgabuildProperties) throws IOException {
    Properties props = new Properties();
    props.load(wgabuildProperties);
    Version version = new Version();
    if (props.getProperty("majorVersion") != null) {
      version.setMajorVersion(Integer.parseInt(props.getProperty("majorVersion")));
    }
    if (props.getProperty("minorVersion") != null) {
      version.setMinorVersion(Integer.parseInt(props.getProperty("minorVersion")));
    }
    if (props.getProperty("maintenanceVersion") != null) {
      version.setMaintenanceVersion(Integer.parseInt(props.getProperty("maintenanceVersion")));
    }
    if (props.getProperty("patchVersion") != null) {
      version.setPatchVersion(Integer.parseInt(props.getProperty("patchVersion")));
    }
    if (props.getProperty("buildVersion") != null) {
      version.setBuildVersion(Integer.parseInt(props.getProperty("buildVersion")));
    }
    return version;
  }
View Full Code Here

 
  public Version determineWGAVersion() throws IOException, ClassNotFoundException, IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
    File classesDir = new File(getDeployDir(), "WEB-INF/classes");
    URLClassLoader loader = new URLClassLoader(new URL[] {classesDir.toURL()}, this.getClass().getClassLoader());
    Class wgaVersionClass = loader.loadClass("de.innovationgate.wgpublisher.WGAVersion");
    Version version = new Version();
    version.setMajorVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MAJOR_VERSION").getInt(null));
    version.setMinorVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MINOR_VERSION").getInt(null));
    version.setMaintenanceVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MAINTENANCE_VERSION").getInt(null));
    version.setPatchVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_PATCH_VERSION").getInt(null));
    version.setBuildVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_BUILD_VERSION").getInt(null));
   
    return version;
  }
View Full Code Here

   
    private String determineRootPortletNamespace(String dbKey) throws WGAPIException {
       
        UserProfileItem wgaCreationVersion = (UserProfileItem) _profile.getItems().get(WGUserProfile.ITEM_WGACREATIONVERSION);
        if (wgaCreationVersion != null) {
            Version version = new Version(wgaCreationVersion.getText());
           
            // From WGA Version 4.1 on the root portlet has a defined namespace, based on the dbkey of the main context, plus index number 000.
            if (version.isAtLeast(4, 1)) {
                String nsPrefix = buildNamespacePrefix(dbKey);
                return nsPrefix + "000";
            }
        }
       
View Full Code Here

    public static final String WGAPUBLISHER_PRODUCT_NAME = "OpenWGA Server";
    public static final String WGAPUBLISHER_PLATFORM_NAME = "Dragon";
   
    public static Version toCsConfigVersion() {
       
        Version version =
            new Version(WGAPUBLISHER_MAJOR_VERSION,
                    WGAPUBLISHER_MINOR_VERSION,
                    WGAPUBLISHER_MAINTENANCE_VERSION,
                    WGAPUBLISHER_PATCH_VERSION,
                    WGAPUBLISHER_BUILD_VERSION);
        return version;
View Full Code Here

                catch (InvalidPluginException e) {
                    plugin.addInstallationFault(plugin.new InitialisationFault(e.getMessage()));
                }
               
                // WGA Version
                Version wgaVersion = WGAVersion.toCsConfigVersion();
                int comp = wgaVersion.compareTo(plugin.getCsConfig().getPluginConfig().getMinimumWGAVersion());
                if (comp < 0) {
                    plugin.addInstallationFault(plugin.new InstallationFault(WGAPlugin.InstallationFault.ERROR_WRONG_WGA_VERSION));
                }
               
                // Java Version
                Version javaVersion = Version.getJavaVersion();
                comp = javaVersion.compareTo(plugin.getCsConfig().getPluginConfig().getMinimumJavaVersion());
                if (comp < 0) {
                    plugin.addInstallationFault(plugin.new InstallationFault(WGAPlugin.InstallationFault.ERROR_WRONG_JAVA_VERSION));
                }
               
                // Dependencies
View Full Code Here

            String dbKey = plugin.buildDatabaseKey();
            WGDatabase db = contentdbs.get(dbKey);
            if (db != null) {
                try {
                    Long pluginFileTime = (Long) db.getAttribute(DBATTRIB_PLUGIN_FILETIME);
                    Version pluginVersion = (Version) db.getAttribute(DBATTRIB_PLUGIN_VERSION);
                    if (pluginVersion.equals(plugin.getPluginID().getVersion()) &&
                        (pluginFileTime != null && pluginFileTime.equals(new Long(plugin.getFileLastModified())))) {
                        if (!db.isSessionOpen()) {
                            db.openSession();
                        }
                        return db;
View Full Code Here

TOP

Related Classes of com4j.tlbimp.TypeLibInfo$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.