diff options
author | Duncan Foster <dfoster@openoffice.org> | 2003-05-29 13:20:24 +0000 |
---|---|---|
committer | Duncan Foster <dfoster@openoffice.org> | 2003-05-29 13:20:24 +0000 |
commit | 9e95c73731846d05fa69a1a56e8fa8fb2fa7e446 (patch) | |
tree | 08c5dcb099dcd3fbadf55ba9e0f538816bb23d90 /scripting/workben | |
parent | 2f9518f5d08e809d4829e4e785d585a38cb17331 (diff) |
Added support for regsitry schema. Revised version number to 0.3
Diffstat (limited to 'scripting/workben')
-rw-r--r-- | scripting/workben/installer/Scripting.BeanShell.xcu | 10 | ||||
-rw-r--r-- | scripting/workben/installer/Scripting.xcs | 87 | ||||
-rw-r--r-- | scripting/workben/installer/Welcome.java | 312 | ||||
-rw-r--r-- | scripting/workben/installer/XmlUpdater.java | 8 |
4 files changed, 261 insertions, 156 deletions
diff --git a/scripting/workben/installer/Scripting.BeanShell.xcu b/scripting/workben/installer/Scripting.BeanShell.xcu new file mode 100644 index 000000000000..3c5c36541e34 --- /dev/null +++ b/scripting/workben/installer/Scripting.BeanShell.xcu @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<oor:node xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Scripting" oor:package="org.openoffice.Office"> + <node oor:name="ScriptRuntimes"> + <node oor:name="BeanShell" oor:op="replace"> + <prop oor:name="SupportedFileExtensions"> + <value xml:lang="en-US">bsh</value> + </prop> + </node> + </node> +</oor:node> diff --git a/scripting/workben/installer/Scripting.xcs b/scripting/workben/installer/Scripting.xcs new file mode 100644 index 000000000000..f3b502817f48 --- /dev/null +++ b/scripting/workben/installer/Scripting.xcs @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--*********************************************************************** + * + * $RCSfile: Scripting.xcs,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: dfoster $ $Date: 2003-05-29 14:20:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc.. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************ --> +<!DOCTYPE oor:component-schema SYSTEM "../../../../component-schema.dtd"> +<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Scripting" oor:package="org.openoffice.Office" xml:lang="en-US"> + <info> + <author>DF</author> + <desc xml:lang="en-US">Contains the various settings needed by the Scripting Framework and its runtimes.</desc> + </info> + <templates> + <group oor:name="RuntimeNode"> + <info> + <desc xml:lang="en-US">Specifies the runtimes available to the Scriptying Framework.</desc> + </info> + <prop oor:name="SupportedFileExtensions" oor:type="oor:string-list"> + <info> + <desc xml:lang="en-US">Lists the file extensions that are recognized by this runtime.</desc> + </info> + </prop> + </group> + </templates> + <component> + <set oor:name="ScriptRuntimes" oor:node-type="RuntimeNode"> + <info> + <desc xml:lang="en-US">Lists the registered Scripting Framework runtimes.</desc> + </info> + </set> + </component> +</oor:component-schema> diff --git a/scripting/workben/installer/Welcome.java b/scripting/workben/installer/Welcome.java index 3ce1c8f7be25..e73cdca87728 100644 --- a/scripting/workben/installer/Welcome.java +++ b/scripting/workben/installer/Welcome.java @@ -1,156 +1,156 @@ -package installer;
-
-/*
- * Welcome.java
- *
- * Created on 04 July 2002, 15:43
- */
-
-/**
- *
- * @author mike
- */
-import java.awt.event.*;
-import javax.swing.*;
-import java.io.*;
-import java.net.*;
-import java.util.Properties;
-
-public class Welcome extends javax.swing.JPanel implements ActionListener {
-
- /** Creates new form Welcome */
- public Welcome(InstallWizard wizard) {
- this.wizard = wizard;
- setBorder(new javax.swing.border.EtchedBorder(javax.swing.border.EtchedBorder.RAISED));
- initComponents();
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- private void initComponents() {//GEN-BEGIN:initComponents
- welcomePanel = new javax.swing.JPanel();
- area = new javax.swing.JTextArea();
- nextButtonEnable = true;
-
- setLayout(new java.awt.BorderLayout());
-
- welcomePanel.setLayout(new java.awt.BorderLayout());
- area.setEditable(false);
- area.setLineWrap(true);
-
- String message = "\n\tOffice Scripting Framework Version 0.2" +
- "\n\n\n\tPlease ensure that you have exited from Office";
-
- /* String userDir = (String) System.getProperty( "user.dir" );
- boolean isValid = validateCurrentUserDir(userDir);
- if( !isValid ) {
- nextButtonEnable = false;
- message = "Please run Installer from the program directory in a valid Office installation";
- setUpWelcomePanel(message);
- return;
- }
-
- int programPosition = userDir.lastIndexOf("program");
- String offInstallPth = null;
- offInstallPth = userDir.substring( 0, programPosition );
-
- wizard.storeLocation(offInstallPth); */
- setUpWelcomePanel(message);
-
- }//GEN-END:initComponents
-
- private void setUpWelcomePanel(String message){
- area.setText( message );
- welcomePanel.add(area, java.awt.BorderLayout.CENTER);
- add(welcomePanel, java.awt.BorderLayout.CENTER);
- NavPanel nav = new NavPanel(wizard, false, nextButtonEnable, true, "", InstallWizard.VERSIONS);
- nav.setNextListener(this);
- add(nav, java.awt.BorderLayout.SOUTH);
-
- //Banner br = new Banner();
- //add(br, java.awt.BorderLayout.WEST);
- }
-
-
- private boolean validateCurrentUserDir(String userDir){
-
-
-
- Properties props = null;
-
- File fileVersions = null;
- try
- {
- fileVersions = InstUtil.buildSversionLocation();
- }
- catch(IOException eFnF)
- {
- System.err.println("Cannot find sversion.ini/.sversionrc");
- JOptionPane.showMessageDialog(this, eFnF.getMessage(), "File not Found", JOptionPane.ERROR_MESSAGE);
- wizard.exitForm(null);
- }
-
- try {
- props = InstUtil.getOfficeVersions(fileVersions);
- }
- catch (IOException eIO) {
- //Message about no installed versions found
- System.err.println("Failed to parse SVERSION");
- JOptionPane.showMessageDialog(this, "There was a problem reading from the Office settings file.", "Parse Error", JOptionPane.ERROR_MESSAGE);
- wizard.exitForm(null);
- }
-
-
- boolean versionMatch = false;
-
- for( int i = 0; i < versions.length; i++ ) {
- String key = versions[i];
- String progPath = ( String )props.getProperty( key );
- if ( progPath != null ){
- progPath = progPath + File.separator + "program";
-
- File tmpFile = new File(progPath + File.separator + "oostubversion.txt");
- try{
- tmpFile.createNewFile();
-
- if( new File(userDir + File.separator + "oostubversion.txt").exists())
- {
- versionMatch = true;
- break;
- }
- }
- catch( IOException e)
- {
- // Fail silently
- }
- tmpFile.delete();
- }
- }
- return versionMatch;
- }
-
-
-
- public java.awt.Dimension getPreferredSize() {
- return new java.awt.Dimension(InstallWizard.DEFWIDTH, InstallWizard.DEFHEIGHT);
- }
-
- public void actionPerformed(ActionEvent ev)
- {
- //Perform next actions here...
- }
-
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JPanel welcomePanel;
- private javax.swing.JTextArea area;
- private InstallWizard wizard;
- //private static final String [] versions = {"OpenOffice.org 643", "StarOffice 6.1"};
- private static final String [] versions = { "StarOffice 6.1" };
- private boolean nextButtonEnable = true;
-
- // End of variables declaration//GEN-END:variables
-}
+package installer; + +/* + * Welcome.java + * + * Created on 04 July 2002, 15:43 + */ + +/** + * + * @author mike + */ +import java.awt.event.*; +import javax.swing.*; +import java.io.*; +import java.net.*; +import java.util.Properties; + +public class Welcome extends javax.swing.JPanel implements ActionListener { + + /** Creates new form Welcome */ + public Welcome(InstallWizard wizard) { + this.wizard = wizard; + setBorder(new javax.swing.border.EtchedBorder(javax.swing.border.EtchedBorder.RAISED)); + initComponents(); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + private void initComponents() {//GEN-BEGIN:initComponents + welcomePanel = new javax.swing.JPanel(); + area = new javax.swing.JTextArea(); + nextButtonEnable = true; + + setLayout(new java.awt.BorderLayout()); + + welcomePanel.setLayout(new java.awt.BorderLayout()); + area.setEditable(false); + area.setLineWrap(true); + + String message = "\n\tOffice Scripting Framework Version 0.3" + + "\n\n\n\tPlease ensure that you have exited from Office"; + + /* String userDir = (String) System.getProperty( "user.dir" ); + boolean isValid = validateCurrentUserDir(userDir); + if( !isValid ) { + nextButtonEnable = false; + message = "Please run Installer from the program directory in a valid Office installation"; + setUpWelcomePanel(message); + return; + } + + int programPosition = userDir.lastIndexOf("program"); + String offInstallPth = null; + offInstallPth = userDir.substring( 0, programPosition ); + + wizard.storeLocation(offInstallPth); */ + setUpWelcomePanel(message); + + }//GEN-END:initComponents + + private void setUpWelcomePanel(String message){ + area.setText( message ); + welcomePanel.add(area, java.awt.BorderLayout.CENTER); + add(welcomePanel, java.awt.BorderLayout.CENTER); + NavPanel nav = new NavPanel(wizard, false, nextButtonEnable, true, "", InstallWizard.VERSIONS); + nav.setNextListener(this); + add(nav, java.awt.BorderLayout.SOUTH); + + //Banner br = new Banner(); + //add(br, java.awt.BorderLayout.WEST); + } + + + private boolean validateCurrentUserDir(String userDir){ + + + + Properties props = null; + + File fileVersions = null; + try + { + fileVersions = InstUtil.buildSversionLocation(); + } + catch(IOException eFnF) + { + System.err.println("Cannot find sversion.ini/.sversionrc"); + JOptionPane.showMessageDialog(this, eFnF.getMessage(), "File not Found", JOptionPane.ERROR_MESSAGE); + wizard.exitForm(null); + } + + try { + props = InstUtil.getOfficeVersions(fileVersions); + } + catch (IOException eIO) { + //Message about no installed versions found + System.err.println("Failed to parse SVERSION"); + JOptionPane.showMessageDialog(this, "There was a problem reading from the Office settings file.", "Parse Error", JOptionPane.ERROR_MESSAGE); + wizard.exitForm(null); + } + + + boolean versionMatch = false; + + for( int i = 0; i < versions.length; i++ ) { + String key = versions[i]; + String progPath = ( String )props.getProperty( key ); + if ( progPath != null ){ + progPath = progPath + File.separator + "program"; + + File tmpFile = new File(progPath + File.separator + "oostubversion.txt"); + try{ + tmpFile.createNewFile(); + + if( new File(userDir + File.separator + "oostubversion.txt").exists()) + { + versionMatch = true; + break; + } + } + catch( IOException e) + { + // Fail silently + } + tmpFile.delete(); + } + } + return versionMatch; + } + + + + public java.awt.Dimension getPreferredSize() { + return new java.awt.Dimension(InstallWizard.DEFWIDTH, InstallWizard.DEFHEIGHT); + } + + public void actionPerformed(ActionEvent ev) + { + //Perform next actions here... + } + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel welcomePanel; + private javax.swing.JTextArea area; + private InstallWizard wizard; + //private static final String [] versions = {"OpenOffice.org 643", "StarOffice 6.1"}; + private static final String [] versions = { "StarOffice 6.1" }; + private boolean nextButtonEnable = true; + + // End of variables declaration//GEN-END:variables +} diff --git a/scripting/workben/installer/XmlUpdater.java b/scripting/workben/installer/XmlUpdater.java index 660b715b46ce..39a7ee0b1929 100644 --- a/scripting/workben/installer/XmlUpdater.java +++ b/scripting/workben/installer/XmlUpdater.java @@ -167,6 +167,9 @@ public class XmlUpdater extends Thread { starBasicPath= starBasicPath.concat(File.separator+"user"+File.separator+"basic"+File.separator+"ScriptBindingLibrary"+File.separator); //System.out.println( "Office StarBasic path: " + starBasicPath ); + String regSchemaOfficePath=installPath; + regSchemaOfficePath= regSchemaOfficePath.concat(File.separator+"share"+File.separator+"registry"+File.separator+"schema"+File.separator+"org"+File.separator+"openoffice"+File.separator+"Office"+File.separator); + //System.out.println( "Office schema path: " + regSchemaOfficePath ); // Get the NetBeans installation //String netbeansPath= @@ -382,6 +385,11 @@ public class XmlUpdater extends Thread { return; } + if (!zd.extractEntry("schema/Scripting.xcs",regSchemaOfficePath, statusLabel)) + { + onInstallComplete(); + return; + } //-------------------------------- |