Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AF59D200B44 for ; Thu, 14 Jul 2016 19:57:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AE1CC160A89; Thu, 14 Jul 2016 17:57:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 84BE1160A88 for ; Thu, 14 Jul 2016 19:57:40 +0200 (CEST) Received: (qmail 65728 invoked by uid 500); 14 Jul 2016 17:57:20 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 64148 invoked by uid 99); 14 Jul 2016 17:57:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2016 17:57:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1B5F5ED321; Thu, 14 Jul 2016 17:57:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lukaszlenart@apache.org To: commits@struts.apache.org Date: Thu, 14 Jul 2016 17:58:06 -0000 Message-Id: <4da1d3bdbd7e4b408aef96533a4e54d3@git.apache.org> In-Reply-To: <89646fc0060545b3bc34b8e154b74027@git.apache.org> References: <89646fc0060545b3bc34b8e154b74027@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [50/51] [abbrv] [partial] struts-archetypes git commit: WW-4316 Moves Struts archetypes into its own repo archived-at: Thu, 14 Jul 2016 17:57:41 -0000 http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/java/actions/data/ProjectsAction.java ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/java/actions/data/ProjectsAction.java b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/java/actions/data/ProjectsAction.java new file mode 100644 index 0000000..996d089 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/java/actions/data/ProjectsAction.java @@ -0,0 +1,72 @@ +/* + * 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 ${package}.actions.data; + +import com.opensymphony.xwork2.ActionSupport; +import org.apache.struts2.convention.annotation.Result; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.ArrayList; +import java.util.List; + +/** + * List Apache projects. + */ +@Result(type = "json") +public class ProjectsAction extends ActionSupport { + + private static final long serialVersionUID = 9037336532369476225L; + private static final Logger log = LogManager.getLogger(ProjectsAction.class); + + private List projectNames; + + public String execute() throws Exception { + + projectNames = new ArrayList(); + projectNames.add("Apache Struts"); + projectNames.add("Apache Log4j"); + projectNames.add("Apache Tomcat"); + projectNames.add("Apache Maven"); + projectNames.add("Apache Ant"); + projectNames.add("Apache Log4Net"); + projectNames.add("Apache Log4Cxx"); + projectNames.add("Apache Chainsaw"); + projectNames.add("Apache Incubator"); + projectNames.add("Apache Hadoop"); + projectNames.add("Apache OpenOffice"); + projectNames.add("Apache Mahout"); + projectNames.add("Apache Tapestry"); + projectNames.add("Apache Jena"); + projectNames.add("Apache Solr"); + projectNames.add("Apache Cayenne"); + projectNames.add("Apache OpenEJB"); + projectNames.add("Apache Deltaspike"); + projectNames.add("Apache Cordova"); + + log.debug("Return {} Apache projects", projectNames.size()); + + return SUCCESS; + } + + public List getProjectNames() { + return projectNames; + } +} http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/java/actions/data/package-info.java ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/java/actions/data/package-info.java b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/java/actions/data/package-info.java new file mode 100644 index 0000000..3e4af32 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/java/actions/data/package-info.java @@ -0,0 +1,24 @@ +/* + * 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. + */ +@ParentPackage("data") +@Namespace("/data") +package ${package}.actions.data; + +import org.apache.struts2.convention.annotation.Namespace; +import org.apache.struts2.convention.annotation.ParentPackage; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/jshint.conf.js ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/jshint.conf.js b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/jshint.conf.js new file mode 100644 index 0000000..91d3bb3 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/jshint.conf.js @@ -0,0 +1,13 @@ +{ + "maxparams": 3, + "indent": true, + "camelcase": true, + "eqeqeq": true, + "forin": true, + "immed": true, + "latedef": false, + "noarg": true, + "noempty": true, + "nonew": true, + "globals": {} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/log4j2.xml ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/log4j2.xml b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/log4j2.xml new file mode 100644 index 0000000..6d27d12 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/log4j2.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/package.properties ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/package.properties b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/package.properties new file mode 100644 index 0000000..b8ee61f --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/package.properties @@ -0,0 +1 @@ +hello.message = Struts is up and running... http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/package_es.properties ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/package_es.properties b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/package_es.properties new file mode 100644 index 0000000..9f3bc40 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/package_es.properties @@ -0,0 +1 @@ +hello.message = \u00A1Struts est\u00E1 bien\!... http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/struts.xml ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/struts.xml b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/struts.xml new file mode 100644 index 0000000..d11f2d8 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/resources/struts.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/index.jsp ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/index.jsp b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/index.jsp new file mode 100644 index 0000000..3f6c374 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/index.jsp @@ -0,0 +1,38 @@ + +<%@ page contentType="text/html; charset=UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + + + + My AngularJS Struts2 App + + "> + + + +

+ +
+ Home - Projects +
+ +
+
+
+ + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..8d08c0b --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,20 @@ + + + Struts Blank AngularJS App + + + struts2 + org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter + + + + struts2 + /* + + + + index.jsp + + http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/index.jsp ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/index.jsp b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/index.jsp new file mode 100644 index 0000000..a81b87f --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/index.jsp @@ -0,0 +1 @@ +<% response.sendRedirect("index"); %> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/app.js ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/app.js b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/app.js new file mode 100644 index 0000000..6d2da17 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/app.js @@ -0,0 +1,26 @@ +/* + * $Id$ + * + * 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'; + + angular + .module('app', ['ngRoute']); +})(); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/config.js ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/config.js b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/config.js new file mode 100644 index 0000000..9b93aab --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/config.js @@ -0,0 +1,40 @@ +/* + * $Id$ + * + * 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'; + + angular + .module('app') + .config(['$routeProvider', '$locationProvider', + function($routeProvider, $locationProvider) { + + $locationProvider.html5Mode(true).hashPrefix('!'); + + $routeProvider.when('/projects', { + templateUrl: 'partials/projects.html', + controller: 'ApacheProjectsController as vm' + }).when('/home', { + templateUrl: 'partials/home.html', + controller: 'HomeController as vm' + }).otherwise({ redirectTo: '/home' }); + } + ]); +})(); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/ApacheProjectsController.js ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/ApacheProjectsController.js b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/ApacheProjectsController.js new file mode 100644 index 0000000..1fb0ca9 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/ApacheProjectsController.js @@ -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. + */ +(function() { + 'use strict'; + + angular + .module('app') + .controller('ApacheProjectsController', ApacheProjectsController); + + function ApacheProjectsController($log, DataService) { + var vm = this; + + init(); + + function init() { + return DataService.getProjects().then(function(data) { + vm.projects = data.projectNames; + return vm.projects; + }, function() { + $log.error('Could not receive project names.'); + }); + } + } +})(); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/AppController.js ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/AppController.js b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/AppController.js new file mode 100644 index 0000000..d6de31a --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/AppController.js @@ -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. + */ +(function() { + 'use strict'; + + angular + .module('app') + .controller('AppController', AppController); + + function AppController() { + + } +})(); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts-archetypes/blob/3662396a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/HomeController.js ---------------------------------------------------------------------- diff --git a/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/HomeController.js b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/HomeController.js new file mode 100644 index 0000000..44c7cf9 --- /dev/null +++ b/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/HomeController.js @@ -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. + */ +(function() { + 'use strict'; + + angular + .module('app') + .controller('HomeController', HomeController); + + function HomeController() { + var vm = this; + vm.name = "Sunshine"; + } +})(); \ No newline at end of file