flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ftho...@apache.org
Subject svn commit: r1448512 - in /flex/whiteboard/fthomas/developerToolSuite/trunk: org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/application/config/ org.apache.flex.utilities.developerTo...
Date Thu, 21 Feb 2013 04:44:04 GMT
Author: fthomas
Date: Thu Feb 21 04:44:04 2013
New Revision: 1448512

URL: http://svn.apache.org/r1448512
Log:
missing files from the last commit

Added:
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/application/config/
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/application/config/SettingsContext.mxml
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/ExitUICommand.as
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/ApplicationExitReadyMessage.as
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/RequestExitApplicationMessage.as
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/config/
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/config/ExecutorContext.mxml
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/database/
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/database/ApplicationDB.as
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/util/
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/util/LogUtil.as
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ProjectDefinition.as
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/VCSType.as
  (with props)
    flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/test/flex/org/apache/flex/utilities/developerToolSuite/executor/application/

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/application/config/SettingsContext.mxml
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/application/config/SettingsContext.mxml?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/application/config/SettingsContext.mxml
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/application/config/SettingsContext.mxml
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(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.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<fx:Object xmlns:fx="http://ns.adobe.com/mxml/2009"
+           xmlns:parsley="http://www.spicefactory.org/parsley"
+           xmlns:menu="org.apache.flex.utilities.developerToolSuite.presentation.behavior.menu.*">
+
+    <fx:Declarations>
+        <parsley:DynamicObject type="{GeneralMenu}"/>
+
+        <parsley:MapCommand type="{MenuActionCommand}"/>
+        <parsley:MapCommand type="{LaunchUICommand}"/>
+        <parsley:MapCommand type="{ExitUICommand}"/>
+
+        <menu:ApplicationMenuPM/>
+    </fx:Declarations>
+
+    <fx:Script><![CDATA[
+        import org.apache.flex.utilities.developerToolSuite.infrastructure.command.ExitUICommand;
+        import org.apache.flex.utilities.developerToolSuite.infrastructure.command.LaunchUICommand;
+        import org.apache.flex.utilities.developerToolSuite.infrastructure.command.MenuActionCommand;
+        import org.apache.flex.utilities.developerToolSuite.presentation.graphic.menu.GeneralMenu;
+        ]]></fx:Script>
+</fx:Object>

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/application/config/SettingsContext.mxml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/ExitUICommand.as
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/ExitUICommand.as?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/ExitUICommand.as
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/ExitUICommand.as
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,52 @@
+package org.apache.flex.utilities.developerToolSuite.infrastructure.command {
+    import flash.data.SQLResult;
+    import flash.errors.SQLError;
+
+    import mx.utils.ObjectUtil;
+
+    import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.AbstractDBCommand;
+    import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.CommandCallBackError;
+    import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.CommandCallBackResult;
+    import org.apache.flex.utilities.developerToolSuite.infrastructure.message.ApplicationExitReadyMessage;
+    import org.apache.flex.utilities.developerToolSuite.infrastructure.message.RequestExitApplicationMessage;
+
+    public class ExitUICommand extends AbstractDBCommand {
+
+        private var _msg:RequestExitApplicationMessage;
+
+        public function execute(msg:RequestExitApplicationMessage):void {
+            log.debug("Executing Command with message: " + ObjectUtil.toString(msg));
+            this._msg = msg;
+            executeAsync();
+        }
+
+        override protected function prepareSql():void {
+            sql = "";
+            for (var property:String in _msg.settings) {
+                sql += "UPDATE setting SET value='" + _msg.settings[property] + "' WHERE
name='" + property + "';";
+            }
+
+            super.prepareSql();
+        }
+
+        override protected function result(result:SQLResult, terminateCommand:Boolean = true):void
{
+            super.result(result, false);
+
+            dispatch(new ApplicationExitReadyMessage());
+
+            if (terminateCommand) {
+                callback(new CommandCallBackResult(result));
+            }
+        }
+
+        override protected function error(error:SQLError, terminateCommand:Boolean = true):void
{
+            super.error(error, false);
+
+            dispatch(new ApplicationExitReadyMessage());
+
+            if (terminateCommand) {
+                callback(new CommandCallBackError(error.message, error.detailID));
+            }
+        }
+    }
+}

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/command/ExitUICommand.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/ApplicationExitReadyMessage.as
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/ApplicationExitReadyMessage.as?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/ApplicationExitReadyMessage.as
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/ApplicationExitReadyMessage.as
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,6 @@
+package org.apache.flex.utilities.developerToolSuite.infrastructure.message {
+    public class ApplicationExitReadyMessage {
+        public function ApplicationExitReadyMessage() {
+        }
+    }
+}

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/ApplicationExitReadyMessage.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/RequestExitApplicationMessage.as
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/RequestExitApplicationMessage.as?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/RequestExitApplicationMessage.as
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/RequestExitApplicationMessage.as
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,11 @@
+package org.apache.flex.utilities.developerToolSuite.infrastructure.message {
+    import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.SaveSettingsMessage;
+
+    public class RequestExitApplicationMessage{
+        public var settings:Object;
+
+        public function RequestExitApplicationMessage(settings:Object) {
+            this.settings = settings;
+        }
+    }
+}

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.component-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/infrastructure/message/RequestExitApplicationMessage.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/config/ExecutorContext.mxml
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/config/ExecutorContext.mxml?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/config/ExecutorContext.mxml
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/config/ExecutorContext.mxml
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(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.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<fx:Object xmlns:fx="http://ns.adobe.com/mxml/2009"
+           xmlns:parsley="http://www.spicefactory.org/parsley"
+           xmlns:database="org.apache.flex.utilities.developerToolSuite.executor.application.database.*"
+           xmlns:domain="org.apache.flex.utilities.developerToolSuite.executor.domain.*"
+           xmlns:nativeprocess="org.apache.flex.utilities.developerToolSuite.executor.application.nativeProcess.*">
+
+    <fx:Declarations>
+        <database:ApplicationDB/>
+
+        <parsley:MapCommand messageType="{InitApplicationMessage}">
+            <parsley:CommandSequence>
+                <parsley:Command type="{InitDBCommand}"/>
+                <parsley:Command type="{GetEnvironmentVariablesCommand}"/>
+                <parsley:Command type="{GetSettingsFromDBCommand}"/>
+            </parsley:CommandSequence>
+        </parsley:MapCommand>
+
+
+        <parsley:MapCommand type="{ChangeLanguageCommand}"/>
+        <parsley:MapCommand type="{SaveSettingsCommand}"/>
+        <parsley:MapCommand type="{SaveSettingCommand}"/>
+        <parsley:MapCommand type="{ValidateJavaPathCommand}"/>
+        <parsley:MapCommand type="{ValidateAntPathCommand}"/>
+        <parsley:MapCommand type="{ValidateMavenPathCommand}"/>
+        <parsley:MapCommand type="{ValidateSvnPathCommand}"/>
+        <parsley:MapCommand type="{ValidateGitPathCommand}"/>
+        <parsley:MapCommand type="{ValidateCygwinPathCommand}"/>
+
+        <domain:SettingModel id="applicationModel"/>
+    </fx:Declarations>
+
+    <fx:Script><![CDATA[
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.ChangeLanguageCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.GetEnvironmentVariablesCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.GetSettingsFromDBCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.InitDBCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.SaveSettingCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.SaveSettingsCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.ValidateAntPathCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.ValidateCygwinPathCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.ValidateGitPathCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.ValidateJavaPathCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.ValidateMavenPathCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.command.ValidateSvnPathCommand;
+        import org.apache.flex.utilities.developerToolSuite.executor.infrastructure.message.InitApplicationMessage;
+        ]]></fx:Script>
+</fx:Object>

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/config/ExecutorContext.mxml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/database/ApplicationDB.as
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/database/ApplicationDB.as?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/database/ApplicationDB.as
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/database/ApplicationDB.as
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,139 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (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.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+package org.apache.flex.utilities.developerToolSuite.executor.application.database {
+    import flash.data.SQLConnection;
+    import flash.data.SQLResult;
+    import flash.data.SQLStatement;
+    import flash.errors.SQLError;
+    import flash.events.SQLErrorEvent;
+    import flash.events.SQLEvent;
+    import flash.filesystem.File;
+    import flash.net.Responder;
+
+    import mx.logging.ILogger;
+    import mx.utils.ObjectUtil;
+
+    import org.apache.flex.utilities.developerToolSuite.executor.application.util.LogUtil;
+
+    public class ApplicationDB {
+
+        public static const DB_VERSION:uint = 1;
+
+        private static var LOG:ILogger = LogUtil.getLogger(ApplicationDB);
+
+        public static const DATABASE_NAME:String = "DTSDB.db";
+        private static var _conn:SQLConnection;
+
+        private var _isReady:Boolean;
+        private var _isBusy:Boolean;
+
+        private var _callbacks:Array = [];
+        private var _resultCallback:Function;
+        private var _errorCallback:Function;
+
+        public function connect(callback:Function):void {
+
+            _callbacks.push(callback);
+
+            if (!_isReady && !_isBusy) {
+                LOG.debug("Connecting async DB: {0}", ApplicationDB.DATABASE_NAME);
+                _conn = new SQLConnection();
+
+                _conn.addEventListener(SQLEvent.OPEN, openHandler);
+                _conn.addEventListener(SQLEvent.CLOSE, closedHandler);
+                _conn.addEventListener(SQLErrorEvent.ERROR, errorHandler);
+
+                // The database file is in the application storage directory
+                var folder:File = File.applicationStorageDirectory;
+                var dbFile:File = folder.resolvePath(DATABASE_NAME);
+
+                _isBusy = true;
+                _conn.openAsync(dbFile);
+            } else executeNextCallback();
+        }
+
+        protected function openHandler(event:SQLEvent):void {
+            _isReady = true;
+            _isBusy = false;
+            LOG.debug("the database was opened successfully");
+            executeNextCallback();
+        }
+
+        protected function close():void {
+            LOG.debug("Closing async DB: {0}", ApplicationDB.DATABASE_NAME);
+            _isReady = false;
+            _isBusy = false;
+            _conn.close();
+        }
+
+        protected function closedHandler(event:SQLEvent):void {
+            LOG.debug("the database was closed successfully");
+        }
+
+        protected function errorHandler(event:SQLErrorEvent):void {
+            LOG.error("Error executing DB Command: {0}", ObjectUtil.toString(event.error));
+            _isReady = false;
+            _isBusy = false;
+        }
+
+        public function executeSqlStatement(stmt:SQLStatement, resultCallback:Function, errorCallback:Function):void
{
+            _resultCallback = resultCallback;
+            _errorCallback = errorCallback;
+
+            _isBusy = true;
+            stmt.sqlConnection = _conn;
+            stmt.execute(-1, new Responder(result, error));
+        }
+
+        private function result(result:SQLResult):void {
+            _isBusy = false
+            if (_resultCallback) {
+                _resultCallback(result);
+                _resultCallback = null;
+            }
+            executeNextCallback();
+        }
+
+        private function error(error:SQLError):void {
+            LOG.error("Error executing DB Command: {0}", ObjectUtil.toString(error));
+            _isBusy = false;
+            if (_errorCallback) {
+                _errorCallback(error);
+                _errorCallback = null;
+            }
+            executeNextCallback();
+        }
+
+        private function executeNextCallback():void {
+            if (_isReady && !_isBusy) {
+                if (_callbacks.length > 0) {
+                    _callbacks.pop()();
+                } else {
+                    close();
+                }
+            }
+        }
+
+        public function get isReady():Boolean {
+            return _isReady;
+        }
+
+        public function get isBusy():Boolean {
+            return _isBusy;
+        }
+    }
+}

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/database/ApplicationDB.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,217 @@
+package org.apache.flex.utilities.developerToolSuite.executor.application.nativeProcess {
+    import flash.desktop.NativeProcess;
+    import flash.desktop.NativeProcessStartupInfo;
+    import flash.events.Event;
+    import flash.events.EventDispatcher;
+    import flash.events.IOErrorEvent;
+    import flash.events.NativeProcessExitEvent;
+    import flash.events.ProgressEvent;
+    import flash.filesystem.File;
+    import flash.system.Capabilities;
+
+    import mx.logging.ILogger;
+
+    import org.apache.flex.utilities.developerToolSuite.executor.application.util.LogUtil;
+
+    public class NativeShellHelper extends EventDispatcher {
+
+        // Use trace during tests as AIR thru Maven doesn't support resource xml config files
for logging.
+        private static var LOG:ILogger;
+
+        private static var _gcLocker:GCLocker;
+
+        private var _process:NativeProcess;
+        private var _isRunning:Boolean;
+
+        private var _isLogEnabled:Boolean;
+
+        public function NativeShellHelper() {
+            super();
+            if (!LOG) {
+                LOG = LogUtil.getLogger(NativeShellHelper);
+            }
+            if (!_gcLocker) {
+                _gcLocker = new GCLocker();
+            }
+            _process = new NativeProcess();
+        }
+
+        public function get process():NativeProcess {
+            return _process;
+        }
+
+        public function get isRunning():Boolean {
+            return _isRunning;
+        }
+
+        public function run(command:Vector.<String> = null, shell:String = null):void
{
+
+            if (_isRunning) {
+                throw new Error("NativeProcessHelper is currently busy");
+                return;
+            }
+            _isRunning = true;
+
+            //Avoid the garbage collection
+            _gcLocker.lock(this);
+
+            if (!shell) {
+                shell = getShellPath();
+            }
+
+            LOG.debug("Executing: {0} {1}", shell, command.join(" "));
+
+            var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
+
+            var file:File = File.applicationDirectory.resolvePath(shell);
+            nativeProcessStartupInfo.executable = file;
+            nativeProcessStartupInfo.arguments = command;
+
+            _process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, dispatch2, false,
0, true);
+            _process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, dispatch2, false,
0, true);
+            _process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, dispatch2, false,
0, true);
+            _process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, dispatch2, false,
0, true);
+            _process.addEventListener(NativeProcessExitEvent.EXIT, exitHandler, false, -100,
true);
+            _process.start(nativeProcessStartupInfo);
+        }
+
+        public function logMessages():void {
+            if (_isLogEnabled) {
+                return;
+            }
+            _isLogEnabled = true;
+            _process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, outputDataLogHandler,
false, 0, true);
+            _process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, errorDataLogHandler,
false, 0, true);
+            _process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, IOErrorLogHandler,
false, 0, true);
+            _process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, IOErrorLogHandler,
false, 0, true);
+            _process.addEventListener(NativeProcessExitEvent.EXIT, exitLogHandler, false,
0, true);
+        }
+
+        private function errorDataLogHandler(event:ProgressEvent):void {
+            trace(_process.standardError.readUTFBytes(_process.standardError.bytesAvailable));
+            //LOG.error(_process.standardError.readUTFBytes(_process.standardError.bytesAvailable));
+        }
+
+        private function exitLogHandler(event:NativeProcessExitEvent):void {
+            trace("Process exited with " + event.exitCode);
+            //LOG.info("Process exited with " + event.exitCode);
+
+        }
+
+        private function IOErrorLogHandler(event:IOErrorEvent):void {
+            trace(event.toString());
+            //LOG.error(event.toString());
+        }
+
+        private function outputDataLogHandler(event:ProgressEvent):void {
+            var output:String = _process.standardOutput.readUTFBytes(_process.standardOutput.bytesAvailable);
+            trace("Output: " + output);
+            //LOG.info("Output: " + output);
+        }
+
+        private function dispatch2(e:Event):void {
+            this.dispatchEvent(e);
+        }
+
+        private function exitHandler(e:Event):void {
+            _gcLocker.release(this);
+            _process = null;
+            _isRunning = false;
+            this.dispatchEvent(e);
+        }
+
+        public static function get OS():String {
+            var os:String;
+
+            if (Capabilities.os.toLowerCase().indexOf("win") > -1) {
+                os = "win";
+            } else if (Capabilities.os.toLowerCase().indexOf("mac") > -1) {
+                os = "mac";
+            } else if (Capabilities.os.toLowerCase().indexOf("linux") > -1) {
+                os = "linux";
+            }
+
+            return os;
+        }
+
+        public function get OS():String {
+            return NativeShellHelper.OS;
+        }
+
+        public function getShellPath():String {
+            var shellPath:String;
+
+            if (OS == "win") {
+                shellPath = "C:/Windows/System32/cmd.exe";
+            } else if (OS == "mac") {
+                shellPath = "/Applications/Utilities/Terminal.app";
+            } else if (OS == "linux") {
+
+                var file:File;
+                try {
+                    file = new File("/bin/bash");
+                    if (file.exists) {
+                        shellPath = file.nativePath;
+                    }
+                } catch (err:Error) {
+                }
+                ;
+
+                if (!shellPath) {
+                    try {
+                        file = new File("/bin/bsh");
+                        if (file.exists) {
+                            shellPath = file.nativePath;
+                        }
+                    } catch (err:Error) {
+                    }
+                    ;
+                }
+
+                if (!shellPath) {
+                    try {
+                        file = new File("/bin/csh");
+                        if (file.exists) {
+                            shellPath = file.nativePath;
+                        }
+                    } catch (err:Error) {
+                    }
+                    ;
+                }
+            }
+            if (!shellPath) {
+                throw new Error("Unsupported System");
+            }
+
+            return shellPath;
+        }
+
+        public static function formatPath(path:String):String {
+            return path.replace(/\\/g, "/");
+        }
+
+        public function formatPath(path:String):String {
+            return NativeShellHelper.formatPath(path);
+        }
+    }
+}
+internal class GCLocker {
+
+    private var _lockedRefs:Array;
+
+    public function GCLocker() {
+        _lockedRefs = [];
+    }
+
+    public function release(ref:*):void {
+        var i:int = _lockedRefs.indexOf(ref);
+
+        if (i >= 0) {
+            _lockedRefs.splice(i, 1);
+        }
+    }
+
+    public function lock(ref:*):void {
+        _lockedRefs[_lockedRefs.length] = ref;
+    }
+}

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/nativeProcess/NativeShellHelper.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/util/LogUtil.as
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/util/LogUtil.as?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/util/LogUtil.as
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/util/LogUtil.as
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,13 @@
+package org.apache.flex.utilities.developerToolSuite.executor.application.util {
+    import avmplus.getQualifiedClassName;
+
+    import mx.logging.ILogger;
+    import mx.logging.Log;
+
+    public class LogUtil {
+        public static function getLogger(category:*):ILogger {
+            var className:String = getQualifiedClassName(category).replace("::", ".");
+            return Log.getLogger(className);
+        }
+    }
+}

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/application/util/LogUtil.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ProjectDefinition.as
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ProjectDefinition.as?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ProjectDefinition.as
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ProjectDefinition.as
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,26 @@
+package org.apache.flex.utilities.developerToolSuite.executor.domain {
+
+    [Bindable]
+    public class ProjectDefinition {
+
+        public var flexSdkVersion:String;
+        public var airSdkVersion:String;
+        public var fpVersion:String;
+
+        public var name:String;
+        public var location:String;
+        public var vcsType:VCSType;
+
+        public var id:uint;
+        public var creationDate:Date;
+
+        public function ProjectDefinition(name:String, location:String, vcsType:VCSType,
flexSdkVersion:String, airSdkVersion:String, fpVersion:String) {
+            this.name = name;
+            this.location = location;
+            this.vcsType = vcsType;
+            this.flexSdkVersion = flexSdkVersion;
+            this.airSdkVersion = airSdkVersion;
+            this.fpVersion = fpVersion;
+        }
+    }
+}

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/ProjectDefinition.as
------------------------------------------------------------------------------
    svn:eol-style = native

Added: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/VCSType.as
URL: http://svn.apache.org/viewvc/flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/VCSType.as?rev=1448512&view=auto
==============================================================================
--- flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/VCSType.as
(added)
+++ flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/VCSType.as
Thu Feb 21 04:44:04 2013
@@ -0,0 +1,19 @@
+package org.apache.flex.utilities.developerToolSuite.executor.domain {
+
+    public class VCSType {
+
+        public static const SVN:VCSType = new VCSType(new PrivateConstructor(), "SVN");
+        public static const GIT:VCSType = new VCSType(new PrivateConstructor(), "GIT");
+
+        private var _name:String;
+
+        public function VCSType(cantInstantiate:PrivateConstructor, name:String) {
+            _name = name;
+        }
+
+        public function get name():String {
+            return _name;
+        }
+    }
+}
+internal class PrivateConstructor {};

Propchange: flex/whiteboard/fthomas/developerToolSuite/trunk/org.apache.flex.utilities.developerToolSuite.executor-lib/src/main/flex/org/apache/flex/utilities/developerToolSuite/executor/domain/VCSType.as
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message