You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2013/09/20 04:29:24 UTC
svn commit: r1524887 [34/34] - in /tomee/tomee/trunk/tomee: ./
tomee-webaccess/ tomee-webaccess/src/ tomee-webaccess/src/main/
tomee-webaccess/src/main/config/ tomee-webaccess/webaccess-gui-libs/
tomee-webaccess/webaccess-gui-libs/backbone/ tomee-webac...
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/container.js
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/container.js?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/container.js (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/container.js Fri Sep 20 02:29:16 2013
@@ -0,0 +1,75 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+(function () {
+ 'use strict';
+
+ var deps = ['app/js/templates', 'app/js/i18n', 'lib/backbone'];
+ define(deps, function (templates) {
+
+ var View = Backbone.View.extend({
+ el: 'body',
+
+ showView: function (view) {
+ var me = this;
+ var contentarea = me.$('.ux-contentarea');
+ if (me.currentView) {
+ me.currentView.$el.detach();
+ }
+ me.currentView = view;
+ me.currentView.render();
+ contentarea.append(me.currentView.el);
+ if (view.renderCallback) {
+ view.renderCallback();
+ }
+ me.$('.ux-app-menu-item').removeClass('active');
+ var myMenuItem = me.$('li.ux-app-menu-item.' + view.className);
+ myMenuItem.addClass('active');
+ },
+
+ events: {
+ 'click .ux-app-menu-item a': function (evt) {
+ // TRICK to avoid full page reload.
+ evt.preventDefault();
+ var myLink = $(evt.target);
+ var href = myLink.attr('href');
+ this.trigger('navigate', {
+ href: href
+ });
+ }
+ },
+
+ render: function () {
+ if (this.options.isRendered) {
+ return this;
+ }
+
+ var html = templates.getValue('container', {
+ userName: ''
+ });
+ this.$el.html(html);
+
+ // render it only once
+ this.options.isRendered = true;
+ return this;
+ }
+ });
+
+ return new View({});
+ });
+}());
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/growl.js
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/growl.js?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/growl.js (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/growl.js Fri Sep 20 02:29:16 2013
@@ -0,0 +1,70 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+(function () {
+ 'use strict';
+
+ var deps = ['app/js/templates', 'lib/underscore'];
+ define(deps, function (templates, underscore) {
+
+ var GrowlContainerView = Backbone.View.extend({
+ el: 'body',
+ render: function () {
+ if (this.options.isRendered) {
+ return this;
+ }
+
+ var me = this;
+ var container = $(templates.getValue('growl-container', {}));
+ me.$el.append(container[0]);
+ me.containerEl = $(container[0]);
+
+ // render it only once
+ this.options.isRendered = true;
+ return this;
+ }
+ });
+ var container = new GrowlContainerView({});
+
+ function showNotification(messageType, messageText) {
+ container.render();
+
+ var alert = $(templates.getValue('growl', {
+ messageType: messageType,
+ messageText: messageText
+ }));
+
+ container.containerEl.append(alert[0]);
+ alert.fadeIn();
+ var faceOutCallback = function () {
+ alert.fadeOut(null, function () {
+ try {
+ alert.remove();
+ } catch (ignore) { /* noop */
+ }
+ });
+ };
+ var faceOut = underscore.debounce(faceOutCallback, 5000);
+ faceOut();
+ }
+
+ return {
+ showNotification: showNotification
+ };
+ });
+}());
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/logfiles.js
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/logfiles.js?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/logfiles.js (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/logfiles.js Fri Sep 20 02:29:16 2013
@@ -0,0 +1,103 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+(function () {
+ 'use strict';
+
+ var deps = ['app/js/templates', 'lib/underscore', 'lib/backbone'];
+ define(deps, function (templates, underscore) {
+
+ var View = Backbone.View.extend({
+ tagName: 'div',
+ className: 'ux-log-files',
+ events: {
+ 'click .ux-choose-file': function (evt) {
+ evt.preventDefault();
+ var me = this;
+ me.trigger('load-file-options', {});
+ },
+ 'click .ux-refresh-btn': function () {
+ var me = this;
+ var fileNameArea = $(me.$el.find('.ux-choose-file>span').get(0));
+ me.triggerFileLoad(fileNameArea.html());
+ },
+ 'click .ux-scrolldown-btn': function () {
+ var me = this;
+ var contentArea = $(me.$el.find('.panel-body').get(0));
+ contentArea.animate({
+ scrollTop: contentArea.prop("scrollHeight")
+ }, 250);
+ }
+ },
+ triggerFileLoad: function (fileName) {
+ var me = this;
+ me.ux.selectedHref = fileName;
+ me.$el.find('.ux-refresh-btn').addClass('disabled');
+ me.$el.find('.ux-choose-file').addClass('disabled');
+ var fileNameArea = $(me.$el.find('.ux-choose-file>span').get(0));
+ fileNameArea.html(me.ux.selectedHref);
+ me.trigger('load-file', {
+ href: me.ux.selectedHref
+ });
+ },
+ fileSelectedCalback: function (evt) {
+ // TRICK to avoid full page reload.
+ evt.preventDefault();
+ var me = this;
+ var myLink = $(evt.target);
+ me.triggerFileLoad(myLink.attr('href'));
+ },
+ showList: function (files) {
+ var me = this;
+ var menu = $(me.$el.find('.ux-choose-file-menu').get(0));
+ menu.empty();
+ underscore.each(files, function (file) {
+ var link = $(templates.getValue('logfile-link', {
+ href: file
+ }));
+ link.on('click', function (evt) {
+ me.fileSelectedCalback(evt);
+ });
+ menu.prepend(link);
+ });
+ },
+ showFile: function (content) {
+ var me = this;
+ var contentArea = $(me.$el.find('.panel-body>pre').get(0));
+ contentArea.empty();
+ contentArea.append(content);
+ me.$el.find('.ux-refresh-btn').removeClass('disabled');
+ me.$el.find('.ux-choose-file').removeClass('disabled');
+ },
+ render: function () {
+ var me = this;
+ if (!this.options.isRendered) {
+ me.ux = me.ux || {};
+ me.$el.empty();
+ me.$el.append(templates.getValue('logfiles', {}));
+ this.options.isRendered = true;
+ }
+ if (me.ux.selectedHref) {
+ me.triggerFileLoad(me.ux.selectedHref);
+ }
+ return this;
+ }
+ });
+ return new View();
+ });
+}());
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/scripting.js
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/scripting.js?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/scripting.js (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/app/js/view/scripting.js Fri Sep 20 02:29:16 2013
@@ -0,0 +1,121 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+(function () {
+ 'use strict';
+
+ var deps = ['app/js/templates', 'app/js/i18n', 'lib/backbone', 'lib/javascript-mode', 'lib/groovy-mode'];
+ define(deps, function (templates, i18n) {
+ var codeMirror = CodeMirror; //making lint happy
+ var codes = {
+ javascript: templates.getValue('script-sample-javascript', {}),
+ groovy: templates.getValue('script-sample-groovy', {})
+ };
+
+ var View = Backbone.View.extend({
+ tagName: 'div',
+ className: 'ux-scripting',
+ events: {
+ 'click .ux-script-output>div.panel-heading>button': function () {
+ var me = this;
+ var pre = $(me.$el.find('.ux-script-output>div.panel-body>pre').get(0));
+ pre.empty();
+ },
+ 'click .ux-execute-script': function (evt) {
+ // TRICK to avoid full page reload.
+ evt.preventDefault();
+ var me = this;
+ me.trigger('execute-action', {
+ engine: me.editor.getOption("mode"),
+ script: me.editor.getValue()
+ });
+ me.$el.find('.ux-execute-script').addClass('disabled');
+ },
+ 'click .ux-source-option': function (evt) {
+ // TRICK to avoid full page reload.
+ evt.preventDefault();
+ var me = this;
+ var myLink = $(evt.target);
+ me.trigger('type-chosen', {
+ name: myLink.attr('name')
+ });
+ }
+ },
+
+ showSourceType: function (name) {
+ var me = this;
+ //saving old code
+ if (this.options.isRendered) {
+ codes[me.editor.getOption("mode")] = me.editor.getValue();
+ }
+ me.editor.setOption("mode", name);
+ codeMirror.commands.autocomplete = function (cm) {
+ codeMirror.showHint(cm, codeMirror.hint[name]);
+ };
+ // swapping sources
+ me.editor.setValue(codes[name]); // setting new code
+ me.$el.find('.ux-source-choice').html(i18n.get(name));
+
+ },
+
+ fitCodeField: function () {
+ var me = this;
+ var panelBody = $(me.$el.find('.ux-script-source').get(0));
+ me.editor.setSize(panelBody.width() - 22, panelBody.height() - 120);
+ },
+
+ renderCallback: function () {
+ var me = this;
+ me.fitCodeField();
+ },
+
+ appendOutput: function (output) {
+ var me = this;
+ var pre = $(me.$el.find('.ux-script-output>div.panel-body>pre').get(0));
+ pre.append(output);
+ me.$el.find('.ux-execute-script').removeClass('disabled');
+ var contentArea = $(me.$el.find('.panel-body').get(0));
+ contentArea.animate({
+ scrollTop: contentArea.prop("scrollHeight")
+ }, 250);
+ },
+
+ render: function () {
+ var me = this;
+ if (!this.options.isRendered) {
+ me.$el.empty();
+ me.$el.append(templates.getValue('scripting', {}));
+ me.editor = codeMirror.fromTextArea(me.$el.find('textarea').get(0), {
+ extraKeys: {"Ctrl-Space": "autocomplete"}
+ });
+ me.editor.setValue('');
+ me.showSourceType('javascript');
+ this.options.isRendered = true;
+ $(window).resize(function () {
+ me.fitCodeField();
+ });
+ }
+ me.editor.focus();
+ return this;
+ }
+ });
+ return new View();
+ });
+}());
+
+
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/index.jsp?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/index.jsp (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/main/webapp/index.jsp Fri Sep 20 02:29:16 2013
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Apache TomEE</title>
+ <link href="<c:url value='/app/lib/bootstrap/css/bootstrap.min.css'/>" rel="stylesheet">
+ <link href="<c:url value='/app/lib/codemirror/lib/codemirror.css'/>" rel="stylesheet">
+ <link href="<c:url value='/app/lib/codemirror/addon/hint/show-hint.css'/>" rel="stylesheet">
+ <link href="<c:url value='/app/app.less'/>" rel="stylesheet/less" type="text/css">
+ <script src="<c:url value='/app/lib/require/require.js'/>"></script>
+ <script type="text/javascript">
+ window.ux = window.ux || {};
+ window.ux.SESSION_ID = "<%=request.getSession().getId()%>";
+ window.ux.ROOT_URL = "<c:url value='/'/>".replace(';jsessionid=' + window.ux.SESSION_ID, '');
+ </script>
+ <script src="<c:url value='/app/config.js'/>"></script>
+ <script src="<c:url value='/app/js/start.js'/>"></script>
+</head>
+<body></body>
+</html>
\ No newline at end of file
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/test/javascript/test/I18N.js
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/test/javascript/test/I18N.js?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/test/javascript/test/I18N.js (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-gui/src/test/javascript/test/I18N.js Fri Sep 20 02:29:16 2013
@@ -0,0 +1,29 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+define(['app/js/i18n'], function (I18N) {
+ describe('I18N test', function () {
+ it('should show the welcome message', function () {
+ var str = I18N.get('application.welcome', {
+ appName: I18N.get('application.name'),
+ userName: 'my Master'
+ });
+ expect(str).toEqual('Hi my Master! Welcome to webaccess!');
+ });
+ });
+});
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-resources/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-resources/pom.xml?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-resources/pom.xml (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-resources/pom.xml Fri Sep 20 02:29:16 2013
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>tomee-webaccess</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>webaccess-resources</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>TomEE :: webaccess :: webaccess-resources</name>
+ <dependencies>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>apache-tomee</artifactId>
+ <version>${tomee.version}</version>
+ <classifier>plus</classifier>
+ <type>tar.gz</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.basedir}/target/</outputDirectory>
+ <destFileName>tomee-runtime.tar.gz</destFileName>
+ </artifactItem>
+ </artifactItems>
+ <!-- other configurations here -->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/pom.xml?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/pom.xml (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/pom.xml Fri Sep 20 02:29:16 2013
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>tomee-webaccess</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>webaccess-web</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>TomEE :: webaccess :: webaccess-web</name>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-server</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>javaee-api</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.4</version>
+ <configuration>
+ <providerSelection>2.0</providerSelection>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generateStubs</goal>
+ <goal>compile</goal>
+ <goal>generateTestStubs</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ApplicationDto.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ApplicationDto.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ApplicationDto.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ApplicationDto.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,36 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.data.dto
+
+import javax.xml.bind.annotation.XmlAccessType
+import javax.xml.bind.annotation.XmlAccessorType
+import javax.xml.bind.annotation.XmlElement
+import javax.xml.bind.annotation.XmlRootElement
+
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+class ApplicationDto {
+
+ @XmlElement
+ String name
+
+ @XmlElement
+ List<ServiceDto> services = []
+
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ListFilesResultDto.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ListFilesResultDto.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ListFilesResultDto.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ListFilesResultDto.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,33 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.data.dto
+
+import javax.xml.bind.annotation.XmlAccessType
+import javax.xml.bind.annotation.XmlAccessorType
+import javax.xml.bind.annotation.XmlElement
+import javax.xml.bind.annotation.XmlRootElement
+
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+class ListFilesResultDto {
+
+ @XmlElement
+ Set<String> files
+
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/LogFileResultDto.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/LogFileResultDto.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/LogFileResultDto.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/LogFileResultDto.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,33 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.data.dto
+
+import javax.xml.bind.annotation.XmlAccessType
+import javax.xml.bind.annotation.XmlAccessorType
+import javax.xml.bind.annotation.XmlElement
+import javax.xml.bind.annotation.XmlRootElement
+
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+class LogFileResultDto {
+
+ @XmlElement
+ String content
+
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ScriptingResultDto.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ScriptingResultDto.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ScriptingResultDto.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ScriptingResultDto.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,33 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.data.dto
+
+import javax.xml.bind.annotation.XmlAccessType
+import javax.xml.bind.annotation.XmlAccessorType
+import javax.xml.bind.annotation.XmlElement
+import javax.xml.bind.annotation.XmlRootElement
+
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+class ScriptingResultDto {
+
+ @XmlElement
+ String output
+
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ServiceDto.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ServiceDto.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ServiceDto.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/ServiceDto.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,38 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.data.dto
+
+import javax.xml.bind.annotation.XmlAccessType
+import javax.xml.bind.annotation.XmlAccessorType
+import javax.xml.bind.annotation.XmlElement
+import javax.xml.bind.annotation.XmlRootElement
+
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+class ServiceDto {
+
+ @XmlElement
+ String name
+
+ @XmlElement
+ String address
+
+ @XmlElement
+ String port
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/WsListResultDto.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/WsListResultDto.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/WsListResultDto.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/data/dto/WsListResultDto.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,33 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.data.dto
+
+import javax.xml.bind.annotation.XmlAccessType
+import javax.xml.bind.annotation.XmlAccessorType
+import javax.xml.bind.annotation.XmlElement
+import javax.xml.bind.annotation.XmlRootElement
+
+@XmlAccessorType(XmlAccessType.NONE)
+@XmlRootElement
+class WsListResultDto {
+
+ @XmlElement
+ Set<ApplicationDto> applications = []
+
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/ApplicationConfig.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/ApplicationConfig.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/ApplicationConfig.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/ApplicationConfig.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,29 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.rest
+
+import javax.ws.rs.ApplicationPath
+import javax.ws.rs.core.Application
+
+@ApplicationPath("/rest")
+class ApplicationConfig extends Application {
+ Set<Class<?>> getClasses() {
+ [KeepAlive, Log, Scripting, WebServices]
+ }
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/KeepAlive.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/KeepAlive.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/KeepAlive.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/KeepAlive.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,30 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.rest
+
+import javax.ws.rs.GET
+import javax.ws.rs.Path
+
+@Path("/keep-alive")
+class KeepAlive {
+ @GET
+ void ping() {
+ // no-op
+ }
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/Log.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/Log.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/Log.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/Log.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,46 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.rest
+
+import webaccess.data.dto.ListFilesResultDto
+import webaccess.data.dto.LogFileResultDto
+import webaccess.service.LogServiceImpl
+
+import javax.ejb.EJB
+import javax.ws.rs.*
+
+@Path("/log")
+class Log {
+ @EJB
+ private LogServiceImpl service
+
+ @GET
+ @Path("/list-files")
+ @Produces("application/json")
+ ListFilesResultDto execute(@FormParam('engine') String engine, @FormParam('script') String script) {
+ service.listFiles()
+ }
+
+ @GET
+ @Path("/load/{fileName}")
+ @Produces("application/json")
+ LogFileResultDto load(@PathParam('fileName') String fileName) {
+ service.load(fileName)
+ }
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/Scripting.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/Scripting.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/Scripting.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/Scripting.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,40 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.rest
+
+import webaccess.data.dto.ScriptingResultDto
+import webaccess.service.ScriptingServiceImpl
+
+import javax.ejb.EJB
+import javax.ws.rs.FormParam
+import javax.ws.rs.POST
+import javax.ws.rs.Path
+import javax.ws.rs.Produces
+
+@Path("/scripting")
+class Scripting {
+ @EJB
+ private ScriptingServiceImpl service
+
+ @POST
+ @Produces("application/json")
+ ScriptingResultDto execute(@FormParam('engine') String engine, @FormParam('script') String script) {
+ service.execute(engine, script)
+ }
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/WebServices.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/WebServices.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/WebServices.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/rest/WebServices.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,43 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.rest
+
+import webaccess.data.dto.ScriptingResultDto
+import webaccess.data.dto.WsListResultDto
+import webaccess.service.ScriptingServiceImpl
+import webaccess.service.WsServiceImpl
+
+import javax.ejb.EJB
+import javax.ws.rs.FormParam
+import javax.ws.rs.GET
+import javax.ws.rs.POST
+import javax.ws.rs.Path
+import javax.ws.rs.Produces
+
+@Path("/ws")
+class WebServices {
+ @EJB
+ private WsServiceImpl service
+
+ @GET
+ @Produces("application/json")
+ WsListResultDto list() {
+ service.list()
+ }
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/LogServiceImpl.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/LogServiceImpl.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/LogServiceImpl.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/LogServiceImpl.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,59 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.service
+
+import webaccess.data.dto.ListFilesResultDto
+import webaccess.data.dto.LogFileResultDto
+
+import javax.annotation.security.RolesAllowed
+import javax.ejb.Stateless
+
+@Stateless
+@RolesAllowed('tomee')
+class LogServiceImpl {
+
+ static ListFilesResultDto listFiles() {
+ def logFolder = new File(System.getProperty("catalina.base"), "logs")
+ def files = logFolder.listFiles()
+ def names = new TreeSet<String>()
+ files.each {
+ if (it.length() > 0) {
+ names << it.name
+ }
+ }
+ new ListFilesResultDto(
+ files: names
+ )
+ }
+
+ static LogFileResultDto load(String fileName) {
+ def logFolder = new File(System.getProperty("catalina.base"), "logs")
+ def file = new File(logFolder, fileName)
+ def text
+ try {
+ text = file.text
+ } catch (FileNotFoundException e) {
+ text = "'$fileName' not found."
+ }
+ new LogFileResultDto(
+ content: text
+ )
+ }
+
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/ScriptingServiceImpl.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/ScriptingServiceImpl.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/ScriptingServiceImpl.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/ScriptingServiceImpl.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,54 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.service
+
+import webaccess.data.dto.ScriptingResultDto
+
+import javax.annotation.security.RolesAllowed
+import javax.ejb.Stateless
+import javax.script.ScriptEngineManager
+import javax.script.SimpleScriptContext
+
+@Stateless
+@RolesAllowed('tomee')
+class ScriptingServiceImpl {
+
+ static ScriptingResultDto execute(String engine, String script) {
+ ScriptingResultDto result = new ScriptingResultDto(
+ output: ''
+ )
+ if (script && '' != script.trim()) {
+ def factory = new ScriptEngineManager()
+ def sw = new StringWriter()
+ def pw = new PrintWriter(sw)
+ try {
+ def engineImpl = factory.getEngineByName(engine && '' != engine.trim() ? engine.trim().toLowerCase() : 'js')
+ def ctx = new SimpleScriptContext()
+ ctx.writer = pw
+ ctx.errorWriter = pw
+ engineImpl.eval(script, ctx)
+ } catch (exception) {
+ exception.printStackTrace(pw)
+ }
+ result.output = sw.toString()
+ }
+ result
+ }
+
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/WsServiceImpl.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/WsServiceImpl.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/WsServiceImpl.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/service/WsServiceImpl.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,117 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.service
+
+import org.apache.openejb.server.ServerService
+import org.apache.openejb.server.ServiceManager
+import org.apache.openejb.server.SimpleServiceManager
+import org.apache.openejb.util.LogCategory
+import org.apache.openejb.util.Logger
+import webaccess.data.dto.ApplicationDto
+import webaccess.data.dto.ServiceDto
+import webaccess.data.dto.WsListResultDto
+
+import javax.annotation.security.RolesAllowed
+import javax.ejb.Stateless
+
+@Stateless
+@RolesAllowed('tomee')
+class WsServiceImpl {
+ private static def log = Logger.getInstance(LogCategory.OPENEJB_RS, WsServiceImpl)
+
+ private static ApplicationDto getApplicationByName(WsListResultDto queryResult, String name) {
+ def dto = queryResult.applications.find {
+ it.name = name
+ }
+ if (!dto) {
+ dto = new ApplicationDto(name: name)
+ queryResult.applications << dto
+ }
+ dto
+ }
+
+ private static def getValue(def source, String attributeName) {
+ try {
+ return source[attributeName]
+ } catch (ignore) {
+ return null
+ }
+ }
+
+ private static ServerService serverService(String clazz) {
+ def sm = ServiceManager.get()
+ if (!(sm instanceof SimpleServiceManager)) { // we don't know
+ log.warning("the service manager used is not a simple service manager so rest services can't be retrieved")
+ return null
+ }
+ def serverServices = (sm as SimpleServiceManager)?.daemons
+ if (!serverServices) {
+ log.warning("no service started")
+ return null
+ }
+ serverServices.find { ServerService ss ->
+ clazz == ss.class.name
+ }
+ }
+
+ private static WsListResultDto restWebServices(WsListResultDto queryResult) {
+ def ss = serverService("org.apache.openejb.server.cxf.rs.CxfRSService")
+ if (!ss) {
+ return queryResult
+ }
+ ss.services?.each { rsService ->
+ def app = getValue(rsService, "webapp") as String
+ def address = getValue(rsService, "address") as String
+ def origin = getValue(rsService, "origin") as String
+ getApplicationByName(queryResult, app).services << new ServiceDto(
+ name: origin,
+ address: address + "?wadl"
+ )
+ }
+ queryResult
+ }
+
+ private static WsListResultDto soapWebServices(WsListResultDto queryResult) {
+ def ss = serverService("org.apache.openejb.server.cxf.CxfService")
+ if (!ss) {
+ return queryResult
+ }
+ ss.addressesByApplication?.each { String appName, List addresses ->
+ def app = getApplicationByName(queryResult, appName)
+ app.services = addresses?.collect { soapService ->
+ def wsdl = getValue(soapService, "address") as String
+ def port = getValue(soapService, "portName") as String
+ def classname = getValue(soapService, "classname") as String
+ new ServiceDto(
+ name: classname,
+ address: wsdl + "?wsdl",
+ port: port
+ )
+ }
+ }
+ queryResult
+ }
+
+ static WsListResultDto list() {
+ def queryResult = new WsListResultDto();
+ restWebServices(queryResult)
+ soapWebServices(queryResult)
+ queryResult
+ }
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/web/SessionListener.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/web/SessionListener.groovy?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/web/SessionListener.groovy (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/groovy/webaccess/web/SessionListener.groovy Fri Sep 20 02:29:16 2013
@@ -0,0 +1,39 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package webaccess.web
+
+import org.slf4j.LoggerFactory
+
+import javax.servlet.http.HttpSessionEvent
+import javax.servlet.http.HttpSessionListener
+
+class SessionListener implements HttpSessionListener {
+ private def log = LoggerFactory.getLogger(SessionListener)
+
+ @Override
+ public void sessionCreated(HttpSessionEvent se) {
+ def session = se.getSession()
+ log.info("TomEE Webaccess sessionCreated -> Id: {} MaxInactiveInterval: {} seconds", session.id, session.maxInactiveInterval)
+ }
+
+ @Override
+ public void sessionDestroyed(HttpSessionEvent se) {
+ log.info("PhotoDB sessionDestroyed -> Id: {}", se.session.id)
+ }
+}
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/beans.xml?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/beans.xml (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/beans.xml Fri Sep 20 02:29:16 2013
@@ -0,0 +1,18 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans></beans>
\ No newline at end of file
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/ejb-jar.xml?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/ejb-jar.xml (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/ejb-jar.xml Fri Sep 20 02:29:16 2013
@@ -0,0 +1,15 @@
+<!--
+ 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.
+-->
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.1" metadata-complete="false">
+</ejb-jar>
Added: tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/persistence.xml?rev=1524887&view=auto
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/persistence.xml (added)
+++ tomee/tomee/trunk/tomee/tomee-webaccess/webaccess-web/src/main/resources/META-INF/persistence.xml Fri Sep 20 02:29:16 2013
@@ -0,0 +1,29 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0">
+
+ <persistence-unit name="webaccessPU">
+ <jta-data-source>webaccessJTA</jta-data-source>
+ <non-jta-data-source>webaccessNONJTA</non-jta-data-source>
+ <properties>
+ <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file