Overlord SVN: r932 - in bpm-console/trunk/gui/war: src/main/java and 3 other directories.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-25 08:27:19 -0500 (Mon, 25 Jan 2010)
New Revision: 932
Added:
bpm-console/trunk/gui/war/src/main/java/ErraiService.properties
Modified:
bpm-console/trunk/gui/war/pom.xml
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
bpm-console/trunk/gui/war/war/WEB-INF/web.xml
Log:
Added errai-bus dependency and initialization
Modified: bpm-console/trunk/gui/war/pom.xml
===================================================================
--- bpm-console/trunk/gui/war/pom.xml 2010-01-25 13:03:41 UTC (rev 931)
+++ bpm-console/trunk/gui/war/pom.xml 2010-01-25 13:27:19 UTC (rev 932)
@@ -21,6 +21,12 @@
<!-- Dependencies -->
<dependencies>
+ <dependency>
+ <groupId>org.jboss.errai</groupId>
+ <artifactId>errai-bus</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+
<dependency>
<groupId>org.jboss.bpm</groupId>
<artifactId>gwt-console-workspace-api</artifactId>
Added: bpm-console/trunk/gui/war/src/main/java/ErraiService.properties
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/ErraiService.properties (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/ErraiService.properties 2010-01-25 13:27:19 UTC (rev 932)
@@ -0,0 +1,38 @@
+
+#
+# Copyright 2009 JBoss, a divison Red Hat, Inc
+#
+# Licensed 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.
+#
+
+#
+# Specify the Authentication/Authorization Adapter sendNowWith use
+#
+#errai.authentication_adapter=org.jboss.errai.persistence.server.security.HibernateAuthenticationAdapter
+#errai.authentication_adapter=org.jboss.errai.bus.server.security.auth.JAASAdapter
+
+##
+## This property indicates whether or not authentication is required for all communication with the bus. Set this
+## to 'true' if all access to your application should be secure.
+##
+errai.require_authentication_for_all=false
+
+#
+# (Required) Specify the application path on the appserver
+#
+errai.application_context=/jbpm-console/
+
+#
+# (Optional) A Login MOTD sendNowWith be sent sendNowWith the client upon successful login.
+#
+errai.login_motd=UNAUTHORIZED ACCESS IS PROHIBITED!
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml 2010-01-25 13:03:41 UTC (rev 931)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml 2010-01-25 13:27:19 UTC (rev 932)
@@ -9,8 +9,13 @@
<inherits name="com.google.gwt.i18n.I18N"/>
<inherits name="com.google.gwt.user.ImageBundle"/>
<inherits name="com.google.gwt.xml.XML" />
+
+ <!-- remove when migration to errai is done -->
<inherits name="org.jboss.BPMWorkspace" />
+ <inherits name="org.jboss.errai.common.ErraiCommon"/>
+ <inherits name="org.jboss.errai.bus.ErraiBus" />
+
<!-- Add gwt-log support, default level `DEBUG` -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-25 13:03:41 UTC (rev 931)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-25 13:27:19 UTC (rev 932)
@@ -42,6 +42,8 @@
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
import org.jboss.bpm.console.client.util.WindowUtil;
+import org.jboss.errai.bus.client.ErraiBus;
+import org.jboss.errai.bus.client.MessageBus;
import org.jboss.errai.workspaces.client.Registry;
import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
@@ -72,6 +74,10 @@
this.auth = auth;
this.config = config;
+ final MessageBus bus = ErraiBus.get();
+ if(null==bus)
+ throw new IllegalStateException("Failed to initialize errai-bus");
+
Registry.set(ApplicationContext.class, this);
Registry.set(Controller.class, controller);
Modified: bpm-console/trunk/gui/war/war/WEB-INF/web.xml
===================================================================
--- bpm-console/trunk/gui/war/war/WEB-INF/web.xml 2010-01-25 13:03:41 UTC (rev 931)
+++ bpm-console/trunk/gui/war/war/WEB-INF/web.xml 2010-01-25 13:27:19 UTC (rev 932)
@@ -11,7 +11,19 @@
<load-on-startup>1</load-on-startup>
</servlet>
+ <servlet>
+ <servlet-name>ErraiServlet</servlet-name>
+ <servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
<servlet-mapping>
+ <servlet-name>ErraiServlet</servlet-name>
+ <url-pattern>*.erraiBus</url-pattern>
+ </servlet-mapping>
+
+
+ <servlet-mapping>
<servlet-name>xmlProxy</servlet-name>
<url-pattern>/app/xhp/*</url-pattern>
</servlet-mapping>
16 years, 6 months
Overlord SVN: r931 - in bpm-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client/util and 3 other directories.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-25 08:03:41 -0500 (Mon, 25 Jan 2010)
New Revision: 931
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Authentication.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Preferences.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex/
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java
Removed:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Preferences.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/UIConstants.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/regex/
Log:
Further strip down workspace API
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Authentication.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Authentication.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Authentication.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,334 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.http.client.*;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.util.JSONWalk;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class Authentication
+{
+ private AuthCallback callback;
+
+ private List<String> rolesAssigned = new ArrayList<String>();
+
+ private String sid;
+ private String username;
+ private String password;
+
+ private ConsoleConfig config;
+ private String rolesUrl;
+ private Date loggedInSince;
+
+ public Authentication(ConsoleConfig config, String sessionID, String rolesUrl)
+ {
+ this.config = config;
+ this.sid = sessionID;
+ this.rolesUrl = rolesUrl;
+ this.loggedInSince = new Date();
+ }
+
+ public String getSid()
+ {
+ return sid;
+ }
+
+ public void login(String user, String pass)
+ {
+ this.username = user;
+ this.password = pass;
+
+ String formAction = config.getConsoleServerUrl() + "/rs/identity/secure/j_security_check";
+ RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, formAction);
+ rb.setHeader("Content-Type", "application/x-www-form-urlencoded");
+
+ try
+ {
+ rb.sendRequest("j_username="+user+"&j_password="+pass,
+ new RequestCallback()
+ {
+
+ public void onResponseReceived(Request request, Response response)
+ {
+ ConsoleLog.debug("postLoginCredentials() HTTP "+response.getStatusCode());
+
+ if(response.getText().indexOf("HTTP 401")!=-1) // HACK
+ {
+ if (callback != null)
+ callback.onLoginFailed(request, new Exception("Authentication failed"));
+ else
+ throw new RuntimeException("Unknown exception upon login attempt");
+ }
+ else if(response.getStatusCode()==200) // it's always 200, even when the authentication fails
+ {
+ DeferredCommand.addCommand(
+ new Command()
+ {
+
+ public void execute()
+ {
+ requestAssignedRoles();
+ }
+ }
+ );
+ }
+ }
+
+ public void onError(Request request, Throwable t)
+ {
+ if (callback != null)
+ callback.onLoginFailed(request, new Exception("Authentication failed"));
+ else
+ throw new RuntimeException("Unknown exception upon login attempt");
+ }
+ }
+ );
+ }
+ catch (RequestException e)
+ {
+ ConsoleLog.error("Request error", e);
+ }
+ }
+
+ public Date getLoggedInSince()
+ {
+ return loggedInSince;
+ }
+
+ /**
+ * Login using specific credentials.
+ * This delegates to {@link com.google.gwt.http.client.RequestBuilder#setUser(String)}
+ * and {@link com.google.gwt.http.client.RequestBuilder#setPassword(String)}
+ */
+ private void requestAssignedRoles()
+ {
+ RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, rolesUrl );
+
+ ConsoleLog.debug("Request roles: " + rb.getUrl());
+
+ /*if (user != null && pass != null)
+ {
+ rb.setUser(user);
+ rb.setPassword(pass);
+
+ if (!GWT.isScript()) // hosted mode only
+ {
+ rb.setHeader("xtest-user", user);
+ rb.setHeader("xtest-pass", pass); // NOTE: This is plaintext, use for testing only
+ }
+ }*/
+
+ try
+ {
+ rb.sendRequest(null,
+ new RequestCallback()
+ {
+
+ public void onResponseReceived(Request request, Response response)
+ {
+ ConsoleLog.debug("requestAssignedRoles() HTTP "+response.getStatusCode());
+
+ // parse roles
+ if (200 == response.getStatusCode())
+ {
+ rolesAssigned = Authentication.parseRolesAssigned(response.getText());
+ if (callback != null) callback.onLoginSuccess(request, response);
+ }
+ else
+ {
+ onError(request, new Exception(response.getText()));
+ }
+ }
+
+ public void onError(Request request, Throwable t)
+ {
+ // auth failed
+ // Couldn't connect to server (could be timeout, SOP violation, etc.)
+ if (callback != null)
+ callback.onLoginFailed(request, t);
+ else
+ throw new RuntimeException("Unknown exception upon login attempt", t);
+ }
+ });
+ }
+
+ catch (RequestException e1)
+ {
+ // Couldn't connect to server
+ throw new RuntimeException("Unknown error upon login attempt", e1);
+ }
+ }
+
+
+ public void setCallback(AuthCallback callback)
+ {
+ this.callback = callback;
+ }
+
+ private native void reload() /*-{
+ $wnd.location.reload();
+ }-*/;
+
+ public static void logout(final ConsoleConfig conf)
+ {
+ RequestBuilder rb = new RequestBuilder(
+ RequestBuilder.POST,
+ conf.getConsoleServerUrl()+"/rs/identity/sid/invalidate"
+ );
+
+ try
+ {
+ rb.sendRequest(null, new RequestCallback()
+ {
+ public void onResponseReceived(Request request, Response response)
+ {
+ ConsoleLog.debug("logout() HTTP "+response.getStatusCode());
+
+ if(response.getStatusCode()!=200)
+ {
+ ConsoleLog.error(response.getText());
+ }
+ }
+
+ public void onError(Request request, Throwable t)
+ {
+ ConsoleLog.error("Failed to invalidate session", t);
+ }
+ });
+ }
+ catch (RequestException e)
+ {
+ ConsoleLog.error("Request error", e);
+ }
+ }
+
+ public void logoutAndReload()
+ {
+ RequestBuilder rb = new RequestBuilder(
+ RequestBuilder.POST,
+ config.getConsoleServerUrl()+"/rs/identity/sid/invalidate"
+ );
+
+ try
+ {
+ rb.sendRequest(null, new RequestCallback()
+ {
+ public void onResponseReceived(Request request, Response response)
+ {
+ ConsoleLog.debug("logoutAndReload() HTTP "+response.getStatusCode());
+ resetState();
+ reload();
+ }
+
+ public void onError(Request request, Throwable t)
+ {
+ ConsoleLog.error("Failed to invalidate session", t);
+ }
+ });
+ }
+ catch (RequestException e)
+ {
+ ConsoleLog.error("Request error", e);
+ }
+ }
+
+ private void resetState()
+ {
+ sid = null;
+ username = null;
+ password = null;
+ rolesAssigned = new ArrayList<String>();
+ loggedInSince = null;
+ }
+
+ public void handleSessionTimeout()
+ {
+ MessageBox.confirm("Session expired", "Please login again",
+ new MessageBox.ConfirmationCallback()
+ {
+ public void onResult(boolean b)
+ {
+ // regardless of the choice, force login
+ logoutAndReload();
+ }
+ }
+ );
+ }
+
+
+ public interface AuthCallback
+ {
+ void onLoginSuccess(Request request, Response response);
+
+ void onLoginFailed(Request request, Throwable t);
+ }
+
+
+ public List<String> getRolesAssigned()
+ {
+ return rolesAssigned;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public static List<String> parseRolesAssigned(String json)
+ {
+ // parse roles
+ List<String> roles = new ArrayList<String>();
+
+ JSONValue root = JSONParser.parse(json);
+ JSONArray array = JSONWalk.on(root).next("roles").asArray();
+
+ for (int i = 0; i < array.size(); ++i)
+ {
+ JSONObject item = array.get(i).isObject();
+ boolean assigned = JSONWalk.on(item).next("assigned").asBool();
+ String roleName = JSONWalk.on(item).next("role").asString();
+
+ if (assigned)
+ {
+ roles.add(roleName);
+ }
+ }
+
+ return roles;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,173 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.i18n.client.Dictionary;
+
+/**
+ * Initialize console config from host page (<code>Application.html</code>) variable:
+ * <pre>
+ * var consoleConfig = {
+ * consoleServerUrl: "http://localhost:8080/gwt-console-server",
+ * reportServerUrl: "http://localhost:8080/report",
+ * [...]
+ * };
+ * </pre>
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ * @see com.google.gwt.i18n.client.Dictionary
+ */
+public class ConsoleConfig
+{
+ private String serverWebContext;
+
+ private String overallReportFile;
+ private String processSummaryReportFile;
+ private String instanceSummaryReportFile;
+
+ private String profileName;
+ private String logo;
+
+ private String consoleServerUrl;
+
+ private String defaultEditor;
+
+ public ConsoleConfig(String proxyUrl)
+ {
+ Dictionary theme = Dictionary.getDictionary("consoleConfig");
+ profileName = theme.get("profileName");
+ logo = theme.get("logo");
+
+ serverWebContext = theme.get("serverWebContext");
+
+ overallReportFile = theme.get("overallReportFile");
+ processSummaryReportFile = theme.get("processSummaryReportFile");
+ instanceSummaryReportFile = theme.get("instanceSummaryReportFile");
+
+ defaultEditor = theme.get("defaultEditor");
+
+ if(null==proxyUrl)
+ {
+ // extract host
+ String base = GWT.getHostPageBaseURL();
+ String protocol = base.substring(0, base.indexOf("//")+2);
+ String noProtocol = base.substring(base.indexOf(protocol)+protocol.length(), base.length());
+ String host = noProtocol.substring(0, noProtocol.indexOf("/"));
+
+ // default url
+ consoleServerUrl = protocol + host + serverWebContext;
+ }
+ else
+ {
+ consoleServerUrl = proxyUrl;
+ }
+
+ // features
+
+ }
+
+ public String getHost()
+ {
+ String host = null;
+ if(!GWT.isScript()) // development with proxy
+ {
+ host = consoleServerUrl;
+ }
+ else
+ {
+ String baseUrl = GWT.getModuleBaseURL();
+ host = baseUrl.substring(
+ 0, baseUrl.indexOf("app")
+ );
+ }
+
+ return host;
+ }
+
+ public String getProfileName()
+ {
+ return profileName;
+ }
+
+ public String getLogo()
+ {
+ return logo;
+ }
+
+ public String getDefaultEditor()
+ {
+ return defaultEditor;
+ }
+
+ public String getConsoleServerUrl()
+ {
+ if(consoleServerUrl ==null)
+ throw new RuntimeException("Config not properly setup: console server URL is null");
+ return consoleServerUrl;
+ }
+
+ public void setConsoleServerUrl(String consoleServerUrl)
+ {
+ this.consoleServerUrl = consoleServerUrl;
+ }
+
+ public String getServerWebContext()
+ {
+ return serverWebContext;
+ }
+
+ public void setServerWebContext(String serverWebContext)
+ {
+ this.serverWebContext = serverWebContext;
+ }
+
+ public String getOverallReportFile()
+ {
+ return overallReportFile;
+ }
+
+ public void setOverallReportFile(String overallReportFile)
+ {
+ this.overallReportFile = overallReportFile;
+ }
+
+ public String getProcessSummaryReportFile()
+ {
+ return processSummaryReportFile;
+ }
+
+ public void setProcessSummaryReportFile(String processSummaryReportFile)
+ {
+ this.processSummaryReportFile = processSummaryReportFile;
+ }
+
+ public String getInstanceSummaryReportFile()
+ {
+ return instanceSummaryReportFile;
+ }
+
+ public void setInstanceSummaryReportFile(String instanceSummaryReportFile)
+ {
+ this.instanceSummaryReportFile = instanceSummaryReportFile;
+ }
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Preferences.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Preferences.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Preferences.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.Cookies;
+
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class Preferences
+{
+ // Editor that should be launched at startup
+ public static final String BPM_DEFAULT_TOOL = "bpm.default.tool";
+
+ public static boolean has(String key)
+ {
+ return Preferences.get(key)!=null;
+ }
+
+ public static String get(String key)
+ {
+ return Cookies.getCookie(key);
+ }
+
+ public static void set(String key, String value)
+ {
+ Date twoWeeks = new Date(System.currentTimeMillis()+(2*604800*1000));
+ Cookies.setCookie(key, value, twoWeeks);
+ }
+
+ public static void clear(String key)
+ {
+ Cookies.removeCookie(key);
+ }
+}
Copied: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java (from rev 899, bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java)
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util;
+
+/**
+ * The maven gwt:test mojo treats any output to stderr as
+ * a test failure. gwt-log does dump some information there,
+ * hence we need to proxy log invocation and be able to disable them at all.
+ * <p/>
+ * If you want to test the application, make sure to lauch it using
+ * {@link org.jboss.bpm.console.client.Application#onModuleLoad2()}.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ConsoleLog
+{
+ private static boolean enabled = true; // see javadoc comments
+
+ public static void warn(String msg)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.warn(msg);
+ }
+
+ public static void info(String msg)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.info(msg);
+ }
+
+ public static void debug(String msg)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.debug(msg);
+ }
+
+ public static void error(String msg)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.error(msg);
+ }
+
+ public static void error(String msg, Throwable t)
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.error(msg, t);
+ }
+
+ public static void setUncaughtExceptionHandler()
+ {
+ if (enabled)
+ com.allen_sauer.gwt.log.client.Log.setUncaughtExceptionHandler();
+ }
+
+ public static boolean isEnabled()
+ {
+ return enabled;
+ }
+
+ public static void setEnabled(boolean enabled)
+ {
+ ConsoleLog.enabled = enabled;
+ }
+}
Copied: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java (from rev 899, bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java)
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
+ *
+ * Licensed 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.jboss.bpm.console.client.util;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Date locale support for the {@link SimpleDateParser}. You are encouraged to
+ * extend this class and provide implementations for other locales.
+ * @author <a href="mailto:g.georgovassilis@gmail.com">George Georgovassilis</a>
+ *
+ */
+public class DateLocale {
+ public final static String TOKEN_DAY_OF_WEEK = "E";
+
+ public final static String TOKEN_DAY_OF_MONTH = "d";
+
+ public final static String TOKEN_MONTH = "M";
+
+ public final static String TOKEN_YEAR = "y";
+
+ public final static String TOKEN_HOUR_12 = "h";
+
+ public final static String TOKEN_HOUR_24 = "H";
+
+ public final static String TOKEN_MINUTE = "m";
+
+ public final static String TOKEN_SECOND = "s";
+
+ public final static String TOKEN_MILLISECOND = "S";
+
+ public final static String TOKEN_AM_PM = "a";
+
+ public final static String AM = "AM";
+
+ public final static String PM = "PM";
+
+ public final static List SUPPORTED_DF_TOKENS = Arrays.asList(new String[] {
+ TOKEN_DAY_OF_WEEK, TOKEN_DAY_OF_MONTH, TOKEN_MONTH, TOKEN_YEAR,
+ TOKEN_HOUR_12, TOKEN_HOUR_24, TOKEN_MINUTE, TOKEN_SECOND,
+ TOKEN_AM_PM });
+
+ public String[] MONTH_LONG = { "January", "February", "March", "April",
+ "May", "June", "July", "August", "September", "October",
+ "November", "December" };
+
+ public String[] MONTH_SHORT = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" };
+
+ public String[] WEEKDAY_LONG = { "Sunday", "Monday", "Tuesday",
+ "Wednesday", "Thursday", "Friday", "Saturday" };
+
+ public String[] WEEKDAY_SHORT = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
+ "Sat" };
+
+ public static String getAM() {
+ return AM;
+ }
+
+ public static String getPM() {
+ return PM;
+ }
+
+ public String[] getWEEKDAY_LONG() {
+ return WEEKDAY_LONG;
+ }
+
+ public String[] getWEEKDAY_SHORT() {
+ return WEEKDAY_SHORT;
+ }
+
+}
Copied: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java (from rev 927, bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java)
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,192 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util;
+
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONException;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONValue;
+
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class JSONWalk
+{
+ private JSONValue root;
+
+
+ private JSONWalk(JSONValue root)
+ {
+ this.root = root;
+ }
+
+ public static JSONWalk on(JSONValue root)
+ {
+ return new JSONWalk(root);
+ }
+
+ public JSONWrapper next(String name)
+ {
+ if (null == root || root.isObject() == null) return null;
+ JSONObject rootObject = root.isObject();
+
+ JSONWrapper match = null;
+ Set<String> keySet = rootObject.keySet();
+
+ Iterator it = keySet.iterator();
+ while (it.hasNext())
+ {
+ String s = (String) it.next();
+ JSONValue child = rootObject.get(s);
+ if (name.equals(s))
+ {
+ match = new JSONWrapper(child);
+ break;
+ }
+ else
+ {
+ match = JSONWalk.on(child).next(name);
+ }
+ }
+
+ return match;
+ }
+
+ public class JSONWrapper
+ {
+
+ private JSONValue value;
+
+ public JSONWrapper(JSONValue value)
+ {
+ this.value = value;
+ }
+
+ public int asInt()
+ {
+ if (value.isNumber() != null)
+ {
+ return new Double(value.isNumber().getValue()).intValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a number: " + value);
+ }
+ }
+
+ public long asLong()
+ {
+ if (value.isNumber() != null)
+ {
+ return new Double(value.isNumber().getValue()).longValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a number: " + value);
+ }
+ }
+
+ public double asDouble()
+ {
+ if (value.isNumber() != null)
+ {
+ return value.isNumber().getValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a number: " + value);
+ }
+ }
+
+ public String asString()
+ {
+ if (value.isString() != null)
+ {
+ return value.isString().stringValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a string: " + value);
+ }
+ }
+
+ public boolean asBool()
+ {
+ if (value.isBoolean() != null)
+ {
+ return value.isBoolean().booleanValue();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a boolean: " + value);
+ }
+ }
+
+ public Date asDate()
+ {
+ if (value.isString() != null)
+ {
+ SimpleDateFormat df = new SimpleDateFormat();
+ return df.parse(value.isString().stringValue());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a date string: " + value);
+ }
+ }
+
+
+ public JSONArray asArray()
+ {
+ if (value.isArray() != null)
+ {
+ return value.isArray();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a number: " + value);
+ }
+ }
+
+ public JSONObject asObject()
+ {
+ if (value.isObject() != null)
+ {
+ return value.isObject();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not an object: " + value);
+ }
+ }
+
+
+ public String toString() throws JSONException
+ {
+ return value.toString();
+ }
+ }
+}
Copied: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java (from rev 899, bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java)
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MapEntry
+{
+ String name;
+ Object value;
+
+ public MapEntry(String name, Object value)
+ {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Object getValue()
+ {
+ return value;
+ }
+}
Copied: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java (from rev 927, bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java)
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
+ *
+ * Licensed 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.jboss.bpm.console.client.util;
+
+import java.util.Date;
+
+@SuppressWarnings("deprecation")
+public class SimpleDateFormat {
+ private String format;
+ private DateLocale locale = new DateLocale();
+ public static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss";
+
+
+ /**
+ * Gets the support locale for formatting and parsing dates
+ * @return
+ */
+ public DateLocale getLocale() {
+ return locale;
+ }
+
+ public void setLocale(DateLocale locale) {
+ this.locale = locale;
+ }
+
+ /**
+ * Use {@link #DEFAULT_FORMAT}
+ */
+ public SimpleDateFormat()
+ {
+ format = DEFAULT_FORMAT;
+ }
+
+ /**
+ * Use a custom format
+ */
+ public SimpleDateFormat(String pattern) {
+ format = pattern;
+ }
+
+ public String format(Date date) {
+ String f = "";
+ if (format != null && format.length() > 0) {
+ String lastTokenType = null;
+ String currentToken = "";
+ for (int i = 0; i < format.length(); i++) {
+ String thisChar = format.substring(i, i + 1);
+ String currentTokenType = DateLocale.SUPPORTED_DF_TOKENS
+ .contains(thisChar) ? thisChar : "";
+ if (currentTokenType.equals(lastTokenType) || i == 0) {
+ currentToken += thisChar;
+ lastTokenType = currentTokenType;
+ } else {
+ if ("".equals(lastTokenType))
+ f += currentToken;
+ else
+ f += handleToken(currentToken, date);
+ currentToken = thisChar;
+ lastTokenType = currentTokenType;
+ }
+ }
+ if ("".equals(lastTokenType))
+ f += currentToken;
+ else
+ f += handleToken(currentToken, date);
+ }
+ return f;
+ }
+
+ /**
+ * takes a date format string and returns the formatted portion of the date.
+ * For instance if the token is MMMM then the full month name is returned.
+ *
+ * @param token
+ * date format token
+ * @param date
+ * date to format
+ * @return formatted portion of the date
+ */
+ private String handleToken(String token, Date date) {
+ String response = token;
+ String tc = token.substring(0, 1);
+ if (DateLocale.TOKEN_DAY_OF_WEEK.equals(tc)) {
+ if (token.length() > 3)
+ response = locale.getWEEKDAY_LONG()[date.getDay()];
+ else
+ response = locale.getWEEKDAY_SHORT()[date.getDay()];
+ } else if (DateLocale.TOKEN_DAY_OF_MONTH.equals(tc)) {
+ if (token.length() == 1)
+ response = Integer.toString(date.getDate());
+ else
+ response = twoCharDateField(date.getDate());
+ } else if (DateLocale.TOKEN_MONTH.equals(tc)) {
+ switch (token.length()) {
+ case 1:
+ response = Integer.toString(date.getMonth() + 1);
+ break;
+ case 2:
+ response = twoCharDateField(date.getMonth() + 1);
+ break;
+ case 3:
+ response = locale.MONTH_SHORT[date.getMonth()];
+ break;
+ default:
+ response = locale.MONTH_LONG[date.getMonth()];
+ break;
+ }
+ } else if (DateLocale.TOKEN_YEAR.equals(tc)) {
+ if (token.length() > 2)
+ response = Integer.toString(date.getYear() + 1900);
+ else
+ response = twoCharDateField(date.getYear());
+ } else if (DateLocale.TOKEN_HOUR_12.equals(tc)) {
+ int h = date.getHours();
+ if (h == 0)
+ h = 12;
+ else if (h > 12)
+ h -= 12;
+ if (token.length() > 1)
+ response = twoCharDateField(h);
+ else
+ response = Integer.toString(h);
+ } else if (DateLocale.TOKEN_HOUR_24.equals(tc)) {
+ if (token.length() > 1)
+ response = twoCharDateField(date.getHours());
+ else
+ response = Integer.toString(date.getHours());
+ } else if (DateLocale.TOKEN_MINUTE.equals(tc)) {
+ if (token.length() > 1)
+ response = twoCharDateField(date.getMinutes());
+ else
+ response = Integer.toString(date.getMinutes());
+ } else if (DateLocale.TOKEN_SECOND.equals(tc)) {
+ if (token.length() > 1)
+ response = twoCharDateField(date.getSeconds());
+ else
+ response = Integer.toString(date.getSeconds());
+ } else if (DateLocale.TOKEN_AM_PM.equals(tc)) {
+ int hour = date.getHours();
+ if (hour > 11)
+ response = DateLocale.getPM();
+ else
+ response = DateLocale.getAM();
+ }
+ return response;
+ }
+
+ /**
+ * This is basically just a sneaky way to guarantee that our 1 or 2 digit
+ * numbers come out as a 2 character string. we add an arbitrary number
+ * larger than 100, convert this new number to a string, then take the right
+ * most 2 characters.
+ *
+ * @param num
+ * @return
+ */
+ private String twoCharDateField(int num) {
+ String res = Integer.toString(num + 1900);
+ res = res.substring(res.length() - 2);
+ return res;
+ }
+
+ private static Date newDate(long time) {
+ return new Date(time);
+ }
+
+ /**
+ * Parses text and returns the corresponding date object.
+ *
+ * @param source
+ * @return java.util.Date
+ */
+ public Date parse(String source){
+ return SimpleDateParser.parse(source, format);
+ };
+
+}
\ No newline at end of file
Copied: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java (from rev 899, bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java)
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
+ *
+ * Licensed 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.jboss.bpm.console.client.util;
+
+import org.jboss.bpm.console.client.util.regex.Pattern;
+
+import java.util.Date;
+
+
+/**
+ * This is a simple regular expression based parser for date notations.
+ * While our aim is to fully support in the future the JDK date parser, currently
+ * only numeric notations and literals are supported such as <code>dd/MM/yyyy HH:mm:ss.SSSS</code>.
+ * Each entity is parsed with the same number of digits, i.e. for <code>dd</code> two digits will be
+ * parsed while for <code>d</code> only one will be parsed.
+ * @author <a href="mailto:g.georgovassilis@gmail.com">George Georgovassilis</a>
+ *
+ */
+
+@SuppressWarnings("deprecation")
+public class SimpleDateParser {
+
+
+ private final static String DAY_IN_MONTH = "d";
+
+ private final static String MONTH = "M";
+
+ private final static String YEAR = "y";
+
+ private final static String LITERAL = "\\";
+
+ private final static int DATE_PATTERN = 0;
+
+ private final static int REGEX_PATTERN = 1;
+
+ private final static int COMPONENT = 2;
+
+ private final static int REGEX = 0;
+
+ private final static int INSTRUCTION = 1;
+
+ private final static String[] TOKENS[] = {
+ { "SSSS", "(\\d\\d\\d\\d)",DateLocale.TOKEN_MILLISECOND },
+ { "SSS", "(\\d\\d\\d)", DateLocale.TOKEN_MILLISECOND },
+ { "SS", "(\\d\\d)", DateLocale.TOKEN_MILLISECOND },
+ { "S", "(\\d)", DateLocale.TOKEN_MILLISECOND },
+ { "ss", "(\\d\\d)", DateLocale.TOKEN_SECOND },
+ { "s", "(\\d)", DateLocale.TOKEN_SECOND },
+ { "mm", "(\\d\\d)", DateLocale.TOKEN_MINUTE },
+ { "m", "(\\d)", DateLocale.TOKEN_MINUTE},
+ { "HH", "(\\d\\d)", DateLocale.TOKEN_HOUR_24},
+ { "H", "(\\d)", DateLocale.TOKEN_HOUR_24 },
+ { "dd", "(\\d\\d)", DateLocale.TOKEN_DAY_OF_MONTH },
+ { "d", "(\\d)", DateLocale.TOKEN_DAY_OF_MONTH },
+ { "MM", "(\\d\\d)", DateLocale.TOKEN_MONTH },
+ { "M", "(\\d)", DateLocale.TOKEN_MONTH },
+ { "yyyy", "(\\d\\d\\d\\d)", DateLocale.TOKEN_YEAR },
+ { "yyy", "(\\d\\d\\d)", DateLocale.TOKEN_YEAR },
+ { "yy", "(\\d\\d)", DateLocale.TOKEN_YEAR },
+ { "y", "(\\d)", DateLocale.TOKEN_YEAR }
+ };
+
+ private Pattern regularExpression;
+
+ private String instructions = "";
+
+ private static void _parse(String format, String[] args) {
+ if (format.length() == 0)
+ return;
+ if (format.startsWith("'")){
+ format = format.substring(1);
+ int end = format.indexOf("'");
+ if (end == -1)
+ throw new IllegalArgumentException("Unmatched single quotes.");
+ args[REGEX]+=Pattern.quote(format.substring(0,end));
+ format = format.substring(end+1);
+ }
+ for (int i = 0; i < TOKENS.length; i++) {
+ String[] row = TOKENS[i];
+ String datePattern = row[DATE_PATTERN];
+ if (!format.startsWith(datePattern))
+ continue;
+ format = format.substring(datePattern.length());
+ args[REGEX] += row[REGEX_PATTERN];
+ args[INSTRUCTION] += row[COMPONENT];
+ _parse(format, args);
+ return;
+ }
+ args[REGEX] += Pattern.quote(""+format.charAt(0));
+ format = format.substring(1);
+ _parse(format, args);
+ }
+
+ private static void load(Date date, String text, String component) {
+ if (component.equals(DateLocale.TOKEN_MILLISECOND)) {
+ //TODO: implement
+ }
+
+ if (component.equals(DateLocale.TOKEN_SECOND)) {
+ date.setSeconds(Integer.parseInt(text));
+ }
+
+ if (component.equals(DateLocale.TOKEN_MINUTE)) {
+ date.setMinutes(Integer.parseInt(text));
+ }
+
+ if (component.equals(DateLocale.TOKEN_HOUR_24)) {
+ date.setHours(Integer.parseInt(text));
+ }
+
+ if (component.equals(DateLocale.TOKEN_DAY_OF_MONTH)) {
+ date.setDate(Integer.parseInt(text));
+ }
+ if (component.equals(DateLocale.TOKEN_MONTH)) {
+ date.setMonth(Integer.parseInt(text)-1);
+ }
+ if (component.equals(DateLocale.TOKEN_YEAR)) {
+ //TODO: fix for short patterns
+ date.setYear(Integer.parseInt(text)-1900);
+ }
+
+ }
+
+ public SimpleDateParser(String format) {
+ String[] args = new String[] { "", "" };
+ _parse(format, args);
+ regularExpression = new Pattern(args[REGEX]);
+ instructions = args[INSTRUCTION];
+ }
+
+ public Date parse(String input) {
+ Date date = new Date(0, 0, 1, 0, 0, 0);
+ String matches[] = regularExpression.match(input);
+ if (matches == null)
+ throw new IllegalArgumentException(input+" does not match "+regularExpression.pattern());
+ if (matches.length-1!=instructions.length())
+ throw new IllegalArgumentException("Different group count - "+input+" does not match "+regularExpression.pattern());
+ for (int group = 0; group < instructions.length(); group++) {
+ String match = matches[group + 1];
+ load(date, match, ""+instructions.charAt(group));
+ }
+ return date;
+ }
+
+ public static Date parse(String input, String pattern){
+ return new SimpleDateParser(pattern).parse(input);
+ }
+}
Copied: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex (from rev 899, bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/regex)
Deleted: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java 2009-12-10 13:53:53 UTC (rev 899)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,186 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util.regex;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.google.gwt.core.client.JavaScriptObject;
-
-/**
- * <p>
- * Implementation of the {@link java.util.regex.Pattern} class with a
- * wrapper aroung the Javascript <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Regular_Ex...">RegExp</a> object.
- * As most of the methods delegate to the JavaScript RegExp object, certain differences in the
- * declaration and behaviour of regular expressions must be expected.
- * </p>
- * <p>
- * Please note that neither the {@link java.util.regex.Pattern#compile(String)} method nor
- * {@link Matcher} instances are supported. For the later, consider using {@link Pattern#match(String)}.
- * </p>
- *
- * @author George Georgovassilis
- *
- */
-public class Pattern {
-
- /**
- * Declares that regular expressions should be matched across line borders.
- */
- public final static int MULTILINE = 1;
-
- /**
- * Declares that characters are matched reglardless of case.
- */
- public final static int CASE_INSENSITIVE = 2;
-
- private JavaScriptObject regExp;
-
- private static JavaScriptObject createExpression(String pattern, int flags) {
- String sFlags = "";
- if ((flags & MULTILINE) != 0)
- sFlags += "m";
- if ((flags & CASE_INSENSITIVE) != 0)
- sFlags += "i";
- return _createExpression(pattern, sFlags);
- }
-
- private static native JavaScriptObject _createExpression(String pattern,
- String flags)/*-{
- return new RegExp(pattern, flags);
- }-*/;
-
- private native void _match(String text, List matches)/*-{
- var regExp = this.@org.jboss.bpm.console.client.util.regex.Pattern::regExp;
- var result = text.match(regExp);
- if (result == null) return;
- for (var i=0;i<result.length;i++)
- matches.@java.util.ArrayList::add(Ljava/lang/Object;)(result[i]);
- }-*/;
-
- /**
- * Determines wether the specified regular expression is validated by the
- * provided input.
- * @param regex Regular expression
- * @param input String to validate
- * @return <code>true</code> if matched.
- */
- public static boolean matches(String regex, String input) {
- return new Pattern(regex).matches(input);
- }
-
- /**
- * Escape a provided string so that it will be interpreted as a literal
- * in regular expressions.
- * The current implementation does escape each character even if not neccessary,
- * generating verbose literals.
- * @param input
- * @return
- */
- public static String quote(String input) {
- String output = "";
- for (int i = 0; i < input.length(); i++) {
- output += "\\" + input.charAt(i);
- }
- return output;
- }
-
- /**
- * Class constructor
- * @param pattern Regular expression
- */
- public Pattern(String pattern) {
- this(pattern, 0);
- }
-
- /**
- * Class constructor
- * @param pattern Regular expression
- * @param flags
- */
- public Pattern(String pattern, int flags) {
- regExp = createExpression(pattern, flags);
- }
-
- /**
- * This method is borrowed from the JavaScript RegExp object.
- * It parses a string and returns as an array any assignments to parenthesis groups
- * in the pattern's regular expression
- * @param text
- * @return Array of strings following java's Pattern convention for groups:
- * Group 0 is the entire input string and the remaining groups are the matched parenthesis.
- * In case nothing was matched an empty array is returned.
- */
- public String[] match(String text) {
- List matches = new ArrayList();
- _match(text, matches);
- String arr[] = new String[matches.size()];
- for (int i = 0; i < matches.size(); i++)
- arr[i] = matches.get(i).toString();
- return arr;
- }
-
- /**
- * Determines wether a provided text matches the regular expression
- * @param text
- * @return
- */
- public native boolean matches(String text)/*-{
- var regExp = this.@org.jboss.bpm.console.client.util.regex.Pattern::regExp;
- return regExp.test(text);
- }-*/;
-
- /**
- * Returns the regular expression for this pattern
- * @return
- */
- public native String pattern()/*-{
- var regExp = this.@org.jboss.bpm.console.client.util.regex.Pattern::regExp;
- return regExp.source;
- }-*/;
-
- private native void _split(String input, List results)/*-{
- var regExp = this.@org.jboss.bpm.console.client.util.regex.Pattern::regExp;
- var parts = input.split(regExp);
- for (var i=0;i<parts.length;i++)
- results.@java.util.ArrayList::add(Ljava/lang/Object;)(parts[i] );
- }-*/;
-
- /**
- * Split an input string by the pattern's regular expression
- * @param input
- * @return Array of strings
- */
- public String[] split(String input){
- List results = new ArrayList();
- _split(input, results);
- String[] parts = new String[results.size()];
- for (int i=0;i<results.size();i++)
- parts[i] = (String)results.get(i);
- return parts;
- }
-
- public String toString() {
- return regExp.toString();
- }
-}
-
Copied: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java (from rev 927, bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java)
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -0,0 +1,186 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util.regex;
+
+import com.google.gwt.core.client.JavaScriptObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * Implementation of the {@link java.util.regex.Pattern} class with a
+ * wrapper aroung the Javascript <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Regular_Ex...">RegExp</a> object.
+ * As most of the methods delegate to the JavaScript RegExp object, certain differences in the
+ * declaration and behaviour of regular expressions must be expected.
+ * </p>
+ * <p>
+ * Please note that neither the {@link java.util.regex.Pattern#compile(String)} method nor
+ * {@link Matcher} instances are supported. For the later, consider using {@link Pattern#match(String)}.
+ * </p>
+ *
+ * @author George Georgovassilis
+ *
+ */
+public class Pattern {
+
+ /**
+ * Declares that regular expressions should be matched across line borders.
+ */
+ public final static int MULTILINE = 1;
+
+ /**
+ * Declares that characters are matched reglardless of case.
+ */
+ public final static int CASE_INSENSITIVE = 2;
+
+ private JavaScriptObject regExp;
+
+ private static JavaScriptObject createExpression(String pattern, int flags) {
+ String sFlags = "";
+ if ((flags & MULTILINE) != 0)
+ sFlags += "m";
+ if ((flags & CASE_INSENSITIVE) != 0)
+ sFlags += "i";
+ return _createExpression(pattern, sFlags);
+ }
+
+ private static native JavaScriptObject _createExpression(String pattern,
+ String flags)/*-{
+ return new RegExp(pattern, flags);
+ }-*/;
+
+ private native void _match(String text, List matches)/*-{
+ var regExp = this.@org.jboss.bpm.console.client.util.regex.Pattern::regExp;
+ var result = text.match(regExp);
+ if (result == null) return;
+ for (var i=0;i<result.length;i++)
+ matches.@java.util.ArrayList::add(Ljava/lang/Object;)(result[i]);
+ }-*/;
+
+ /**
+ * Determines wether the specified regular expression is validated by the
+ * provided input.
+ * @param regex Regular expression
+ * @param input String to validate
+ * @return <code>true</code> if matched.
+ */
+ public static boolean matches(String regex, String input) {
+ return new Pattern(regex).matches(input);
+ }
+
+ /**
+ * Escape a provided string so that it will be interpreted as a literal
+ * in regular expressions.
+ * The current implementation does escape each character even if not neccessary,
+ * generating verbose literals.
+ * @param input
+ * @return
+ */
+ public static String quote(String input) {
+ String output = "";
+ for (int i = 0; i < input.length(); i++) {
+ output += "\\" + input.charAt(i);
+ }
+ return output;
+ }
+
+ /**
+ * Class constructor
+ * @param pattern Regular expression
+ */
+ public Pattern(String pattern) {
+ this(pattern, 0);
+ }
+
+ /**
+ * Class constructor
+ * @param pattern Regular expression
+ * @param flags
+ */
+ public Pattern(String pattern, int flags) {
+ regExp = createExpression(pattern, flags);
+ }
+
+ /**
+ * This method is borrowed from the JavaScript RegExp object.
+ * It parses a string and returns as an array any assignments to parenthesis groups
+ * in the pattern's regular expression
+ * @param text
+ * @return Array of strings following java's Pattern convention for groups:
+ * Group 0 is the entire input string and the remaining groups are the matched parenthesis.
+ * In case nothing was matched an empty array is returned.
+ */
+ public String[] match(String text) {
+ List matches = new ArrayList();
+ _match(text, matches);
+ String arr[] = new String[matches.size()];
+ for (int i = 0; i < matches.size(); i++)
+ arr[i] = matches.get(i).toString();
+ return arr;
+ }
+
+ /**
+ * Determines wether a provided text matches the regular expression
+ * @param text
+ * @return
+ */
+ public native boolean matches(String text)/*-{
+ var regExp = this.@org.jboss.bpm.console.client.util.regex.Pattern::regExp;
+ return regExp.test(text);
+ }-*/;
+
+ /**
+ * Returns the regular expression for this pattern
+ * @return
+ */
+ public native String pattern()/*-{
+ var regExp = this.@org.jboss.bpm.console.client.util.regex.Pattern::regExp;
+ return regExp.source;
+ }-*/;
+
+ private native void _split(String input, List results)/*-{
+ var regExp = this.@org.jboss.bpm.console.client.util.regex.Pattern::regExp;
+ var parts = input.split(regExp);
+ for (var i=0;i<parts.length;i++)
+ results.@java.util.ArrayList::add(Ljava/lang/Object;)(parts[i] );
+ }-*/;
+
+ /**
+ * Split an input string by the pattern's regular expression
+ * @param input
+ * @return Array of strings
+ */
+ public String[] split(String input){
+ List results = new ArrayList();
+ _split(input, results);
+ String[] parts = new String[results.size()];
+ for (int i=0;i<results.size();i++)
+ parts[i] = (String)results.get(i);
+ return parts;
+ }
+
+ public String toString() {
+ return regExp.toString();
+ }
+}
+
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,334 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.http.client.*;
-import com.google.gwt.json.client.JSONArray;
-import com.google.gwt.json.client.JSONObject;
-import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.json.client.JSONValue;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import org.gwt.mosaic.ui.client.MessageBox;
-import org.jboss.bpm.console.client.util.ConsoleLog;
-import org.jboss.bpm.console.client.util.JSONWalk;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-public class Authentication
-{
- private AuthCallback callback;
-
- private List<String> rolesAssigned = new ArrayList<String>();
-
- private String sid;
- private String username;
- private String password;
-
- private ConsoleConfig config;
- private String rolesUrl;
- private Date loggedInSince;
-
- public Authentication(ConsoleConfig config, String sessionID, String rolesUrl)
- {
- this.config = config;
- this.sid = sessionID;
- this.rolesUrl = rolesUrl;
- this.loggedInSince = new Date();
- }
-
- public String getSid()
- {
- return sid;
- }
-
- public void login(String user, String pass)
- {
- this.username = user;
- this.password = pass;
-
- String formAction = config.getConsoleServerUrl() + "/rs/identity/secure/j_security_check";
- RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, formAction);
- rb.setHeader("Content-Type", "application/x-www-form-urlencoded");
-
- try
- {
- rb.sendRequest("j_username="+user+"&j_password="+pass,
- new RequestCallback()
- {
-
- public void onResponseReceived(Request request, Response response)
- {
- ConsoleLog.debug("postLoginCredentials() HTTP "+response.getStatusCode());
-
- if(response.getText().indexOf("HTTP 401")!=-1) // HACK
- {
- if (callback != null)
- callback.onLoginFailed(request, new Exception("Authentication failed"));
- else
- throw new RuntimeException("Unknown exception upon login attempt");
- }
- else if(response.getStatusCode()==200) // it's always 200, even when the authentication fails
- {
- DeferredCommand.addCommand(
- new Command()
- {
-
- public void execute()
- {
- requestAssignedRoles();
- }
- }
- );
- }
- }
-
- public void onError(Request request, Throwable t)
- {
- if (callback != null)
- callback.onLoginFailed(request, new Exception("Authentication failed"));
- else
- throw new RuntimeException("Unknown exception upon login attempt");
- }
- }
- );
- }
- catch (RequestException e)
- {
- ConsoleLog.error("Request error", e);
- }
- }
-
- public Date getLoggedInSince()
- {
- return loggedInSince;
- }
-
- /**
- * Login using specific credentials.
- * This delegates to {@link com.google.gwt.http.client.RequestBuilder#setUser(String)}
- * and {@link com.google.gwt.http.client.RequestBuilder#setPassword(String)}
- */
- private void requestAssignedRoles()
- {
- RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, rolesUrl );
-
- ConsoleLog.debug("Request roles: " + rb.getUrl());
-
- /*if (user != null && pass != null)
- {
- rb.setUser(user);
- rb.setPassword(pass);
-
- if (!GWT.isScript()) // hosted mode only
- {
- rb.setHeader("xtest-user", user);
- rb.setHeader("xtest-pass", pass); // NOTE: This is plaintext, use for testing only
- }
- }*/
-
- try
- {
- rb.sendRequest(null,
- new RequestCallback()
- {
-
- public void onResponseReceived(Request request, Response response)
- {
- ConsoleLog.debug("requestAssignedRoles() HTTP "+response.getStatusCode());
-
- // parse roles
- if (200 == response.getStatusCode())
- {
- rolesAssigned = Authentication.parseRolesAssigned(response.getText());
- if (callback != null) callback.onLoginSuccess(request, response);
- }
- else
- {
- onError(request, new Exception(response.getText()));
- }
- }
-
- public void onError(Request request, Throwable t)
- {
- // auth failed
- // Couldn't connect to server (could be timeout, SOP violation, etc.)
- if (callback != null)
- callback.onLoginFailed(request, t);
- else
- throw new RuntimeException("Unknown exception upon login attempt", t);
- }
- });
- }
-
- catch (RequestException e1)
- {
- // Couldn't connect to server
- throw new RuntimeException("Unknown error upon login attempt", e1);
- }
- }
-
-
- public void setCallback(AuthCallback callback)
- {
- this.callback = callback;
- }
-
- private native void reload() /*-{
- $wnd.location.reload();
- }-*/;
-
- public static void logout(final ConsoleConfig conf)
- {
- RequestBuilder rb = new RequestBuilder(
- RequestBuilder.POST,
- conf.getConsoleServerUrl()+"/rs/identity/sid/invalidate"
- );
-
- try
- {
- rb.sendRequest(null, new RequestCallback()
- {
- public void onResponseReceived(Request request, Response response)
- {
- ConsoleLog.debug("logout() HTTP "+response.getStatusCode());
-
- if(response.getStatusCode()!=200)
- {
- ConsoleLog.error(response.getText());
- }
- }
-
- public void onError(Request request, Throwable t)
- {
- ConsoleLog.error("Failed to invalidate session", t);
- }
- });
- }
- catch (RequestException e)
- {
- ConsoleLog.error("Request error", e);
- }
- }
-
- public void logoutAndReload()
- {
- RequestBuilder rb = new RequestBuilder(
- RequestBuilder.POST,
- config.getConsoleServerUrl()+"/rs/identity/sid/invalidate"
- );
-
- try
- {
- rb.sendRequest(null, new RequestCallback()
- {
- public void onResponseReceived(Request request, Response response)
- {
- ConsoleLog.debug("logoutAndReload() HTTP "+response.getStatusCode());
- resetState();
- reload();
- }
-
- public void onError(Request request, Throwable t)
- {
- ConsoleLog.error("Failed to invalidate session", t);
- }
- });
- }
- catch (RequestException e)
- {
- ConsoleLog.error("Request error", e);
- }
- }
-
- private void resetState()
- {
- sid = null;
- username = null;
- password = null;
- rolesAssigned = new ArrayList<String>();
- loggedInSince = null;
- }
-
- public void handleSessionTimeout()
- {
- MessageBox.confirm("Session expired", "Please login again",
- new MessageBox.ConfirmationCallback()
- {
- public void onResult(boolean b)
- {
- // regardless of the choice, force login
- logoutAndReload();
- }
- }
- );
- }
-
-
- public interface AuthCallback
- {
- void onLoginSuccess(Request request, Response response);
-
- void onLoginFailed(Request request, Throwable t);
- }
-
-
- public List<String> getRolesAssigned()
- {
- return rolesAssigned;
- }
-
- public String getUsername()
- {
- return username;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public static List<String> parseRolesAssigned(String json)
- {
- // parse roles
- List<String> roles = new ArrayList<String>();
-
- JSONValue root = JSONParser.parse(json);
- JSONArray array = JSONWalk.on(root).next("roles").asArray();
-
- for (int i = 0; i < array.size(); ++i)
- {
- JSONObject item = array.get(i).isObject();
- boolean assigned = JSONWalk.on(item).next("assigned").asBool();
- String roleName = JSONWalk.on(item).next("role").asString();
-
- if (assigned)
- {
- roles.add(roleName);
- }
- }
-
- return roles;
- }
-}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,173 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.client.Dictionary;
-
-/**
- * Initialize console config from host page (<code>Application.html</code>) variable:
- * <pre>
- * var consoleConfig = {
- * consoleServerUrl: "http://localhost:8080/gwt-console-server",
- * reportServerUrl: "http://localhost:8080/report",
- * [...]
- * };
- * </pre>
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- * @see com.google.gwt.i18n.client.Dictionary
- */
-public class ConsoleConfig
-{
- private String serverWebContext;
-
- private String overallReportFile;
- private String processSummaryReportFile;
- private String instanceSummaryReportFile;
-
- private String profileName;
- private String logo;
-
- private String consoleServerUrl;
-
- private String defaultEditor;
-
- public ConsoleConfig(String proxyUrl)
- {
- Dictionary theme = Dictionary.getDictionary("consoleConfig");
- profileName = theme.get("profileName");
- logo = theme.get("logo");
-
- serverWebContext = theme.get("serverWebContext");
-
- overallReportFile = theme.get("overallReportFile");
- processSummaryReportFile = theme.get("processSummaryReportFile");
- instanceSummaryReportFile = theme.get("instanceSummaryReportFile");
-
- defaultEditor = theme.get("defaultEditor");
-
- if(null==proxyUrl)
- {
- // extract host
- String base = GWT.getHostPageBaseURL();
- String protocol = base.substring(0, base.indexOf("//")+2);
- String noProtocol = base.substring(base.indexOf(protocol)+protocol.length(), base.length());
- String host = noProtocol.substring(0, noProtocol.indexOf("/"));
-
- // default url
- consoleServerUrl = protocol + host + serverWebContext;
- }
- else
- {
- consoleServerUrl = proxyUrl;
- }
-
- // features
-
- }
-
- public String getHost()
- {
- String host = null;
- if(!GWT.isScript()) // development with proxy
- {
- host = consoleServerUrl;
- }
- else
- {
- String baseUrl = GWT.getModuleBaseURL();
- host = baseUrl.substring(
- 0, baseUrl.indexOf("app")
- );
- }
-
- return host;
- }
-
- public String getProfileName()
- {
- return profileName;
- }
-
- public String getLogo()
- {
- return logo;
- }
-
- public String getDefaultEditor()
- {
- return defaultEditor;
- }
-
- public String getConsoleServerUrl()
- {
- if(consoleServerUrl ==null)
- throw new RuntimeException("Config not properly setup: console server URL is null");
- return consoleServerUrl;
- }
-
- public void setConsoleServerUrl(String consoleServerUrl)
- {
- this.consoleServerUrl = consoleServerUrl;
- }
-
- public String getServerWebContext()
- {
- return serverWebContext;
- }
-
- public void setServerWebContext(String serverWebContext)
- {
- this.serverWebContext = serverWebContext;
- }
-
- public String getOverallReportFile()
- {
- return overallReportFile;
- }
-
- public void setOverallReportFile(String overallReportFile)
- {
- this.overallReportFile = overallReportFile;
- }
-
- public String getProcessSummaryReportFile()
- {
- return processSummaryReportFile;
- }
-
- public void setProcessSummaryReportFile(String processSummaryReportFile)
- {
- this.processSummaryReportFile = processSummaryReportFile;
- }
-
- public String getInstanceSummaryReportFile()
- {
- return instanceSummaryReportFile;
- }
-
- public void setInstanceSummaryReportFile(String instanceSummaryReportFile)
- {
- this.instanceSummaryReportFile = instanceSummaryReportFile;
- }
-}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Preferences.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Preferences.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Preferences.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.user.client.Cookies;
-
-import java.util.Date;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class Preferences
-{
- // Editor that should be launched at startup
- public static final String BPM_DEFAULT_TOOL = "bpm.default.tool";
-
- public static boolean has(String key)
- {
- return Preferences.get(key)!=null;
- }
-
- public static String get(String key)
- {
- return Cookies.getCookie(key);
- }
-
- public static void set(String key, String value)
- {
- Date twoWeeks = new Date(System.currentTimeMillis()+(2*604800*1000));
- Cookies.setCookie(key, value, twoWeeks);
- }
-
- public static void clear(String key)
- {
- Cookies.removeCookie(key);
- }
-}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/UIConstants.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/UIConstants.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/UIConstants.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class UIConstants
-{
- public static final int OVERALL_WIDTH = 1024;
- public static final int OVERALL_HEIGHT = 768;
- public static final int MAIN_MENU_MIN = 175;
- public static final int MAIN_MENU_MAX = 400;
- public static final int EDITOR_WIDTH = 680;
- public static final int TEASER_PANEL_WIDTH = 200;
- public static final int EDITOR_PANEL_WIDTH = 450;
-
- public static final String DEFAULT_TRANSITION = "default transition";
- public static final String DATE_FORMAT = "yyyy-m-j H:i:s"; //08-10-02 13:51:27
-}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/ConsoleLog.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-/**
- * The maven gwt:test mojo treats any output to stderr as
- * a test failure. gwt-log does dump some information there,
- * hence we need to proxy log invocation and be able to disable them at all.
- * <p/>
- * If you want to test the application, make sure to lauch it using
- * {@link org.jboss.bpm.console.client.Application#onModuleLoad2()}.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class ConsoleLog
-{
- private static boolean enabled = true; // see javadoc comments
-
- public static void warn(String msg)
- {
- if (enabled)
- com.allen_sauer.gwt.log.client.Log.warn(msg);
- }
-
- public static void info(String msg)
- {
- if (enabled)
- com.allen_sauer.gwt.log.client.Log.info(msg);
- }
-
- public static void debug(String msg)
- {
- if (enabled)
- com.allen_sauer.gwt.log.client.Log.debug(msg);
- }
-
- public static void error(String msg)
- {
- if (enabled)
- com.allen_sauer.gwt.log.client.Log.error(msg);
- }
-
- public static void error(String msg, Throwable t)
- {
- if (enabled)
- com.allen_sauer.gwt.log.client.Log.error(msg, t);
- }
-
- public static void setUncaughtExceptionHandler()
- {
- if (enabled)
- com.allen_sauer.gwt.log.client.Log.setUncaughtExceptionHandler();
- }
-
- public static boolean isEnabled()
- {
- return enabled;
- }
-
- public static void setEnabled(boolean enabled)
- {
- ConsoleLog.enabled = enabled;
- }
-}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/DateLocale.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,86 +0,0 @@
-/*
- * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
- *
- * Licensed 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.jboss.bpm.console.client.util;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Date locale support for the {@link SimpleDateParser}. You are encouraged to
- * extend this class and provide implementations for other locales.
- * @author <a href="mailto:g.georgovassilis@gmail.com">George Georgovassilis</a>
- *
- */
-public class DateLocale {
- public final static String TOKEN_DAY_OF_WEEK = "E";
-
- public final static String TOKEN_DAY_OF_MONTH = "d";
-
- public final static String TOKEN_MONTH = "M";
-
- public final static String TOKEN_YEAR = "y";
-
- public final static String TOKEN_HOUR_12 = "h";
-
- public final static String TOKEN_HOUR_24 = "H";
-
- public final static String TOKEN_MINUTE = "m";
-
- public final static String TOKEN_SECOND = "s";
-
- public final static String TOKEN_MILLISECOND = "S";
-
- public final static String TOKEN_AM_PM = "a";
-
- public final static String AM = "AM";
-
- public final static String PM = "PM";
-
- public final static List SUPPORTED_DF_TOKENS = Arrays.asList(new String[] {
- TOKEN_DAY_OF_WEEK, TOKEN_DAY_OF_MONTH, TOKEN_MONTH, TOKEN_YEAR,
- TOKEN_HOUR_12, TOKEN_HOUR_24, TOKEN_MINUTE, TOKEN_SECOND,
- TOKEN_AM_PM });
-
- public String[] MONTH_LONG = { "January", "February", "March", "April",
- "May", "June", "July", "August", "September", "October",
- "November", "December" };
-
- public String[] MONTH_SHORT = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" };
-
- public String[] WEEKDAY_LONG = { "Sunday", "Monday", "Tuesday",
- "Wednesday", "Thursday", "Friday", "Saturday" };
-
- public String[] WEEKDAY_SHORT = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
- "Sat" };
-
- public static String getAM() {
- return AM;
- }
-
- public static String getPM() {
- return PM;
- }
-
- public String[] getWEEKDAY_LONG() {
- return WEEKDAY_LONG;
- }
-
- public String[] getWEEKDAY_SHORT() {
- return WEEKDAY_SHORT;
- }
-
-}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,192 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.google.gwt.json.client.JSONArray;
-import com.google.gwt.json.client.JSONException;
-import com.google.gwt.json.client.JSONObject;
-import com.google.gwt.json.client.JSONValue;
-
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class JSONWalk
-{
- private JSONValue root;
-
-
- private JSONWalk(JSONValue root)
- {
- this.root = root;
- }
-
- public static JSONWalk on(JSONValue root)
- {
- return new JSONWalk(root);
- }
-
- public JSONWrapper next(String name)
- {
- if (null == root || root.isObject() == null) return null;
- JSONObject rootObject = root.isObject();
-
- JSONWrapper match = null;
- Set<String> keySet = rootObject.keySet();
-
- Iterator it = keySet.iterator();
- while (it.hasNext())
- {
- String s = (String) it.next();
- JSONValue child = rootObject.get(s);
- if (name.equals(s))
- {
- match = new JSONWrapper(child);
- break;
- }
- else
- {
- match = JSONWalk.on(child).next(name);
- }
- }
-
- return match;
- }
-
- public class JSONWrapper
- {
-
- private JSONValue value;
-
- public JSONWrapper(JSONValue value)
- {
- this.value = value;
- }
-
- public int asInt()
- {
- if (value.isNumber() != null)
- {
- return new Double(value.isNumber().getValue()).intValue();
- }
- else
- {
- throw new IllegalArgumentException("Not a number: " + value);
- }
- }
-
- public long asLong()
- {
- if (value.isNumber() != null)
- {
- return new Double(value.isNumber().getValue()).longValue();
- }
- else
- {
- throw new IllegalArgumentException("Not a number: " + value);
- }
- }
-
- public double asDouble()
- {
- if (value.isNumber() != null)
- {
- return value.isNumber().getValue();
- }
- else
- {
- throw new IllegalArgumentException("Not a number: " + value);
- }
- }
-
- public String asString()
- {
- if (value.isString() != null)
- {
- return value.isString().stringValue();
- }
- else
- {
- throw new IllegalArgumentException("Not a string: " + value);
- }
- }
-
- public boolean asBool()
- {
- if (value.isBoolean() != null)
- {
- return value.isBoolean().booleanValue();
- }
- else
- {
- throw new IllegalArgumentException("Not a boolean: " + value);
- }
- }
-
- public Date asDate()
- {
- if (value.isString() != null)
- {
- SimpleDateFormat df = new SimpleDateFormat();
- return df.parse(value.isString().stringValue());
- }
- else
- {
- throw new IllegalArgumentException("Not a date string: " + value);
- }
- }
-
-
- public JSONArray asArray()
- {
- if (value.isArray() != null)
- {
- return value.isArray();
- }
- else
- {
- throw new IllegalArgumentException("Not a number: " + value);
- }
- }
-
- public JSONObject asObject()
- {
- if (value.isObject() != null)
- {
- return value.isObject();
- }
- else
- {
- throw new IllegalArgumentException("Not an object: " + value);
- }
- }
-
-
- public String toString() throws JSONException
- {
- return value.toString();
- }
- }
-}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/MapEntry.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class MapEntry
-{
- String name;
- Object value;
-
- public MapEntry(String name, Object value)
- {
- this.name = name;
- this.value = value;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Object getValue()
- {
- return value;
- }
-}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,190 +0,0 @@
-/*
- * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
- *
- * Licensed 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.jboss.bpm.console.client.util;
-
-import java.util.Date;
-
-@SuppressWarnings("deprecation")
-public class SimpleDateFormat {
- private String format;
- private DateLocale locale = new DateLocale();
- public static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss";
-
-
- /**
- * Gets the support locale for formatting and parsing dates
- * @return
- */
- public DateLocale getLocale() {
- return locale;
- }
-
- public void setLocale(DateLocale locale) {
- this.locale = locale;
- }
-
- /**
- * Use {@link #DEFAULT_FORMAT}
- */
- public SimpleDateFormat()
- {
- format = DEFAULT_FORMAT;
- }
-
- /**
- * Use a custom format
- */
- public SimpleDateFormat(String pattern) {
- format = pattern;
- }
-
- public String format(Date date) {
- String f = "";
- if (format != null && format.length() > 0) {
- String lastTokenType = null;
- String currentToken = "";
- for (int i = 0; i < format.length(); i++) {
- String thisChar = format.substring(i, i + 1);
- String currentTokenType = DateLocale.SUPPORTED_DF_TOKENS
- .contains(thisChar) ? thisChar : "";
- if (currentTokenType.equals(lastTokenType) || i == 0) {
- currentToken += thisChar;
- lastTokenType = currentTokenType;
- } else {
- if ("".equals(lastTokenType))
- f += currentToken;
- else
- f += handleToken(currentToken, date);
- currentToken = thisChar;
- lastTokenType = currentTokenType;
- }
- }
- if ("".equals(lastTokenType))
- f += currentToken;
- else
- f += handleToken(currentToken, date);
- }
- return f;
- }
-
- /**
- * takes a date format string and returns the formatted portion of the date.
- * For instance if the token is MMMM then the full month name is returned.
- *
- * @param token
- * date format token
- * @param date
- * date to format
- * @return formatted portion of the date
- */
- private String handleToken(String token, Date date) {
- String response = token;
- String tc = token.substring(0, 1);
- if (DateLocale.TOKEN_DAY_OF_WEEK.equals(tc)) {
- if (token.length() > 3)
- response = locale.getWEEKDAY_LONG()[date.getDay()];
- else
- response = locale.getWEEKDAY_SHORT()[date.getDay()];
- } else if (DateLocale.TOKEN_DAY_OF_MONTH.equals(tc)) {
- if (token.length() == 1)
- response = Integer.toString(date.getDate());
- else
- response = twoCharDateField(date.getDate());
- } else if (DateLocale.TOKEN_MONTH.equals(tc)) {
- switch (token.length()) {
- case 1:
- response = Integer.toString(date.getMonth() + 1);
- break;
- case 2:
- response = twoCharDateField(date.getMonth() + 1);
- break;
- case 3:
- response = locale.MONTH_SHORT[date.getMonth()];
- break;
- default:
- response = locale.MONTH_LONG[date.getMonth()];
- break;
- }
- } else if (DateLocale.TOKEN_YEAR.equals(tc)) {
- if (token.length() > 2)
- response = Integer.toString(date.getYear() + 1900);
- else
- response = twoCharDateField(date.getYear());
- } else if (DateLocale.TOKEN_HOUR_12.equals(tc)) {
- int h = date.getHours();
- if (h == 0)
- h = 12;
- else if (h > 12)
- h -= 12;
- if (token.length() > 1)
- response = twoCharDateField(h);
- else
- response = Integer.toString(h);
- } else if (DateLocale.TOKEN_HOUR_24.equals(tc)) {
- if (token.length() > 1)
- response = twoCharDateField(date.getHours());
- else
- response = Integer.toString(date.getHours());
- } else if (DateLocale.TOKEN_MINUTE.equals(tc)) {
- if (token.length() > 1)
- response = twoCharDateField(date.getMinutes());
- else
- response = Integer.toString(date.getMinutes());
- } else if (DateLocale.TOKEN_SECOND.equals(tc)) {
- if (token.length() > 1)
- response = twoCharDateField(date.getSeconds());
- else
- response = Integer.toString(date.getSeconds());
- } else if (DateLocale.TOKEN_AM_PM.equals(tc)) {
- int hour = date.getHours();
- if (hour > 11)
- response = DateLocale.getPM();
- else
- response = DateLocale.getAM();
- }
- return response;
- }
-
- /**
- * This is basically just a sneaky way to guarantee that our 1 or 2 digit
- * numbers come out as a 2 character string. we add an arbitrary number
- * larger than 100, convert this new number to a string, then take the right
- * most 2 characters.
- *
- * @param num
- * @return
- */
- private String twoCharDateField(int num) {
- String res = Integer.toString(num + 1900);
- res = res.substring(res.length() - 2);
- return res;
- }
-
- private static Date newDate(long time) {
- return new Date(time);
- }
-
- /**
- * Parses text and returns the corresponding date object.
- *
- * @param source
- * @return java.util.Date
- */
- public Date parse(String source){
- return SimpleDateParser.parse(source, format);
- };
-
-}
\ No newline at end of file
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java 2010-01-25 12:55:27 UTC (rev 930)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateParser.java 2010-01-25 13:03:41 UTC (rev 931)
@@ -1,161 +0,0 @@
-/*
- * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
- *
- * Licensed 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.jboss.bpm.console.client.util;
-
-import org.jboss.bpm.console.client.util.regex.Pattern;
-
-import java.util.Date;
-
-
-/**
- * This is a simple regular expression based parser for date notations.
- * While our aim is to fully support in the future the JDK date parser, currently
- * only numeric notations and literals are supported such as <code>dd/MM/yyyy HH:mm:ss.SSSS</code>.
- * Each entity is parsed with the same number of digits, i.e. for <code>dd</code> two digits will be
- * parsed while for <code>d</code> only one will be parsed.
- * @author <a href="mailto:g.georgovassilis@gmail.com">George Georgovassilis</a>
- *
- */
-
-@SuppressWarnings("deprecation")
-public class SimpleDateParser {
-
-
- private final static String DAY_IN_MONTH = "d";
-
- private final static String MONTH = "M";
-
- private final static String YEAR = "y";
-
- private final static String LITERAL = "\\";
-
- private final static int DATE_PATTERN = 0;
-
- private final static int REGEX_PATTERN = 1;
-
- private final static int COMPONENT = 2;
-
- private final static int REGEX = 0;
-
- private final static int INSTRUCTION = 1;
-
- private final static String[] TOKENS[] = {
- { "SSSS", "(\\d\\d\\d\\d)",DateLocale.TOKEN_MILLISECOND },
- { "SSS", "(\\d\\d\\d)", DateLocale.TOKEN_MILLISECOND },
- { "SS", "(\\d\\d)", DateLocale.TOKEN_MILLISECOND },
- { "S", "(\\d)", DateLocale.TOKEN_MILLISECOND },
- { "ss", "(\\d\\d)", DateLocale.TOKEN_SECOND },
- { "s", "(\\d)", DateLocale.TOKEN_SECOND },
- { "mm", "(\\d\\d)", DateLocale.TOKEN_MINUTE },
- { "m", "(\\d)", DateLocale.TOKEN_MINUTE},
- { "HH", "(\\d\\d)", DateLocale.TOKEN_HOUR_24},
- { "H", "(\\d)", DateLocale.TOKEN_HOUR_24 },
- { "dd", "(\\d\\d)", DateLocale.TOKEN_DAY_OF_MONTH },
- { "d", "(\\d)", DateLocale.TOKEN_DAY_OF_MONTH },
- { "MM", "(\\d\\d)", DateLocale.TOKEN_MONTH },
- { "M", "(\\d)", DateLocale.TOKEN_MONTH },
- { "yyyy", "(\\d\\d\\d\\d)", DateLocale.TOKEN_YEAR },
- { "yyy", "(\\d\\d\\d)", DateLocale.TOKEN_YEAR },
- { "yy", "(\\d\\d)", DateLocale.TOKEN_YEAR },
- { "y", "(\\d)", DateLocale.TOKEN_YEAR }
- };
-
- private Pattern regularExpression;
-
- private String instructions = "";
-
- private static void _parse(String format, String[] args) {
- if (format.length() == 0)
- return;
- if (format.startsWith("'")){
- format = format.substring(1);
- int end = format.indexOf("'");
- if (end == -1)
- throw new IllegalArgumentException("Unmatched single quotes.");
- args[REGEX]+=Pattern.quote(format.substring(0,end));
- format = format.substring(end+1);
- }
- for (int i = 0; i < TOKENS.length; i++) {
- String[] row = TOKENS[i];
- String datePattern = row[DATE_PATTERN];
- if (!format.startsWith(datePattern))
- continue;
- format = format.substring(datePattern.length());
- args[REGEX] += row[REGEX_PATTERN];
- args[INSTRUCTION] += row[COMPONENT];
- _parse(format, args);
- return;
- }
- args[REGEX] += Pattern.quote(""+format.charAt(0));
- format = format.substring(1);
- _parse(format, args);
- }
-
- private static void load(Date date, String text, String component) {
- if (component.equals(DateLocale.TOKEN_MILLISECOND)) {
- //TODO: implement
- }
-
- if (component.equals(DateLocale.TOKEN_SECOND)) {
- date.setSeconds(Integer.parseInt(text));
- }
-
- if (component.equals(DateLocale.TOKEN_MINUTE)) {
- date.setMinutes(Integer.parseInt(text));
- }
-
- if (component.equals(DateLocale.TOKEN_HOUR_24)) {
- date.setHours(Integer.parseInt(text));
- }
-
- if (component.equals(DateLocale.TOKEN_DAY_OF_MONTH)) {
- date.setDate(Integer.parseInt(text));
- }
- if (component.equals(DateLocale.TOKEN_MONTH)) {
- date.setMonth(Integer.parseInt(text)-1);
- }
- if (component.equals(DateLocale.TOKEN_YEAR)) {
- //TODO: fix for short patterns
- date.setYear(Integer.parseInt(text)-1900);
- }
-
- }
-
- public SimpleDateParser(String format) {
- String[] args = new String[] { "", "" };
- _parse(format, args);
- regularExpression = new Pattern(args[REGEX]);
- instructions = args[INSTRUCTION];
- }
-
- public Date parse(String input) {
- Date date = new Date(0, 0, 1, 0, 0, 0);
- String matches[] = regularExpression.match(input);
- if (matches == null)
- throw new IllegalArgumentException(input+" does not match "+regularExpression.pattern());
- if (matches.length-1!=instructions.length())
- throw new IllegalArgumentException("Different group count - "+input+" does not match "+regularExpression.pattern());
- for (int group = 0; group < instructions.length(); group++) {
- String match = matches[group + 1];
- load(date, match, ""+instructions.charAt(group));
- }
- return date;
- }
-
- public static Date parse(String input, String pattern){
- return new SimpleDateParser(pattern).parse(input);
- }
-}
16 years, 6 months
Overlord SVN: r930 - in bpm-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client/engine and 4 other directories.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-25 07:55:27 -0500 (Mon, 25 Jan 2010)
New Revision: 930
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LazyPanel.java
Removed:
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/model/
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
Log:
Remove dependencies on BPM workspace
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import org.gwt.mosaic.ui.client.Viewport;
+
+/**
+ * Provides context information to console components and plugins.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface ApplicationContext
+{
+ Workspace getWorkpace();
+
+ void displayMessage(String message, boolean isError);
+
+ Authentication getAuthentication();
+
+ ConsoleConfig getConfig();
+
+ Viewport getViewport();
+
+ void refreshView();
+
+}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LazyPanel.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LazyPanel.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LazyPanel.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface LazyPanel
+{
+ boolean isInitialized();
+
+ /**
+ * Expected to be an idempotent implementation
+ */
+ void initialize();
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -34,6 +34,7 @@
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.common.HeaderLabel;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.Registry;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -64,7 +65,7 @@
this.add(tabPanel);
- appContext.refreshView();
+ Registry.get(ApplicationContext.class).refreshView();
isInitialized = true;
}
@@ -110,12 +111,12 @@
HeaderLabel server = new HeaderLabel("Server Info");
layoutPanel.add(server, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- ServerStatusView serverStatus = new ServerStatusView(appContext);
+ ServerStatusView serverStatus = new ServerStatusView(Registry.get(ApplicationContext.class));
serverStatus.initialize();
MosaicPanel layout2 = new MosaicPanel(new GridLayout(2,2));
layout2.add(new HTML("Host:"));
- layout2.add(new HTML(appContext.getConfig().getConsoleServerUrl()));
+ layout2.add(new HTML(Registry.get(ApplicationContext.class).getConfig().getConsoleServerUrl()));
layout2.add(new Label("Plugins:"));
layout2.add(serverStatus);
@@ -145,7 +146,7 @@
return new MenuSection(
getTitle(),
AbstractImagePrototype.create(icons.settingsIcon()),
- new SettingsEditorNavigation(appContext)
+ new SettingsEditorNavigation(Registry.get(ApplicationContext.class))
);
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -25,11 +25,13 @@
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.MenuSection;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.errai.workspaces.client.EditorWidget;
import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
/**
* Manage runtime aspects of a process engine
@@ -57,7 +59,7 @@
tabPanel = (TabLayoutPanel)editorWidget.build();
EngineEditor.this.add(tabPanel);
editorWidget.loadData();
- appContext.refreshView();
+ Registry.get(ApplicationContext.class).refreshView();
isInitialized = true;
}
@@ -87,7 +89,7 @@
return new MenuSection(
getTitle(),
AbstractImagePrototype.create(icons.runtimeIcon()),
- new EngineEditorNavigation(appContext)
+ new EngineEditorNavigation(Registry.get(ApplicationContext.class))
);
}
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -25,11 +25,13 @@
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.MenuSection;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.errai.workspaces.client.EditorWidget;
import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -52,7 +54,7 @@
tabPanel = (TabLayoutPanel)editorWidget.build();
ProcessEditor.this.add(tabPanel);
editorWidget.loadData();
- appContext.refreshView();
+ Registry.get(ApplicationContext.class).refreshView();
isInitialized = true;
}
@@ -82,7 +84,7 @@
return new MenuSection(
getTitle(),
AbstractImagePrototype.create(icons.processIcon()),
- new ProcessEditorNavigation(super.appContext)
+ new ProcessEditorNavigation(Registry.get(ApplicationContext.class))
);
}
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -28,11 +28,13 @@
import org.gwt.mosaic.ui.client.ImageButton;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.MenuSection;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.errai.workspaces.client.EditorWidget;
import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -55,7 +57,7 @@
tabPanel = (TabLayoutPanel)editorWidget.build();
ReportEditor.this.add(tabPanel);
editorWidget.loadData();
- appContext.refreshView();
+ Registry.get(ApplicationContext.class).refreshView();
isInitialized = true;
}
@@ -85,7 +87,7 @@
return new MenuSection(
getTitle(),
AbstractImagePrototype.create(icons.reportIcon()),
- new ReportEditorNavigation(appContext)
+ new ReportEditorNavigation(Registry.get(ApplicationContext.class))
);
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -25,11 +25,13 @@
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.MenuSection;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.errai.workspaces.client.EditorWidget;
import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -52,7 +54,7 @@
tabPanel = (TabLayoutPanel)editorWidget.build();
TaskEditor.this.add(tabPanel);
editorWidget.loadData();
- appContext.refreshView();
+ Registry.get(ApplicationContext.class).refreshView();
isInitialized = true;
}
@@ -82,7 +84,7 @@
return new MenuSection(
getTitle(),
AbstractImagePrototype.create(icons.taskIcon()),
- new TaskEditorNavigation(appContext)
+ new TaskEditorNavigation(Registry.get(ApplicationContext.class))
);
}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import org.gwt.mosaic.ui.client.Viewport;
-
-/**
- * Provides context information to console components and plugins.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public interface ApplicationContext
-{
- Workspace getWorkpace();
-
- void displayMessage(String message, boolean isError);
-
- Authentication getAuthentication();
-
- ConsoleConfig getConfig();
-
- Viewport getViewport();
-
- void refreshView();
-
-}
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -37,8 +37,6 @@
* Controller.handleEvent( new Event(...));
* </code>
* <p/>
- * By default every editor get's it's own controller that delegates to the main {@link org.jboss.bpm.console.client.ApplicationContext}
- * controller as it's parent.
*
* <h2>Layout</h2>
* Each Editor uses a {@link org.gwt.mosaic.ui.client.layout.BorderLayout} by default.
@@ -46,10 +44,8 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public abstract class Editor
- extends org.gwt.mosaic.ui.client.layout.LayoutPanel
- implements LazyPanel
+ extends org.gwt.mosaic.ui.client.layout.LayoutPanel
{
- protected ApplicationContext appContext;
protected Controller controller;
@@ -57,8 +53,7 @@
public Editor()
{
- super();
- this.appContext = Registry.get(ApplicationContext.class);
+ super();
this.controller = Registry.get(Controller.class);
}
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public interface LazyPanel
-{
- boolean isInitialized();
-
- /**
- * Expected to be an idempotent implementation
- */
- void initialize();
-}
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2010-01-25 12:15:43 UTC (rev 929)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2010-01-25 12:55:27 UTC (rev 930)
@@ -24,7 +24,6 @@
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import org.gwt.mosaic.ui.client.DeckLayoutPanel;
-import org.jboss.errai.workspaces.client.Registry;
import java.util.ArrayList;
import java.util.List;
@@ -36,13 +35,11 @@
*/
public class Workspace extends DeckLayoutPanel
{
- protected ApplicationContext appContext;
private Menu menu;
public Workspace(Menu menu)
{
super();
- this.appContext = Registry.get(ApplicationContext.class);
this.menu = menu;
this.setPadding(5);
16 years, 6 months
Overlord SVN: r929 - in bpm-console/trunk: gui/war/src/main/java/org/jboss/bpm/console and 16 other directories.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-25 07:15:43 -0500 (Mon, 25 Jan 2010)
New Revision: 929
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorModule.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidget.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidgetClient.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/Registry.java
bpm-console/trunk/workspace/workspace-api/src/main/resources/org/
bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/
bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/BPMWorkspace.gwt.xml
Removed:
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java
Modified:
bpm-console/trunk/gui/war/pom.xml
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/UpdateReportConfigAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
bpm-console/trunk/gui/war/war/app.html
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
Log:
Introduce split points per editor. Start migrating API into errai package
Modified: bpm-console/trunk/gui/war/pom.xml
===================================================================
--- bpm-console/trunk/gui/war/pom.xml 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/pom.xml 2010-01-25 12:15:43 UTC (rev 929)
@@ -526,25 +526,5 @@
</profile>
</profiles>
-
- <reporting>
- <excludeDefaults>true</excludeDefaults>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>gwt-maven-plugin</artifactId>
- <reportSets>
- <reportSet>
- <reports>
- <report>soyc</report>
- </reports>
- </reportSet>
- </reportSets>
- <configuration>
- <extra>target</extra>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
+
</project>
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml 2010-01-25 12:15:43 UTC (rev 929)
@@ -9,6 +9,7 @@
<inherits name="com.google.gwt.i18n.I18N"/>
<inherits name="com.google.gwt.user.ImageBundle"/>
<inherits name="com.google.gwt.xml.XML" />
+ <inherits name="org.jboss.BPMWorkspace" />
<!-- Add gwt-log support, default level `DEBUG` -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -29,6 +29,7 @@
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.JSOParser;
import org.jboss.bpm.console.client.model.ServerStatus;
+import org.jboss.errai.workspaces.client.Registry;
/**
* Bootstrap the console form server settings.
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -42,6 +42,7 @@
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
import org.jboss.bpm.console.client.util.WindowUtil;
+import org.jboss.errai.workspaces.client.Registry;
import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
@@ -72,7 +73,8 @@
this.config = config;
Registry.set(ApplicationContext.class, this);
-
+ Registry.set(Controller.class, controller);
+
display();
}
@@ -192,7 +194,7 @@
private Workspace createWorkspace()
{
- Workspace workspace = new Workspace(menu, this);
+ Workspace workspace = new Workspace(menu);
WorkspaceLauncher launcher = GWT.create(WorkspaceLauncher.class);
launcher.launch(workspace); // calls Workspace.addEditor()
return workspace;
@@ -205,12 +207,7 @@
{
return viewport;
}
-
- public Controller getController()
- {
- return this.controller;
- }
-
+
public void displayMessage(final String message, final boolean isError)
{
if(isError)
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -32,6 +32,7 @@
import org.gwt.mosaic.ui.client.layout.GridLayout;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.common.HeaderLabel;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -28,7 +28,10 @@
import org.gwt.mosaic.ui.client.DeckLayoutPanel;
import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.GridLayout;
+import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.common.HeaderLabel;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
@@ -59,7 +62,7 @@
tabPanel.add(deck, "Settings");
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+ this.add(tabPanel);
appContext.refreshView();
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -27,8 +27,8 @@
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.LoadingStatusAction;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.workspaces.client.Registry;
import java.io.IOException;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -23,26 +23,18 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.SourcesTabEvents;
-import com.google.gwt.user.client.ui.TabListener;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import org.gwt.mosaic.ui.client.layout.BorderLayout;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
import org.jboss.bpm.console.client.Editor;
-import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* Manage runtime aspects of a process engine
* (currently jbpm only).
- *
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class EngineEditor extends Editor
@@ -51,83 +43,33 @@
private TabLayoutPanel tabPanel;
- private Map<String,Integer> view2index = new HashMap<String,Integer>();
+ //private Map<String,Integer> view2index = new HashMap<String,Integer>();
public void initialize()
{
if(!isInitialized)
{
-
- // create inner tab layout
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
-
- tabPanel.addTabListener(
- new TabListener()
+ EngineEditorModule.createAsync(
+ new EditorWidgetClient()
{
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onSuccess(EditorWidget editorWidget)
{
- boolean showTab = true;
- return showTab;
+ tabPanel = (TabLayoutPanel)editorWidget.build();
+ EngineEditor.this.add(tabPanel);
+ editorWidget.loadData();
+ appContext.refreshView();
+ isInitialized = true;
}
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onUnavailable()
{
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- if(!lazyPanel.isInitialized())
- {
- lazyPanel.initialize();
- appContext.refreshView(); // TODO: hack around rendering problems
- }
-
- // load jobs
- if(1==i)
- {
- controller.handleEvent(
- new Event(UpdateJobsAction.ID, null)
- );
- }
+ MessageBox.error("Error", "Failed to load module "+ID);
}
}
);
-
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
-
- // create and register views
- registerView(DeploymentListView.ID, new DeploymentListView());
- registerView(JobListView.ID, new JobListView(appContext));
-
- // create and register actions
- controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction());
- controller.addAction(UpdateDeploymentDetailAction.ID, new UpdateDeploymentDetailAction());
- controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction());
- controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction());
- controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction());
- controller.addAction(ExecuteJobAction.ID, new ExecuteJobAction());
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab( view2index.get(DeploymentListView.ID ));
-
- // force loading
- super.controller.handleEvent(
- new Event(UpdateDeploymentsAction.ID, null)
- );
-
- isInitialized = true;
}
}
- private void registerView(String id, AbstractView view)
- {
- view2index.put(id, tabPanel.getWidgetCount());
-
- // register view with controller
- super.controller.addView(id, view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getIconTitle(), true);
- }
-
public String getEditorId()
{
return ID;
@@ -148,12 +90,4 @@
new EngineEditorNavigation(appContext)
);
}
-
- public void showView(String viewId)
- {
- if(viewId!=null)
- tabPanel.selectTab( view2index.get(viewId) );
- else
- tabPanel.selectTab(0);
- }
}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorModule.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorModule.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorModule.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
+
+public class EngineEditorModule
+{
+
+ private static TabLayoutPanel tabPanel;
+
+ //private Map<String,Integer> view2index = new HashMap<String,Integer>();
+
+ public static void createAsync(
+ final EditorWidgetClient client)
+ {
+ GWT.runAsync(new RunAsyncCallback() {
+ public void onFailure(Throwable err) {
+ client.onUnavailable();
+ }
+
+ public void onSuccess() {
+
+ final Controller controller = Registry.get(Controller.class);
+
+ if (tabPanel == null)
+ tabPanel = createTabPanel(controller);
+
+ client.onSuccess(
+ new EditorWidget()
+ {
+ public Widget build()
+ {
+ return tabPanel;
+ }
+
+ public void loadData()
+ {
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+ };
+
+ t.schedule(50);
+ }
+ }
+ );
+ }
+ });
+ }
+
+ private static TabLayoutPanel createTabPanel(final Controller controller)
+ {
+
+ final ApplicationContext appContext = Registry.get(ApplicationContext.class);
+
+ // create inner tab layout
+ final TabLayoutPanel tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+
+ // load jobs
+ if(1==i)
+ {
+ controller.handleEvent(
+ new Event(UpdateJobsAction.ID, null)
+ );
+ }
+ }
+ }
+ );
+
+ // create and register views
+ registerView(controller, tabPanel, DeploymentListView.ID, new DeploymentListView());
+ registerView(controller, tabPanel, JobListView.ID, new JobListView(appContext));
+
+ // create and register actions
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction());
+ controller.addAction(UpdateDeploymentDetailAction.ID, new UpdateDeploymentDetailAction());
+ controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction());
+ controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction());
+ controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction());
+ controller.addAction(ExecuteJobAction.ID, new ExecuteJobAction());
+
+ // display tab, needs to visible for correct rendering
+ //tabPanel.selectTab( view2index.get(DeploymentListView.ID ));
+
+ tabPanel.selectTab(0);
+
+ return tabPanel;
+ }
+
+ private static void registerView(Controller controller, TabLayoutPanel tabPanel, String id, AbstractView view)
+ {
+ //view2index.put(id, tabPanel.getWidgetCount());
+
+ // register view with controller
+ controller.addView(id, view);
+
+ // add to tab layout
+ tabPanel.add(view, view.getIconTitle(), true);
+ }
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -49,11 +49,11 @@
if("Deployments".equals(treeItem.getText()))
{
- workspace.showEditor(EngineEditor.ID, DeploymentListView.ID);
+ workspace.showEditor(EngineEditor.ID, null);
}
else if("Jobs".equals(treeItem.getText()))
{
- workspace.showEditor(EngineEditor.ID, JobListView.ID);
+ workspace.showEditor(EngineEditor.ID, null);
}
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -25,8 +25,8 @@
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.Workspace;
+import org.jboss.errai.workspaces.client.Registry;
/**
* Cross editor view toggle.
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -42,6 +42,7 @@
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.process.events.InstanceEvent;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.List;
@@ -74,10 +75,10 @@
private PagingPanel pagingPanel;
- public InstanceListView(ApplicationContext appContext)
+ public InstanceListView()
{
super();
- this.appContext = appContext;
+ this.appContext = Registry.get(ApplicationContext.class);
ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
setTitle("Process Instances");
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -23,22 +23,14 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.SourcesTabEvents;
-import com.google.gwt.user.client.ui.TabListener;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
import org.jboss.bpm.console.client.Editor;
-import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
-import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -46,91 +38,33 @@
{
public final static String ID = ProcessEditor.class.getName();
- private TabLayoutPanel tabPanel;
+ private static TabLayoutPanel tabPanel;
public void initialize()
{
if(!isInitialized)
{
- // create inner tab layout
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
- tabPanel.addTabListener(
- new TabListener()
+ ProcessEditorModule.createAsync(
+ new EditorWidgetClient()
{
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onSuccess(EditorWidget editorWidget)
{
- boolean showTab = true;
-
- if(i!=0)
- {
- DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
- boolean hasSelection = view.getSelection() != null;
- if(!hasSelection)
- {
- MessageBox.alert("Missing selection", "Please select a process");
- showTab=false;
- }
- }
-
- if(showTab)
- {
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- lazyPanel.initialize();
- }
-
- return showTab;
+ tabPanel = (TabLayoutPanel)editorWidget.build();
+ ProcessEditor.this.add(tabPanel);
+ editorWidget.loadData();
+ appContext.refreshView();
+ isInitialized = true;
}
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onUnavailable()
{
-
+ MessageBox.error("Error", "Failed to load module "+ID);
}
- }
+ }
);
-
- this.add(tabPanel, new BorderLayoutData(Region.CENTER));
-
- // create and register views
- registerView(DefinitionListView.ID, new DefinitionListView());
- registerView(InstanceListView.ID, new InstanceListView(appContext));
-
- // create and register actions
-
- registerAction(UpdateInstancesAction.ID, new UpdateInstancesAction());
- registerAction(StartNewInstanceAction.ID, new StartNewInstanceAction());
- registerAction(StateChangeAction.ID, new StateChangeAction());
- registerAction(DeleteDefinitionAction.ID, new DeleteDefinitionAction());
- registerAction(DeleteInstanceAction.ID, new DeleteInstanceAction());
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab(0);
-
- // force loading
- super.controller.handleEvent(
- new Event(UpdateDefinitionsAction.ID, null)
- );
-
- appContext.refreshView();
-
- isInitialized = true;
}
}
-
- private void registerView(String id, AbstractView view)
- {
- // register view with controller
- super.controller.addView(id, view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getIconTitle(), true);
- }
-
- private void registerAction(String name, ActionInterface action)
- {
- super.controller.addAction(name, action);
- }
-
+
public String getEditorId()
{
return ID;
@@ -148,7 +82,7 @@
return new MenuSection(
getTitle(),
AbstractImagePrototype.create(icons.processIcon()),
- new ProcessEditorNavigation(appContext)
+ new ProcessEditorNavigation(super.appContext)
);
}
}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorModule.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorModule.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorModule.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
+
+public class ProcessEditorModule
+{
+ // the module instance; instantiate it behind a runAsync
+ private static TabLayoutPanel tabPanel;
+
+ /**
+ * Access the module's instance. The callback
+ * runs asynchronously, once the necessary
+ * code has downloaded.
+ */
+ public static void createAsync(
+ final EditorWidgetClient client)
+ {
+ GWT.runAsync(new RunAsyncCallback() {
+ public void onFailure(Throwable err) {
+ client.onUnavailable();
+ }
+
+ public void onSuccess() {
+
+ final Controller controller = Registry.get(Controller.class);
+
+ if (tabPanel == null) {
+ tabPanel = createTabPanel(controller);
+ }
+ client.onSuccess(
+ new EditorWidget()
+ {
+ public Widget build()
+ {
+ return tabPanel;
+ }
+
+ public void loadData()
+ {
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+ };
+
+ t.schedule(50);
+ }
+ }
+ );
+ }
+ });
+ }
+
+ private static TabLayoutPanel createTabPanel(final Controller controller)
+ {
+ // create inner tab layout
+ final TabLayoutPanel tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+
+ if(i!=0)
+ {
+ DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
+ boolean hasSelection = view.getSelection() != null;
+ if(!hasSelection)
+ {
+ MessageBox.alert("Missing selection", "Please select a process");
+ showTab=false;
+ }
+ }
+
+ if(showTab)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ lazyPanel.initialize();
+ }
+
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+
+ }
+ }
+ );
+
+ // create and register views
+ registerView(controller, tabPanel, DefinitionListView.ID, new DefinitionListView());
+ registerView(controller, tabPanel, InstanceListView.ID, new InstanceListView());
+
+ // create and register actions
+
+ registerAction(controller, UpdateInstancesAction.ID, new UpdateInstancesAction());
+ registerAction(controller, StartNewInstanceAction.ID, new StartNewInstanceAction());
+ registerAction(controller, StateChangeAction.ID, new StateChangeAction());
+ registerAction(controller, DeleteDefinitionAction.ID, new DeleteDefinitionAction());
+ registerAction(controller, DeleteInstanceAction.ID, new DeleteInstanceAction());
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ return tabPanel;
+
+ }
+
+ private static void registerView(Controller controller, TabLayoutPanel tabPanel, String id, AbstractView view)
+ {
+ // register view with controller
+ controller.addView(id, view);
+
+ // add to tab layout
+ tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ private static void registerAction(Controller controller, String name, ActionInterface action)
+ {
+ controller.addAction(name, action);
+ }
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -27,8 +27,8 @@
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.LoadingStatusAction;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.workspaces.client.Registry;
import java.io.IOException;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -24,110 +24,50 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.*;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
-import com.mvc4g.client.ViewInterface;
import org.gwt.mosaic.ui.client.Caption;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.ImageButton;
-import org.gwt.mosaic.ui.client.layout.BorderLayout;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
import org.jboss.bpm.console.client.Editor;
-import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class ReportEditor extends Editor implements ViewInterface
+public class ReportEditor extends Editor
{
public final static String ID = ReportEditor.class.getName();
- private DecoratedTabLayoutPanel tabPanel;
+ private TabLayoutPanel tabPanel;
- public void setController(Controller controller)
- {
- }
-
public void initialize()
{
if(!isInitialized())
{
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
- tabPanel.addTabListener(
- new TabListener()
+ ReportEditorModule.createAsync(
+ new EditorWidgetClient()
{
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onSuccess(EditorWidget editorWidget)
{
- boolean showTab = true;
-
- if(i!=0)
- {
- /*DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
- boolean hasSelection = view.getSelection() != null;
- if(!hasSelection)
- {
- MessageBox.alert("Missing selection", "Please select a process");
- showTab=false;
- } */
- }
-
- return showTab;
+ tabPanel = (TabLayoutPanel)editorWidget.build();
+ ReportEditor.this.add(tabPanel);
+ editorWidget.loadData();
+ appContext.refreshView();
+ isInitialized = true;
}
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onUnavailable()
{
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- if(!lazyPanel.isInitialized())
- {
- lazyPanel.initialize();
- }
+ MessageBox.error("Error", "Failed to load module "+ID);
}
}
);
-
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
-
- // create and register views
- ReportView view = new ReportView();
- registerView(ReportView.ID, view);
- view.initialize();
-
- controller.addView(ID, this);
-
- // create and register actions
- registerAction(UpdateReportConfigAction.ID, new UpdateReportConfigAction());
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab(0);
-
- // load report config
- controller.handleEvent(new Event(UpdateReportConfigAction.ID, null));
-
- appContext.refreshView();
-
- this.isInitialized = true;
}
}
- private void registerView(String id, AbstractView view)
- {
- // register view with controller
- super.controller.addView(id, view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getIconTitle(), true);
- }
-
- private void registerAction(String name, ActionInterface action)
- {
- super.controller.addAction(name, action);
- }
-
public String getEditorId()
{
return ID;
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorModule.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorModule.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorModule.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.report;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
+
+public class ReportEditorModule
+{
+ public final static String ID = ReportEditor.class.getName();
+
+ private static TabLayoutPanel tabPanel;
+
+ public static void createAsync(
+ final EditorWidgetClient client)
+ {
+ GWT.runAsync(new RunAsyncCallback() {
+ public void onFailure(Throwable err) {
+ client.onUnavailable();
+ }
+
+ public void onSuccess() {
+
+ final Controller controller = Registry.get(Controller.class);
+
+ if (tabPanel == null)
+ tabPanel = createTabPanel(controller);
+
+ client.onSuccess(
+ new EditorWidget()
+ {
+ public Widget build()
+ {
+ return tabPanel;
+ }
+
+ public void loadData()
+ {
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(new Event(UpdateReportConfigAction.ID, null));
+ }
+ };
+
+ t.schedule(50);
+ }
+ }
+ );
+ }
+ });
+ }
+
+ private static TabLayoutPanel createTabPanel(final Controller controller)
+ {
+ final TabLayoutPanel tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+
+ if(i!=0)
+ {
+ /*DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
+ boolean hasSelection = view.getSelection() != null;
+ if(!hasSelection)
+ {
+ MessageBox.alert("Missing selection", "Please select a process");
+ showTab=false;
+ } */
+ }
+
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ }
+ }
+ }
+ );
+
+ // create and register views
+ ReportView view = new ReportView();
+ registerView(controller, tabPanel, ReportView.ID, view);
+ view.initialize();
+
+ //controller.addView(ID, this);
+
+ // create and register actions
+ controller.addAction(UpdateReportConfigAction.ID, new UpdateReportConfigAction());
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ // load report config
+ controller.handleEvent(new Event(UpdateReportConfigAction.ID, null));
+
+
+ return tabPanel;
+ }
+
+ private static void registerView(Controller controller, TabLayoutPanel tabPanel, String id, AbstractView view)
+ {
+ // register view with controller
+ controller.addView(id, view);
+
+ // add to tab layout
+ tabPanel.add(view, view.getIconTitle(), true);
+ }
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -34,12 +34,12 @@
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.IconHeader;
import org.jboss.bpm.console.client.common.WidgetWindowPanel;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.report.model.ReportReference;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.Iterator;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/UpdateReportConfigAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/UpdateReportConfigAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/UpdateReportConfigAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -25,10 +25,10 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.JSOParser;
import org.jboss.bpm.report.model.ReportReference;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -25,7 +25,7 @@
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Registry;
+import org.jboss.errai.workspaces.client.Registry;
/**
* Reloads all task lists after assignment or completion of a task.
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -23,19 +23,13 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.SourcesTabEvents;
-import com.google.gwt.user.client.ui.TabListener;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import org.gwt.mosaic.ui.client.layout.BorderLayout;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
import org.jboss.bpm.console.client.Editor;
-import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -50,81 +44,27 @@
{
if(!isInitialized)
{
- // create inner tab layout
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
- tabPanel.addTabListener(
- new TabListener()
+ TaskEditorModule.createAsync(
+ new EditorWidgetClient()
{
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onSuccess(EditorWidget editorWidget)
{
- return true;
+ tabPanel = (TabLayoutPanel)editorWidget.build();
+ TaskEditor.this.add(tabPanel);
+ editorWidget.loadData();
+ appContext.refreshView();
+ isInitialized = true;
}
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onUnavailable()
{
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- if(!lazyPanel.isInitialized())
- {
- lazyPanel.initialize();
- appContext.refreshView(); // TODO: hack around rendering problems
- }
+ MessageBox.error("Error", "Failed to load module "+ID);
}
}
);
-
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
-
- TaskDetailView openDetailView = new TaskDetailView(true);
- TaskDetailView assignedDetailView = new TaskDetailView(false);
-
- // create and register views
- controller.addView("OpenDetailView", openDetailView);
- controller.addView("AssignedDetailView", assignedDetailView);
-
- openDetailView.initialize();
- assignedDetailView.initialize();
-
- registerView(OpenTasksView.ID, new OpenTasksView(appContext, openDetailView));
- registerView(AssignedTasksView.ID, new AssignedTasksView(appContext, assignedDetailView));
-
- // create and register actions
- registerAction(LoadTasksAction.ID, new LoadTasksAction());
- registerAction(LoadTasksParticipationAction.ID, new LoadTasksParticipationAction());
- registerAction(ClaimTaskAction.ID, new ClaimTaskAction());
- registerAction(ReleaseTaskAction.ID, new ReleaseTaskAction());
- registerAction(UpdateDetailsAction.ID, new UpdateDetailsAction());
- registerAction(AssignTaskAction.ID, new AssignTaskAction());
- registerAction(ReloadAllTaskListsAction.ID, new ReloadAllTaskListsAction());
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab(0);
-
- // force loading
- super.controller.handleEvent(
- new Event(ReloadAllTaskListsAction.ID, null)
- );
-
- appContext.refreshView();
-
- isInitialized = true;
}
}
- private void registerView(String id, AbstractView view)
- {
- // register view with controller
- super.controller.addView(id, view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getIconTitle(), true);
- }
-
- private void registerAction(String name, ActionInterface action)
- {
- super.controller.addAction(name, action);
- }
-
public String getEditorId()
{
return ID;
@@ -146,7 +86,7 @@
);
}
- public void showView(String viewId)
+ /*public void showView(String viewId)
{
if(viewId==null || viewId.equals("group"))
tabPanel.selectTab(0);
@@ -156,5 +96,5 @@
throw new IllegalArgumentException("Unknown viewId: "+viewId);
layout();
- }
+ } */
}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorModule.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorModule.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorModule.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
+
+public class TaskEditorModule
+{
+
+ private static TabLayoutPanel tabPanel;
+
+ public static void createAsync(
+ final EditorWidgetClient client)
+ {
+ GWT.runAsync(new RunAsyncCallback() {
+ public void onFailure(Throwable err) {
+ client.onUnavailable();
+ }
+
+ public void onSuccess() {
+
+ final Controller controller = Registry.get(Controller.class);
+
+ if (tabPanel == null)
+ tabPanel = createTabPanel(controller);
+
+ client.onSuccess(
+ new EditorWidget()
+ {
+ public Widget build()
+ {
+ return tabPanel;
+ }
+
+ public void loadData()
+ {
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(
+ new Event(ReloadAllTaskListsAction.ID, null)
+ );
+ }
+ };
+
+ t.schedule(50);
+ }
+ }
+ );
+ }
+ });
+ }
+
+ private static TabLayoutPanel createTabPanel(Controller controller)
+ {
+ // create inner tab layout
+ final ApplicationContext appContext= Registry.get(ApplicationContext.class);
+
+ final TabLayoutPanel tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ return true;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ TaskDetailView openDetailView = new TaskDetailView(true);
+ TaskDetailView assignedDetailView = new TaskDetailView(false);
+
+ // create and register views
+ controller.addView("OpenDetailView", openDetailView);
+ controller.addView("AssignedDetailView", assignedDetailView);
+
+ openDetailView.initialize();
+ assignedDetailView.initialize();
+
+ registerView(controller, tabPanel, OpenTasksView.ID, new OpenTasksView(appContext, openDetailView));
+ registerView(controller, tabPanel, AssignedTasksView.ID, new AssignedTasksView(appContext, assignedDetailView));
+
+ // create and register actions
+ controller.addAction(LoadTasksAction.ID, new LoadTasksAction());
+ controller.addAction(LoadTasksParticipationAction.ID, new LoadTasksParticipationAction());
+ controller.addAction(ClaimTaskAction.ID, new ClaimTaskAction());
+ controller.addAction(ReleaseTaskAction.ID, new ReleaseTaskAction());
+ controller.addAction(UpdateDetailsAction.ID, new UpdateDetailsAction());
+ controller.addAction(AssignTaskAction.ID, new AssignTaskAction());
+ controller.addAction(ReloadAllTaskListsAction.ID, new ReloadAllTaskListsAction());
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ return tabPanel;
+ }
+
+ private static void registerView(Controller controller, TabLayoutPanel tabPanel, String id, AbstractView view)
+ {
+ // register view with controller
+ controller.addView(id, view);
+
+ // add to tab layout
+ tabPanel.add(view, view.getIconTitle(), true);
+ }
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -44,15 +44,15 @@
{
public void onTreeItemSelected(TreeItem treeItem)
{
+ Workspace workspace = appContext.getWorkpace();
+
if("Group Tasks".equals(treeItem.getText()))
{
- Workspace workspace = appContext.getWorkpace();
- workspace.showEditor(TaskEditor.ID, "group");
+ workspace.showEditor(TaskEditor.ID, null);
}
else if("Personal Tasks".equals(treeItem.getText()))
- {
- Workspace workspace = appContext.getWorkpace();
- workspace.showEditor(TaskEditor.ID, "personal");
+ {
+ workspace.showEditor(TaskEditor.ID, null);
}
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -104,7 +104,7 @@
new ClassSourceFileComposerFactory(packageName, className);
// Imports
- composerFactory.addImport("org.jboss.bpm.console.client.ApplicationContext");
+ //composerFactory.addImport("org.jboss.bpm.console.client.ApplicationContext");
composerFactory.addImport("org.jboss.bpm.console.client.Workspace");
composerFactory.addImport("org.jboss.bpm.console.client.WorkspaceLauncher");
Modified: bpm-console/trunk/gui/war/war/app.html
===================================================================
--- bpm-console/trunk/gui/war/war/app.html 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/war/app.html 2010-01-25 12:15:43 UTC (rev 929)
@@ -12,7 +12,7 @@
<!-- -->
<script type="text/javascript" language="javascript" src="app/app.nocache.js"></script>
- <link rel="stylesheet" href="/console.css" type="text/css">
+ <link rel="stylesheet" href="../console.css" type="text/css">
<style type="text/css">
html, body { height: 100%; overflow: hidden; margin: 0; padding: 0; }
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -21,7 +21,6 @@
*/
package org.jboss.bpm.console.client;
-import com.mvc4g.client.Controller;
import org.gwt.mosaic.ui.client.Viewport;
/**
@@ -39,8 +38,6 @@
ConsoleConfig getConfig();
- Controller getController();
-
Viewport getViewport();
void refreshView();
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -22,7 +22,7 @@
package org.jboss.bpm.console.client;
import com.mvc4g.client.Controller;
-import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.jboss.errai.workspaces.client.Registry;
/**
@@ -45,7 +45,9 @@
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public abstract class Editor extends org.gwt.mosaic.ui.client.layout.LayoutPanel implements LazyPanel
+public abstract class Editor
+ extends org.gwt.mosaic.ui.client.layout.LayoutPanel
+ implements LazyPanel
{
protected ApplicationContext appContext;
@@ -55,14 +57,9 @@
public Editor()
{
- super(new BorderLayout());
+ super();
this.appContext = Registry.get(ApplicationContext.class);
-
- // hmvc controller chain.
- //this.controller = new Controller();
- //this.controller.setParent(appContext.getController());
-
- this.controller = appContext.getController();
+ this.controller = Registry.get(Controller.class);
}
public boolean isInitialized()
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class Registry
-{
- private static Map<Class, Object> registry = new HashMap<Class,Object>();
-
- public static void set(Class key, Object obj)
- {
- registry.put(key, obj);
- }
-
- public static <T> T get(Class<T> key)
- {
- T t = (T) registry.get(key);
- if(null==t)
- throw new IllegalArgumentException(key + " not registered");
- return t;
- }
-
- public static boolean has(Class key)
- {
- return get(key)!=null;
- }
-
-}
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -24,6 +24,7 @@
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import org.gwt.mosaic.ui.client.DeckLayoutPanel;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.ArrayList;
import java.util.List;
@@ -38,15 +39,20 @@
protected ApplicationContext appContext;
private Menu menu;
- public Workspace(Menu menu, ApplicationContext appContext)
+ public Workspace(Menu menu)
{
super();
- this.appContext = appContext;
+ this.appContext = Registry.get(ApplicationContext.class);
this.menu = menu;
this.setPadding(5);
}
+ /**
+ * Invoked from through derferred binding
+ * @param editor
+ * @param closeable
+ */
public void addEditor(Editor editor, boolean closeable)
{
// Menu
@@ -77,9 +83,10 @@
throw new IllegalArgumentException("No such editor: " +editorId);
Workspace.this.showWidget(deck.index);
+
deck.editor.initialize();
deck.editor.showView(viewId);
-
+
// display editor
DeferredCommand.addCommand(
new Command()
@@ -89,12 +96,12 @@
}
}
);
+
}
private EditorDeck createDeck(Editor editor)
{
EditorDeck deck = new EditorDeck(editor);
- deck.add(editor);
return deck;
}
@@ -136,6 +143,7 @@
{
super();
this.editor = editor;
+ this.add(editor);
}
}
Added: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidget.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidget.java (rev 0)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidget.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.errai.workspaces.client;
+
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * An editor widget wrapper for widget that are loaded asynchronously.
+ */
+public interface EditorWidget
+{
+ Widget build();
+ void loadData();
+}
Added: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidgetClient.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidgetClient.java (rev 0)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidgetClient.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.errai.workspaces.client;
+
+/**
+ * A callback for using the module instance once it's loaded.
+ * Used for code splitting.
+ */
+public interface EditorWidgetClient
+{
+ void onSuccess(EditorWidget instance);
+ void onUnavailable();
+}
Added: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/Registry.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/Registry.java (rev 0)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/Registry.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.errai.workspaces.client;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class Registry
+{
+ private static Map<Class, Object> registry = new HashMap<Class,Object>();
+
+ public static void set(Class key, Object obj)
+ {
+ registry.put(key, obj);
+ }
+
+ public static <T> T get(Class<T> key)
+ {
+ T t = (T) registry.get(key);
+ if(null==t)
+ throw new IllegalArgumentException(key + " not registered");
+ return t;
+ }
+
+ public static boolean has(Class key)
+ {
+ return get(key)!=null;
+ }
+
+}
Added: bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/BPMWorkspace.gwt.xml
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/BPMWorkspace.gwt.xml (rev 0)
+++ bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/BPMWorkspace.gwt.xml 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,9 @@
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN"
+ "http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/c...">
+
+<module>
+
+ <source path="errai/workspaces/client"/>
+ <source path="bpm/console/client"/>
+
+</module>
16 years, 6 months
Overlord SVN: r928 - in bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client: common and 7 other directories.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-22 05:33:38 -0500 (Fri, 22 Jan 2010)
New Revision: 928
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Header.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/IFrameWindowPanel.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/IconHeader.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/WidgetWindowPanel.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/JSOModel.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/JSOParser.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteDefinitionAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteInstanceAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDataAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportFrame.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportParameterForm.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/UpdateSearchDefinitionsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/DOMUtil.java
Log:
Optimize imports
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Application.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,7 +24,6 @@
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.DeferredCommand;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -23,8 +23,8 @@
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.Response;
+import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.Command;
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.JSOParser;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Header.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Header.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Header.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,10 +26,10 @@
import com.google.gwt.user.client.ui.*;
import com.mvc4g.client.Controller;
import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.LayoutPopupPanel;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
-import org.gwt.mosaic.ui.client.LayoutPopupPanel;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,14 +24,16 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.http.client.*;
-import com.google.gwt.user.client.*;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.Cookies;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.WindowCloseListener;
import com.google.gwt.user.client.ui.*;
import com.mvc4g.client.Controller;
import com.mvc4g.client.ViewInterface;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.WindowPanel;
import org.gwt.mosaic.ui.client.layout.*;
-import org.jboss.bpm.console.client.common.HeaderLabel;
import org.jboss.bpm.console.client.util.ConsoleLog;
/**
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,22 +26,25 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.*;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.ui.HTML;
import com.mvc4g.client.Controller;
import org.gwt.mosaic.ui.client.*;
import org.gwt.mosaic.ui.client.layout.BorderLayout;
-import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.gwt.mosaic.ui.client.util.ButtonHelper;
+import org.jboss.bpm.console.client.engine.UpdateDeploymentsAction;
+import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
import org.jboss.bpm.console.client.util.WindowUtil;
-import org.jboss.bpm.console.client.engine.ViewDeploymentAction;
-import org.jboss.bpm.console.client.engine.UpdateDeploymentsAction;
-import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
+import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
+
/**
* The main composite that assembles the gwt console application.
*
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -27,7 +27,10 @@
import com.google.gwt.user.client.ui.ListBox;
import com.mvc4g.client.Controller;
import com.mvc4g.client.ViewInterface;
-import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.GridLayout;
+import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.common.HeaderLabel;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -23,10 +23,8 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
-import org.gwt.mosaic.ui.client.CaptionLayoutPanel;
import org.gwt.mosaic.ui.client.DeckLayoutPanel;
import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
@@ -46,11 +44,6 @@
private DeckLayoutPanel deck;
- public SettingsEditor()
- {
-
- }
-
public void initialize()
{
if(!isInitialized())
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -29,7 +29,6 @@
import org.jboss.bpm.console.client.LoadingStatusAction;
import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.util.ConsoleLog;
-import org.gwt.mosaic.ui.client.MessageBox;
import java.io.IOException;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/IFrameWindowPanel.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/IFrameWindowPanel.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/IFrameWindowPanel.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -29,7 +29,6 @@
import com.google.gwt.user.client.ui.Frame;
import org.gwt.mosaic.core.client.Dimension;
import org.gwt.mosaic.ui.client.Caption;
-import com.google.gwt.user.client.ui.Label;
import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
import org.gwt.mosaic.ui.client.WindowPanel;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/IconHeader.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/IconHeader.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/IconHeader.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -21,11 +21,10 @@
*/
package org.jboss.bpm.console.client.common;
-import org.gwt.mosaic.ui.client.layout.MosaicPanel;
-import org.gwt.mosaic.ui.client.layout.BoxLayout;
-import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.HTML;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.MosaicPanel;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/WidgetWindowPanel.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/WidgetWindowPanel.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/WidgetWindowPanel.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -21,14 +21,14 @@
*/
package org.jboss.bpm.console.client.common;
-import org.gwt.mosaic.ui.client.WindowPanel;
-import org.gwt.mosaic.ui.client.Caption;
-import org.gwt.mosaic.core.client.Dimension;
-import org.jboss.bpm.console.client.util.WindowUtil;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.WindowCloseListener;
import com.google.gwt.user.client.WindowResizeListener;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Widget;
+import org.gwt.mosaic.core.client.Dimension;
+import org.gwt.mosaic.ui.client.Caption;
+import org.gwt.mosaic.ui.client.WindowPanel;
+import org.jboss.bpm.console.client.util.WindowUtil;
/**
* General purpose window panel
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeleteDeploymentAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,21 +26,20 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gen2.table.event.client.RowSelectionEvent;
import com.google.gwt.gen2.table.event.client.RowSelectionHandler;
-import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.gwt.mosaic.ui.client.ListBox;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.ToolBar;
-import org.gwt.mosaic.ui.client.ToolButton;
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.DeploymentRef;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.process.UpdateInstancesAction;
-import org.jboss.bpm.console.client.process.UpdateProcessDetailAction;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
import java.util.Date;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -30,7 +30,6 @@
import org.gwt.mosaic.ui.client.TabLayoutPanel;
import org.gwt.mosaic.ui.client.layout.BorderLayout;
import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
@@ -54,11 +53,6 @@
private Map<String,Integer> view2index = new HashMap<String,Integer>();
- public EngineEditor()
- {
-
- }
-
public void initialize()
{
if(!isInitialized)
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,22 +26,21 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gen2.table.event.client.RowSelectionEvent;
import com.google.gwt.gen2.table.event.client.RowSelectionHandler;
-import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.gwt.mosaic.ui.client.ListBox;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.ToolBar;
-import org.gwt.mosaic.ui.client.ToolButton;
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.JobRef;
-import org.jboss.bpm.console.client.model.TaskRef;
-import org.jboss.bpm.console.client.task.UpdateDetailsAction;
-import org.jboss.bpm.console.client.task.events.DetailViewEvent;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
import java.util.Date;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ResumeDeploymentAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/SuspendDeploymentAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -27,7 +27,6 @@
import com.google.gwt.json.client.JSONValue;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.DTOParser;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,7 +26,6 @@
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.DTOParser;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,8 +25,8 @@
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.Workspace;
-import org.jboss.bpm.console.client.Registry;
/**
* Cross editor view toggle.
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,8 +24,6 @@
import com.google.gwt.json.client.*;
import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.util.JSONWalk;
-import org.jboss.bpm.report.model.ReportReference;
-import org.jboss.bpm.report.model.ReportParameter;
import java.util.ArrayList;
import java.util.Date;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/JSOModel.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/JSOModel.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/JSOModel.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -21,15 +21,15 @@
*/
package org.jboss.bpm.console.client.model;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Date;
-
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.core.client.JsArrayString;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
/**
* Java overlay of a JavaScriptObject.
* Borrowed from Matt Raible:
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/JSOParser.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/JSOParser.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/model/JSOParser.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -22,11 +22,8 @@
package org.jboss.bpm.console.client.model;
import com.google.gwt.core.client.JsArray;
-import com.google.gwt.json.client.JSONArray;
-import com.google.gwt.json.client.JSONValue;
import org.jboss.bpm.report.model.ReportParameter;
import org.jboss.bpm.report.model.ReportReference;
-import org.jboss.bpm.console.client.util.JSONWalk;
import java.util.ArrayList;
import java.util.Date;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,7 +26,10 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gen2.table.event.client.RowSelectionEvent;
import com.google.gwt.gen2.table.event.client.RowSelectionHandler;
-import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.gwt.mosaic.ui.client.ListBox;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteDefinitionAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteDefinitionAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteDefinitionAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteInstanceAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteInstanceAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeleteInstanceAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,14 +26,11 @@
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.WindowCloseListener;
-import com.google.gwt.user.client.WindowResizeListener;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import com.mvc4g.client.ViewInterface;
-import org.gwt.mosaic.core.client.Dimension;
import org.gwt.mosaic.ui.client.Caption;
import org.gwt.mosaic.ui.client.CaptionLayoutPanel;
import org.gwt.mosaic.ui.client.MessageBox;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,13 +26,13 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gen2.table.event.client.RowSelectionEvent;
import com.google.gwt.gen2.table.event.client.RowSelectionHandler;
-import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Button;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.gwt.mosaic.ui.client.ListBox;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.ToolBar;
-import org.gwt.mosaic.ui.client.ToolButton;
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
import org.jboss.bpm.console.client.ApplicationContext;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -28,7 +28,6 @@
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.ActiveNodeInfo;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -30,15 +30,15 @@
import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -48,10 +48,6 @@
private TabLayoutPanel tabPanel;
- public ProcessEditor()
- {
- }
-
public void initialize()
{
if(!isInitialized)
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDataAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDataAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstanceDataAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,7 +26,6 @@
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.XMLParser;
import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateInstancesAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -23,16 +23,12 @@
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.Response;
-import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.json.client.JSONValue;
import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.JSOParser;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.JSOParser;
import org.jboss.bpm.console.client.util.ConsoleLog;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,15 +26,13 @@
import com.google.gwt.user.client.ui.*;
import com.mvc4g.client.ActionInterface;
import com.mvc4g.client.Controller;
-import com.mvc4g.client.ViewInterface;
import com.mvc4g.client.Event;
+import com.mvc4g.client.ViewInterface;
import org.gwt.mosaic.ui.client.Caption;
import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.ImageButton;
-import org.gwt.mosaic.ui.client.WindowPanel;
import org.gwt.mosaic.ui.client.layout.BorderLayout;
import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
@@ -50,11 +48,6 @@
private DecoratedTabLayoutPanel tabPanel;
- public ReportEditor()
- {
-
- }
-
public void setController(Controller controller)
{
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportFrame.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportFrame.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportFrame.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -21,10 +21,10 @@
*/
package org.jboss.bpm.console.client.report;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.Frame;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.LazyPanel;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.Frame;
import java.util.Date;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,7 +24,9 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.HTML;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import com.mvc4g.client.ViewInterface;
@@ -39,9 +41,9 @@
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.report.model.ReportReference;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Iterator;
/**
* List the available reports and allows to redner them.<br>
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportParameterForm.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportParameterForm.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportParameterForm.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -30,9 +30,9 @@
import org.jboss.bpm.report.model.ReportReference;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.HashMap;
/**
* Report parameter input.
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -23,14 +23,13 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Label;
import com.mvc4g.client.Controller;
import org.gwt.mosaic.ui.client.DeckLayoutPanel;
-import com.google.gwt.user.client.ui.Label;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.search.UpdateSearchDefinitionsAction;
-import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.report.model.ReportReference;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/SearchDefinitionView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,7 +24,6 @@
import com.google.gwt.user.client.ui.*;
import com.mvc4g.client.Controller;
import com.mvc4g.client.ViewInterface;
-import com.google.gwt.user.client.ui.Label;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/UpdateSearchDefinitionsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/UpdateSearchDefinitionsAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/search/UpdateSearchDefinitionsAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -23,15 +23,11 @@
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.Response;
-import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.json.client.JSONValue;
import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.model.DTOParser;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.JSOParser;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.util.ConsoleLog;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignTaskAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.task.events.AssignEvent;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,7 +24,6 @@
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.DTOParser;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksParticipationAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,7 +24,6 @@
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.DTOParser;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -26,7 +26,8 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gen2.table.event.client.RowSelectionEvent;
import com.google.gwt.gen2.table.event.client.RowSelectionHandler;
-import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Button;
import com.mvc4g.client.Event;
import org.gwt.mosaic.ui.client.ListBox;
import org.gwt.mosaic.ui.client.MessageBox;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -25,7 +25,6 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -31,7 +31,6 @@
import org.gwt.mosaic.ui.client.TabLayoutPanel;
import org.gwt.mosaic.ui.client.layout.BorderLayout;
import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
@@ -47,10 +46,6 @@
private TabLayoutPanel tabPanel;
- public TaskEditor()
- {
- }
-
public void initialize()
{
if(!isInitialized)
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,13 +24,8 @@
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.TreeListener;
-import com.google.gwt.core.client.GWT;
import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Workspace;
-import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
-import org.gwt.mosaic.ui.client.layout.MosaicPanel;
-import org.gwt.mosaic.ui.client.layout.BoxLayout;
-import com.google.gwt.user.client.ui.Label;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/DOMUtil.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/DOMUtil.java 2010-01-22 10:32:20 UTC (rev 927)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/util/DOMUtil.java 2010-01-22 10:33:38 UTC (rev 928)
@@ -24,8 +24,8 @@
import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList;
+import java.util.ArrayList;
import java.util.List;
-import java.util.ArrayList;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
16 years, 6 months
Overlord SVN: r927 - in bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client: util and 1 other directories.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-22 05:32:20 -0500 (Fri, 22 Jan 2010)
New Revision: 927
Modified:
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java
Log:
Optimize imports
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java 2010-01-22 10:16:12 UTC (rev 926)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Authentication.java 2010-01-22 10:32:20 UTC (rev 927)
@@ -28,13 +28,13 @@
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
+import org.gwt.mosaic.ui.client.MessageBox;
import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.util.JSONWalk;
-import org.gwt.mosaic.ui.client.MessageBox;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
-import java.util.Date;
public class Authentication
{
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java 2010-01-22 10:16:12 UTC (rev 926)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ConsoleConfig.java 2010-01-22 10:32:20 UTC (rev 927)
@@ -21,11 +21,9 @@
*/
package org.jboss.bpm.console.client;
-import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.i18n.client.Dictionary;
-import java.util.List;
-
/**
* Initialize console config from host page (<code>Application.html</code>) variable:
* <pre>
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java 2010-01-22 10:16:12 UTC (rev 926)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java 2010-01-22 10:32:20 UTC (rev 927)
@@ -21,10 +21,9 @@
*/
package org.jboss.bpm.console.client;
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Tree;
/**
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java 2010-01-22 10:16:12 UTC (rev 926)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java 2010-01-22 10:32:20 UTC (rev 927)
@@ -21,8 +21,8 @@
*/
package org.jboss.bpm.console.client;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java 2010-01-22 10:16:12 UTC (rev 926)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java 2010-01-22 10:32:20 UTC (rev 927)
@@ -25,7 +25,6 @@
import com.google.gwt.json.client.JSONException;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
-import org.jboss.bpm.console.client.util.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java 2010-01-22 10:16:12 UTC (rev 926)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/SimpleDateFormat.java 2010-01-22 10:32:20 UTC (rev 927)
@@ -15,9 +15,6 @@
*/
package org.jboss.bpm.console.client.util;
-import org.jboss.bpm.console.client.util.DateLocale;
-import org.jboss.bpm.console.client.util.SimpleDateParser;
-
import java.util.Date;
@SuppressWarnings("deprecation")
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java 2010-01-22 10:16:12 UTC (rev 926)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/util/regex/Pattern.java 2010-01-22 10:32:20 UTC (rev 927)
@@ -21,11 +21,11 @@
*/
package org.jboss.bpm.console.client.util.regex;
+import com.google.gwt.core.client.JavaScriptObject;
+
import java.util.ArrayList;
import java.util.List;
-import com.google.gwt.core.client.JavaScriptObject;
-
/**
* <p>
* Implementation of the {@link java.util.regex.Pattern} class with a
16 years, 6 months
Overlord SVN: r926 - in bpm-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client and 6 other directories.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-22 05:16:12 -0500 (Fri, 22 Jan 2010)
New Revision: 926
Modified:
bpm-console/trunk/gui/war/README.txt
bpm-console/trunk/gui/war/pom.xml
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
Log:
Get ApplicationContext from registry
Modified: bpm-console/trunk/gui/war/README.txt
===================================================================
--- bpm-console/trunk/gui/war/README.txt 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/README.txt 2010-01-22 10:16:12 UTC (rev 926)
@@ -3,16 +3,16 @@
Start the GWT shell with
- mvn gwt-maven:gwt
+ mvn gwt:<run|debug>
When the hosted browser is started, it's enough to hit the 'refresh' button to recompile
and verfiy changes.
NOTE: Really quick turnaround through
- mvn -Dhosted gwt-maven:gwt
+ mvn -Dhosted gwt:<run|debug>
-(Will run "mvn -o -Dgoogle.webtoolkit.compileSkip=true gwt-maven:gwt")
+(Will run "mvn -o -Dgoogle.webtoolkit.compileSkip=true gwt:<run|debug>")
Running in web mode:
Modified: bpm-console/trunk/gui/war/pom.xml
===================================================================
--- bpm-console/trunk/gui/war/pom.xml 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/pom.xml 2010-01-22 10:16:12 UTC (rev 926)
@@ -174,7 +174,7 @@
<runTarget>app.html</runTarget>
<warSourceDirectory>war</warSourceDirectory>
<extraJvmArgs>-Xmx512m</extraJvmArgs>
- <localWorkers>4</localWorkers>
+ <localWorkers>2</localWorkers>
</configuration>
<executions>
<execution>
@@ -235,21 +235,6 @@
<goal>run</goal>
</goals>
</execution>
- <execution>
- <phase>prepare-package</phase>
- <configuration>
- <tasks>
- <!--
- https://jira.jboss.org/jira/browse/BPMC-5
- Tomcat caches console.config.js
- -->
- <!--touch file="war/app/console.config.js"/-->
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
</executions>
</plugin>
</plugins>
@@ -268,6 +253,18 @@
<google.webtoolkit.compileSkip>true</google.webtoolkit.compileSkip>
<o>true</o> <!-- offline -->
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <version>${gwt.maven}</version>
+ <configuration>
+ <draftCompile>true</draftCompile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<!--
@@ -408,7 +405,7 @@
</artifactItems>
</configuration>
</execution>
- <execution>
+ <execution>
<id>unpack-profile-drools2</id>
<phase>prepare-package</phase>
<goals>
@@ -544,7 +541,7 @@
</reportSet>
</reportSets>
<configuration>
-
+ <extra>target</extra>
</configuration>
</plugin>
</plugins>
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -130,7 +130,22 @@
//DOM.getElementById("ui_loading").getStyle().setProperty("visibility", "visible");
// launch workspace
- new MainLayout(controller, auth, config);
+ GWT.runAsync(
+ new RunAsyncCallback()
+ {
+ public void onFailure(Throwable throwable)
+ {
+ GWT.log("Code splitting failed", throwable);
+ MessageBox.error("Code splitting failed", throwable.getMessage());
+ }
+
+ public void onSuccess()
+ {
+ new MainLayout(controller, auth, config);
+ }
+ }
+ );
+
}
});
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -191,7 +191,7 @@
{
Workspace workspace = new Workspace(menu, this);
WorkspaceLauncher launcher = GWT.create(WorkspaceLauncher.class);
- launcher.launch(this, workspace); // calls Workspace.addEditor()
+ launcher.launch(workspace); // calls Workspace.addEditor()
return workspace;
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -46,9 +46,9 @@
private DeckLayoutPanel deck;
- public SettingsEditor(ApplicationContext appContext)
+ public SettingsEditor()
{
- super(appContext);
+
}
public void initialize()
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/WorkspaceLauncher.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -26,5 +26,5 @@
*/
public interface WorkspaceLauncher
{
- void launch(ApplicationContext appContext, Workspace workspace);
+ void launch(Workspace workspace);
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -54,9 +54,9 @@
private Map<String,Integer> view2index = new HashMap<String,Integer>();
- public EngineEditor(ApplicationContext appContext)
+ public EngineEditor()
{
- super(appContext);
+
}
public void initialize()
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -48,9 +48,8 @@
private TabLayoutPanel tabPanel;
- public ProcessEditor(ApplicationContext appContext)
- {
- super(appContext);
+ public ProcessEditor()
+ {
}
public void initialize()
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -50,9 +50,9 @@
private DecoratedTabLayoutPanel tabPanel;
- public ReportEditor(ApplicationContext appContext)
+ public ReportEditor()
{
- super(appContext);
+
}
public void setController(Controller controller)
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -47,9 +47,8 @@
private TabLayoutPanel tabPanel;
- public TaskEditor(ApplicationContext appContext)
- {
- super(appContext);
+ public TaskEditor()
+ {
}
public void initialize()
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -128,7 +128,7 @@
private void generateMethods(SourceWriter sourceWriter)
{
// start constructor source generation
- sourceWriter.println("public void launch(ApplicationContext appContext, Workspace workspace) { ");
+ sourceWriter.println("public void launch(Workspace workspace) { ");
sourceWriter.indent();
InputStream in = getClass().getClassLoader().getResourceAsStream(WORKSPACE_CONFIG);
@@ -155,7 +155,7 @@
if (line.equals("") || line.startsWith("#"))
continue;
- sourceWriter.println("workspace.addEditor( new " + line + "(appContext), false );");
+ sourceWriter.println("workspace.addEditor( new " + line + "(), false );");
}
}
finally
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2010-01-22 09:35:00 UTC (rev 925)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2010-01-22 10:16:12 UTC (rev 926)
@@ -53,10 +53,10 @@
protected boolean isInitialized;
- public Editor(ApplicationContext appContext)
+ public Editor()
{
super(new BorderLayout());
- this.appContext = appContext;
+ this.appContext = Registry.get(ApplicationContext.class);
// hmvc controller chain.
//this.controller = new Controller();
16 years, 6 months
Overlord SVN: r925 - in bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console: client and 1 other directory.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-22 04:35:00 -0500 (Fri, 22 Jan 2010)
New Revision: 925
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
Log:
Include the div logger again
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml 2010-01-22 09:34:32 UTC (rev 924)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml 2010-01-22 09:35:00 UTC (rev 925)
@@ -43,13 +43,13 @@
<when-type-assignable class="org.jboss.bpm.console.client.WorkspaceLauncher"/>
</generate-with>
- <set-property name="log_ConsoleLogger" value="DISABLED" />
+ <set-property name="log_ConsoleLogger" value="ENABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
- <set-property name="log_FirebugLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />
- <set-property name="log_SystemLogger" value="ENABLED" />
+ <set-property name="log_SystemLogger" value="DISABLED" />
<!-- Loggers Disabled by default -->
+ <set-property name="log_FirebugLogger" value="DISABLED" />
<set-property name="log_RemoteLogger" value="DISABLED" />
<set-property name="log_WindowLogger" value="DISABLED" />
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-22 09:34:32 UTC (rev 924)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-22 09:35:00 UTC (rev 925)
@@ -24,6 +24,8 @@
import com.allen_sauer.gwt.log.client.DivLogger;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.*;
import com.google.gwt.user.client.ui.*;
import com.google.gwt.user.client.ui.HTML;
@@ -58,6 +60,8 @@
private Controller controller;
private Viewport viewport;
+ private DivLogger divLogger;
+
public MainLayout(Controller controller, Authentication auth, ConsoleConfig config)
{
this.controller = controller;
@@ -74,7 +78,8 @@
viewport = new Viewport();
// manually, otherwise it will appear on the login screen
- //Log.addLogger(new DivLogger());
+ divLogger = new DivLogger();
+ Log.addLogger(divLogger);
MosaicPanel layout = createLayout();
viewport.getLayoutPanel().add(layout);
@@ -126,12 +131,12 @@
// message Panel
final CaptionLayoutPanel messagePanel = createMessagePanel(panel);
- //messagePanel.add(Log.getDivLogger().getWidget());
+ messagePanel.add(divLogger.getWidget());
messagePanel.setCollapsed(true);
panel.add(messagePanel, new BorderLayoutData(Region.SOUTH, true));
// Turn on DivLogger
- //Log.getDivLogger().getWidget().setVisible(true);
+ divLogger.getWidget().setVisible(true);
return panel;
@@ -164,11 +169,11 @@
"",
ButtonHelper.ButtonLabelType.TEXT_ON_TOP)
);
- collapse.addClickListener(
- new ClickListener()
+ collapse.addClickHandler(
+ new ClickHandler()
{
- public void onClick(Widget sender)
- {
+ public void onClick(ClickEvent clickEvent)
+ {
messagePanel.setCollapsed(!messagePanel.isCollapsed());
panel.layout();
}
16 years, 6 months
Overlord SVN: r924 - bpm-console/trunk/gui/war.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-22 04:34:32 -0500 (Fri, 22 Jan 2010)
New Revision: 924
Modified:
bpm-console/trunk/gui/war/pom.xml
Log:
Bind unpack config to second build lifecycle
Modified: bpm-console/trunk/gui/war/pom.xml
===================================================================
--- bpm-console/trunk/gui/war/pom.xml 2010-01-22 08:28:03 UTC (rev 923)
+++ bpm-console/trunk/gui/war/pom.xml 2010-01-22 09:34:32 UTC (rev 924)
@@ -301,6 +301,28 @@
<executions>
<execution>
<id>unpack-profile-jbpm</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-jbpm</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>war/app</outputDirectory>
+ <includes>**/*</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <!-- the war:war goal removes the unpacked config
+ hence the redundant call here -->
+ <execution>
+ <id>unpack-profile-jbpm2</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
@@ -368,6 +390,26 @@
<execution>
<id>unpack-profile-drools</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-drools</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>war/app</outputDirectory>
+ <includes>**/*</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <execution>
+ <id>unpack-profile-drools2</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
@@ -386,7 +428,6 @@
</artifactItems>
</configuration>
</execution>
-
</executions>
</plugin>
@@ -434,6 +475,26 @@
<execution>
<id>unpack-profile-riftsaw</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-profile-riftsaw</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>war/app</outputDirectory>
+ <includes>**/*</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <execution>
+ <id>unpack-profile-riftsaw2</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
@@ -452,7 +513,6 @@
</artifactItems>
</configuration>
</execution>
-
</executions>
</plugin>
16 years, 6 months
Overlord SVN: r923 - bpm-console/trunk/gui/war.
by overlord-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2010-01-22 03:28:03 -0500 (Fri, 22 Jan 2010)
New Revision: 923
Modified:
bpm-console/trunk/gui/war/pom.xml
Log:
Fix inclusion of console.config.js
Modified: bpm-console/trunk/gui/war/pom.xml
===================================================================
--- bpm-console/trunk/gui/war/pom.xml 2010-01-22 08:27:08 UTC (rev 922)
+++ bpm-console/trunk/gui/war/pom.xml 2010-01-22 08:28:03 UTC (rev 923)
@@ -225,6 +225,7 @@
-->
<delete dir="war/WEB-INF/classes"/>
<delete dir="war/WEB-INF/lib"/>
+ <delete file="war/WEB-INF/jboss-web.xml"/>
<delete dir="war/app"/>
<delete dir="target"/>
@@ -235,14 +236,14 @@
</goals>
</execution>
<execution>
- <phase>process-classes</phase>
+ <phase>prepare-package</phase>
<configuration>
<tasks>
<!--
https://jira.jboss.org/jira/browse/BPMC-5
Tomcat caches console.config.js
-->
- <touch file="${project.build.outputDirectory}/org/jboss/bpm/console/public/console.config.js"/>
+ <!--touch file="war/app/console.config.js"/-->
</tasks>
</configuration>
<goals>
@@ -300,7 +301,7 @@
<executions>
<execution>
<id>unpack-profile-jbpm</id>
- <phase>process-resources</phase>
+ <phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
@@ -312,7 +313,8 @@
<version>${version}</version>
<type>jar</type>
<overWrite>true</overWrite>
- <outputDirectory>war/app</outputDirectory>
+ <outputDirectory>war/app</outputDirectory>
+ <includes>**/*</includes>
</artifactItem>
</artifactItems>
</configuration>
@@ -366,7 +368,7 @@
<execution>
<id>unpack-profile-drools</id>
- <phase>process-resources</phase>
+ <phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
@@ -378,7 +380,8 @@
<version>${version}</version>
<type>jar</type>
<overWrite>true</overWrite>
- <outputDirectory>target/classes</outputDirectory>
+ <outputDirectory>war/app</outputDirectory>
+ <includes>**/*</includes>
</artifactItem>
</artifactItems>
</configuration>
@@ -431,7 +434,7 @@
<execution>
<id>unpack-profile-riftsaw</id>
- <phase>process-resources</phase>
+ <phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
@@ -443,7 +446,8 @@
<version>${version}</version>
<type>jar</type>
<overWrite>true</overWrite>
- <outputDirectory>target/classes</outputDirectory>
+ <outputDirectory>war/app</outputDirectory>
+ <includes>**/*</includes>
</artifactItem>
</artifactItems>
</configuration>
@@ -464,47 +468,26 @@
</build>
</profile>
- <!--
- =======================================================
- OS Switch used for GWT SDK selection
- =======================================================
- -->
-
- <profile>
- <id>gwt-dev-windows</id>
- <properties>
- <platform>windows</platform>
- </properties>
- <activation>
- <activeByDefault>true</activeByDefault>
- <os>
- <family>windows</family>
- </os>
- </activation>
- </profile>
- <profile>
- <id>gwt-dev-mac</id>
- <properties>
- <platform>mac</platform>
- </properties>
- <activation>
- <activeByDefault>false</activeByDefault>
- <os>
- <family>mac</family>
- </os>
- </activation>
- </profile>
- <profile>
- <id>gwt-dev-linux</id>
- <properties>
- <platform>linux</platform>
- </properties>
- <activation>
- <activeByDefault>false</activeByDefault>
- <os>
- <name>linux</name>
- </os>
- </activation>
- </profile>
</profiles>
+
+ <reporting>
+ <excludeDefaults>true</excludeDefaults>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>soyc</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ <configuration>
+
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
</project>
16 years, 6 months