├── .gitignore
├── .travis.yml
├── LICENSE
├── README.asciidoc
├── pom.xml
└── src
├── main
├── java
│ └── org
│ │ └── jboss
│ │ └── forge
│ │ └── addon
│ │ └── angularjs
│ │ ├── AngularScaffoldProvider.java
│ │ ├── CopyResourcesStrategy.java
│ │ ├── DetailTemplateStrategy.java
│ │ ├── InspectionResultProcessor.java
│ │ ├── JSONRestResourceFromEntityCommand.java
│ │ ├── ProcessTemplateStrategy.java
│ │ ├── ProcessingStrategy.java
│ │ ├── ResourcePathVisitor.java
│ │ ├── ResourceProvider.java
│ │ ├── ScaffoldResource.java
│ │ ├── ScaffoldableEntitySelectionWizard.java
│ │ ├── SearchTemplateStrategy.java
│ │ └── util
│ │ └── RestResourceTypeVisitor.java
└── resources
│ ├── META-INF
│ └── beans.xml
│ └── org
│ └── jboss
│ └── forge
│ └── addon
│ └── angularjs
│ ├── app.html.ftl
│ ├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
│ ├── img
│ └── forge-logo.png
│ ├── index.html.ftl
│ ├── scripts
│ ├── app.js.ftl
│ ├── controllers
│ │ ├── editEntityController.js.ftl
│ │ ├── flashController.js.ftl
│ │ ├── newEntityController.js.ftl
│ │ └── searchEntityController.js.ftl
│ ├── directives
│ │ ├── datepicker.js.ftl
│ │ ├── datetimepicker.js.ftl
│ │ └── timepicker.js.ftl
│ ├── filters
│ │ ├── genericSearchFilter.js.ftl
│ │ └── startFromFilter.js.ftl
│ ├── offcanvas.js
│ ├── services
│ │ ├── entityFactory.js.ftl
│ │ ├── flash.js.ftl
│ │ └── locationParser.js.ftl
│ └── vendor
│ │ ├── angular-resource.js
│ │ ├── angular-route.js
│ │ ├── angular.js
│ │ ├── bootstrap.js
│ │ ├── jquery-2.1.1.js
│ │ └── modernizr-2.8.3.min.js
│ ├── styles
│ ├── bootstrap-theme.css
│ ├── bootstrap.css
│ └── main.css
│ └── views
│ ├── detail.html.ftl
│ ├── includes
│ ├── basicPropertyDetail.html.ftl
│ ├── lookupPropertyDetail.html.ftl
│ ├── nToManyPropertyDetail.html.ftl
│ ├── nToOnePropertyDetail.html.ftl
│ ├── searchFormInput.html.ftl
│ ├── searchResults.html.ftl
│ └── searchResultsPaginator.html.ftl
│ ├── landing.html
│ └── search.html.ftl
└── test
└── java
└── org
└── jboss
└── forge
└── addon
└── angularjs
├── ProjectHelper.java
├── PropertyBuilder.java
├── TestHelpers.java
├── matchers
└── InspectionResultMatcher.java
└── tests
├── freemarker
├── Deployments.java
├── FreemarkerClientPartialsBasicPropertyTest.java
├── FreemarkerClientPartialsLookupPropertyTest.java
├── FreemarkerClientPartialsNToManyPropertyTest.java
├── FreemarkerClientPartialsNToOnePropertyTest.java
├── FreemarkerClientPartialsSearchInputTest.java
├── FreemarkerClientPartialsSearchResultsPaginatorTest.java
├── FreemarkerClientPartialsSearchResultsTest.java
└── FreemarkerClientTest.java
└── metawidget
└── InspectionResultProcessorTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | .settings
4 | .DS_Store
5 | dependency-reduced-pom.xml
6 | target/
7 | *.iml
8 | *.ipr
9 | *.iws
10 | *.swp
11 | /*/src/main/java/META-INF
12 | .gitignore.swp
13 | docs/reference/src/main/docbook/en-US/version_info.xml
14 | .idea
15 | .forge_settings
16 | .factorypath
17 | atlassian-ide-plugin.xml
18 | .externalToolBuilders
19 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | jdk:
4 | - oraclejdk8
5 |
6 | notifications:
7 | irc: chat.freenode.net#forge
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Eclipse Public License - v 1.0
2 |
3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
4 | LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
5 | CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6 |
7 | 1. DEFINITIONS
8 |
9 | "Contribution" means:
10 |
11 | a) in the case of the initial Contributor, the initial code and documentation
12 | distributed under this Agreement, and
13 | b) in the case of each subsequent Contributor:
14 | i) changes to the Program, and
15 | ii) additions to the Program;
16 |
17 | where such changes and/or additions to the Program originate from and are
18 | distributed by that particular Contributor. A Contribution 'originates'
19 | from a Contributor if it was added to the Program by such Contributor
20 | itself or anyone acting on such Contributor's behalf. Contributions do not
21 | include additions to the Program which: (i) are separate modules of
22 | software distributed in conjunction with the Program under their own
23 | license agreement, and (ii) are not derivative works of the Program.
24 |
25 | "Contributor" means any person or entity that distributes the Program.
26 |
27 | "Licensed Patents" mean patent claims licensable by a Contributor which are
28 | necessarily infringed by the use or sale of its Contribution alone or when
29 | combined with the Program.
30 |
31 | "Program" means the Contributions distributed in accordance with this
32 | Agreement.
33 |
34 | "Recipient" means anyone who receives the Program under this Agreement,
35 | including all Contributors.
36 |
37 | 2. GRANT OF RIGHTS
38 | a) Subject to the terms of this Agreement, each Contributor hereby grants
39 | Recipient a non-exclusive, worldwide, royalty-free copyright license to
40 | reproduce, prepare derivative works of, publicly display, publicly
41 | perform, distribute and sublicense the Contribution of such Contributor,
42 | if any, and such derivative works, in source code and object code form.
43 | b) Subject to the terms of this Agreement, each Contributor hereby grants
44 | Recipient a non-exclusive, worldwide, royalty-free patent license under
45 | Licensed Patents to make, use, sell, offer to sell, import and otherwise
46 | transfer the Contribution of such Contributor, if any, in source code and
47 | object code form. This patent license shall apply to the combination of
48 | the Contribution and the Program if, at the time the Contribution is
49 | added by the Contributor, such addition of the Contribution causes such
50 | combination to be covered by the Licensed Patents. The patent license
51 | shall not apply to any other combinations which include the Contribution.
52 | No hardware per se is licensed hereunder.
53 | c) Recipient understands that although each Contributor grants the licenses
54 | to its Contributions set forth herein, no assurances are provided by any
55 | Contributor that the Program does not infringe the patent or other
56 | intellectual property rights of any other entity. Each Contributor
57 | disclaims any liability to Recipient for claims brought by any other
58 | entity based on infringement of intellectual property rights or
59 | otherwise. As a condition to exercising the rights and licenses granted
60 | hereunder, each Recipient hereby assumes sole responsibility to secure
61 | any other intellectual property rights needed, if any. For example, if a
62 | third party patent license is required to allow Recipient to distribute
63 | the Program, it is Recipient's responsibility to acquire that license
64 | before distributing the Program.
65 | d) Each Contributor represents that to its knowledge it has sufficient
66 | copyright rights in its Contribution, if any, to grant the copyright
67 | license set forth in this Agreement.
68 |
69 | 3. REQUIREMENTS
70 |
71 | A Contributor may choose to distribute the Program in object code form under
72 | its own license agreement, provided that:
73 |
74 | a) it complies with the terms and conditions of this Agreement; and
75 | b) its license agreement:
76 | i) effectively disclaims on behalf of all Contributors all warranties
77 | and conditions, express and implied, including warranties or
78 | conditions of title and non-infringement, and implied warranties or
79 | conditions of merchantability and fitness for a particular purpose;
80 | ii) effectively excludes on behalf of all Contributors all liability for
81 | damages, including direct, indirect, special, incidental and
82 | consequential damages, such as lost profits;
83 | iii) states that any provisions which differ from this Agreement are
84 | offered by that Contributor alone and not by any other party; and
85 | iv) states that source code for the Program is available from such
86 | Contributor, and informs licensees how to obtain it in a reasonable
87 | manner on or through a medium customarily used for software exchange.
88 |
89 | When the Program is made available in source code form:
90 |
91 | a) it must be made available under this Agreement; and
92 | b) a copy of this Agreement must be included with each copy of the Program.
93 | Contributors may not remove or alter any copyright notices contained
94 | within the Program.
95 |
96 | Each Contributor must identify itself as the originator of its Contribution,
97 | if
98 | any, in a manner that reasonably allows subsequent Recipients to identify the
99 | originator of the Contribution.
100 |
101 | 4. COMMERCIAL DISTRIBUTION
102 |
103 | Commercial distributors of software may accept certain responsibilities with
104 | respect to end users, business partners and the like. While this license is
105 | intended to facilitate the commercial use of the Program, the Contributor who
106 | includes the Program in a commercial product offering should do so in a manner
107 | which does not create potential liability for other Contributors. Therefore,
108 | if a Contributor includes the Program in a commercial product offering, such
109 | Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
110 | every other Contributor ("Indemnified Contributor") against any losses,
111 | damages and costs (collectively "Losses") arising from claims, lawsuits and
112 | other legal actions brought by a third party against the Indemnified
113 | Contributor to the extent caused by the acts or omissions of such Commercial
114 | Contributor in connection with its distribution of the Program in a commercial
115 | product offering. The obligations in this section do not apply to any claims
116 | or Losses relating to any actual or alleged intellectual property
117 | infringement. In order to qualify, an Indemnified Contributor must:
118 | a) promptly notify the Commercial Contributor in writing of such claim, and
119 | b) allow the Commercial Contributor to control, and cooperate with the
120 | Commercial Contributor in, the defense and any related settlement
121 | negotiations. The Indemnified Contributor may participate in any such claim at
122 | its own expense.
123 |
124 | For example, a Contributor might include the Program in a commercial product
125 | offering, Product X. That Contributor is then a Commercial Contributor. If
126 | that Commercial Contributor then makes performance claims, or offers
127 | warranties related to Product X, those performance claims and warranties are
128 | such Commercial Contributor's responsibility alone. Under this section, the
129 | Commercial Contributor would have to defend claims against the other
130 | Contributors related to those performance claims and warranties, and if a
131 | court requires any other Contributor to pay any damages as a result, the
132 | Commercial Contributor must pay those damages.
133 |
134 | 5. NO WARRANTY
135 |
136 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
137 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
138 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
139 | NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
140 | Recipient is solely responsible for determining the appropriateness of using
141 | and distributing the Program and assumes all risks associated with its
142 | exercise of rights under this Agreement , including but not limited to the
143 | risks and costs of program errors, compliance with applicable laws, damage to
144 | or loss of data, programs or equipment, and unavailability or interruption of
145 | operations.
146 |
147 | 6. DISCLAIMER OF LIABILITY
148 |
149 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
150 | CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
151 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
152 | LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
153 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
154 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
155 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
156 | OF SUCH DAMAGES.
157 |
158 | 7. GENERAL
159 |
160 | If any provision of this Agreement is invalid or unenforceable under
161 | applicable law, it shall not affect the validity or enforceability of the
162 | remainder of the terms of this Agreement, and without further action by the
163 | parties hereto, such provision shall be reformed to the minimum extent
164 | necessary to make such provision valid and enforceable.
165 |
166 | If Recipient institutes patent litigation against any entity (including a
167 | cross-claim or counterclaim in a lawsuit) alleging that the Program itself
168 | (excluding combinations of the Program with other software or hardware)
169 | infringes such Recipient's patent(s), then such Recipient's rights granted
170 | under Section 2(b) shall terminate as of the date such litigation is filed.
171 |
172 | All Recipient's rights under this Agreement shall terminate if it fails to
173 | comply with any of the material terms or conditions of this Agreement and does
174 | not cure such failure in a reasonable period of time after becoming aware of
175 | such noncompliance. If all Recipient's rights under this Agreement terminate,
176 | Recipient agrees to cease use and distribution of the Program as soon as
177 | reasonably practicable. However, Recipient's obligations under this Agreement
178 | and any licenses granted by Recipient relating to the Program shall continue
179 | and survive.
180 |
181 | Everyone is permitted to copy and distribute copies of this Agreement, but in
182 | order to avoid inconsistency the Agreement is copyrighted and may only be
183 | modified in the following manner. The Agreement Steward reserves the right to
184 | publish new versions (including revisions) of this Agreement from time to
185 | time. No one other than the Agreement Steward has the right to modify this
186 | Agreement. The Eclipse Foundation is the initial Agreement Steward. The
187 | Eclipse Foundation may assign the responsibility to serve as the Agreement
188 | Steward to a suitable separate entity. Each new version of the Agreement will
189 | be given a distinguishing version number. The Program (including
190 | Contributions) may always be distributed subject to the version of the
191 | Agreement under which it was received. In addition, after a new version of the
192 | Agreement is published, Contributor may elect to distribute the Program
193 | (including its Contributions) under the new version. Except as expressly
194 | stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
195 | licenses to the intellectual property of any Contributor under this Agreement,
196 | whether expressly, by implication, estoppel or otherwise. All rights in the
197 | Program not expressly granted under this Agreement are reserved.
198 |
199 | This Agreement is governed by the laws of the State of New York and the
200 | intellectual property laws of the United States of America. No party to this
201 | Agreement will bring a legal action under this Agreement more than one year
202 | after the cause of action arose. Each party waives its rights to a jury trial in
203 | any resulting litigation.
--------------------------------------------------------------------------------
/README.asciidoc:
--------------------------------------------------------------------------------
1 | == AngularJS Addon for JBoss Forge 2
2 | :idprefix: id_
3 |
4 | image:https://travis-ci.org/forge/angularjs-addon.svg?branch=master["Build Status", link="https://travis-ci.org/forge/angularjs-addon"]
5 |
6 | The angularjs-addon enables developers to automate several tasks in the construction of applications that use AngularJS, in JBoss Forge.
7 | This addon provides *standalone* functionality, and it can be re-used in other addons.
8 |
9 | === Dependencies:
10 | === Depends on
11 | [options="header"]
12 | |===
13 | |Addon |Exported |Optional
14 | |scaffold-spi
15 | |no
16 | |no
17 | |javaee
18 | |no
19 | |no
20 | |templates
21 | |no
22 | |no
23 | |text
24 | |no
25 | |no
26 | |convert
27 | |no
28 | |no
29 | |parser-java
30 | |no
31 | |no
32 | |cdi
33 | |no
34 | |no
35 | |===
36 |
37 | == Setup
38 | This Addon requires the following installation steps.
39 |
40 | === Add configuration to pom.xml
41 | To use this addon, you must add it as a dependency in the *pom.xml* of your `forge-addon` classified artifact:
42 | (Make sure the dependency is put all the way to the left, and uses 3 spaces for indentation of GAV)
43 | [source,xml]
44 | ----
45 |
46 | org.jboss.forge.addon
47 | angularjs
48 | forge-addon
49 | ${version}
50 |
51 | ----
52 | == Features
53 | * Scaffold web-apps from JPA entities. The generated scaffold uses a thick-client based on AngularJS, and a JAX-RS RESTful backend.
54 |
55 | == Usage
56 |
57 | === Prerequsites
58 |
59 | JBoss Tools with Forge 2.4.1, or JBoss Forge-CLI 2.4.1.
60 |
61 | === Install the addon:
62 |
63 | Assuming JBoss Tools with Forge, or Forge-CLI is installed:
64 |
65 | *(JBT)*
66 |
67 | Ctrl+5. Run the "Install the addon from Git" command, using these coordinates: https://github.com/forge/angularjs-addon.git
68 |
69 | *(Forge-CLI)*
70 |
71 | ----
72 | $ addon-install-from-git --url https://github.com/forge/angularjs-addon.git
73 | ----
74 |
75 | === Create a new project
76 |
77 | *(JBT)*
78 |
79 | Ctrl+5. Run the "Project: New" command. Create a new web application, named 'hello-angular'.
80 |
81 | *(Forge-CLI)*
82 |
83 | ----
84 | $ project-new --named hello-angular
85 | ----
86 |
87 | === Setup JPA
88 |
89 | *(JBT)*
90 |
91 | Ctrl+5. Run the "JPA: Setup" command. Defaults should be sufficient.
92 |
93 | *(Forge-CLI)*
94 |
95 | ----
96 | $ jpa-setup
97 | ----
98 |
99 | === Create a few JPA entities with fields
100 |
101 | *(JBT)*
102 |
103 | Ctrl+5. Run the "JPA: New Entity" command. Create a new entity (with an auto-generated Id) named 'Customer'.
104 |
105 | Select the newly created Customer Java source file in the navigator. Ctrl+5. Run the "JPA: New Field" command. Create a new field of type String in the Customer entity named 'fullName'.
106 |
107 | Ctrl+5 again and re-run the same command. Create a new field of type int in the Customer entity named 'age'.
108 |
109 |
110 | *(Forge-CLI)*
111 |
112 | ----
113 | $ jpa-new-entity --named Customer
114 | $ jpa-new-field --named fullName
115 | $ jpa-new-field --named age --type int
116 | ----
117 |
118 | === Setup Bean Validation and create new constraints
119 |
120 | *(JBT)*
121 |
122 | Ctrl+5. Run the "Constraint: Setup" command. Choose the "Generic Java EE" BV provider to use.
123 |
124 | Ctrl+5. Run the "Constraint: Add" command. Create a NotNull constraint on the fullName field.
125 |
126 | Ctrl+5. Run the "Constraint: Add" command. Create a Min constraint on the age field, with min value of 0.
127 |
128 | *(Forge-CLI)*
129 |
130 | ----
131 | $ constraint-setup --providers Generic\ Java\ EE
132 | $ constraint-add --onProperty fullName --constraint NotNull
133 | $ constraint-add --onProperty age --constraint Min --value 0
134 | ----
135 |
136 |
137 | === Setup and generate the AngularJS scaffold
138 |
139 | *(JBT)*
140 |
141 | Ctrl+5. Run the "Scaffold: Setup" command. Choose the "AngularJS" type to use.
142 |
143 | Ctrl+5. Run the "Scaffold: Generate" command. Choose the "AngularJS" type to use. Select the Customer entity to scaffold. (I'll rework this bit across scaffold providers when fixing FORGE-1501 and FORGE-1731).
144 |
145 | On completion, a JAX-RS resource that can handle requests and responses of media type application/json should be created, in conjunction with the AngularJS views.
146 |
147 | *(Forge-CLI)*
148 |
149 | ----
150 | $ scaffold-setup --provider AngularJS
151 | $ scaffold-generate --provider AngularJS --targets org.hello.angular.model.Customer
152 | ----
153 |
154 | This app can now be deployed to JBoss EAP.
155 |
156 | == Issue Tracker
157 |
158 | We do not use GitHub issues for issue tracking.
159 | Please raise issues in the https://issues.jboss.org//secure/CreateIssueDetails!init.jspa?pid=12312020&components=12317568&issuetype=1&priority=3[JBoss JIRA Issue tracker]. The project and component is *FORGEPLUGINS* and *AngularJS Scaffold* respectively. We also track feature requests in the same space.
160 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 | org.jboss
6 | jboss-parent
7 | 20
8 |
9 | org.jboss.forge.addon
10 | angularjs
11 | 2.1.8-SNAPSHOT
12 |
13 | UTF-8
14 | true
15 |
16 | 0.0.4.Final
17 | 2.23.7.Final
18 | 3.2.3.Final
19 |
20 |
21 | scm:git:git://github.com/forge/angularjs-addon.git
22 | scm:git:git@github.com:forge/angularjs-addon.git
23 | http://github.com/forge/angularjs-addon
24 |
25 |
26 |
27 |
28 | org.jboss.forge
29 | forge-bom
30 | ${version.forge}
31 | pom
32 | import
33 |
34 |
35 |
36 |
37 |
38 | org.jboss.forge.addon
39 | scaffold-spi
40 | forge-addon
41 | provided
42 |
43 |
44 |
45 | org.jboss.forge.descriptors
46 | javaee-descriptors
47 | ${version.forge.descriptors}
48 | provided
49 |
50 |
51 | org.jboss.forge.addon
52 | javaee
53 | forge-addon
54 | provided
55 |
56 |
57 | org.jboss.forge.addon
58 | projects
59 | forge-addon
60 | provided
61 |
62 |
63 |
64 | org.jboss.forge.addon
65 | templates
66 | forge-addon
67 | provided
68 |
69 |
70 | org.jboss.forge.addon
71 | text
72 | forge-addon
73 | provided
74 |
75 |
76 | org.jboss.forge.addon
77 | convert
78 | forge-addon
79 | provided
80 |
81 |
82 | org.jboss.forge.addon
83 | parser-java
84 | forge-addon
85 | provided
86 |
87 |
88 | org.jboss.forge.furnace.container
89 | cdi
90 | forge-addon
91 | provided
92 |
93 |
94 | org.jboss.forge.addon
95 | maven
96 | forge-addon
97 | test
98 |
99 |
100 | org.jboss.forge.furnace.test
101 | furnace-test-harness
102 | test
103 |
104 |
105 | org.jboss.forge.furnace.test
106 | arquillian-furnace-classpath
107 | test
108 |
109 |
110 | org.jsoup
111 | jsoup
112 | 1.7.1
113 | test
114 |
115 |
116 |
117 |
118 |
119 | maven-jar-plugin
120 |
121 |
122 | create-forge-addon
123 | package
124 |
125 | jar
126 |
127 |
128 | forge-addon
129 |
130 |
131 |
132 |
133 |
134 |
135 | org.jboss.jandex
136 | jandex-maven-plugin
137 | 1.0.3
138 |
139 |
140 | make-index
141 |
142 | jandex
143 |
144 | true
145 |
146 |
147 |
148 |
149 | org.apache.maven.plugins
150 | maven-release-plugin
151 | true
152 |
153 | -DskipTests
154 | clean install
155 | gpg-sign,jboss-release
156 | @{project.version}
157 |
158 |
159 |
160 | org.sonatype.plugins
161 | nexus-staging-maven-plugin
162 | 1.6.3
163 | true
164 |
165 | true
166 | ossrh
167 | https://oss.sonatype.org/
168 |
169 |
170 |
171 |
172 |
173 |
175 |
176 | org.eclipse.m2e
177 | lifecycle-mapping
178 | 1.0.0
179 |
180 |
181 |
182 |
183 |
184 | org.jboss.jandex
185 | jandex-maven-plugin
186 | [1.0.3,)
187 |
188 | jandex
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 | ${forge.angularjs.scm.connection}
205 | ${forge.angularjs.developer.connection}
206 | ${forge.angularjs.scm.url}
207 | HEAD
208 |
209 |
210 |
211 |
212 | ossrh
213 | https://oss.sonatype.org/content/repositories/snapshots
214 |
215 |
216 | ossrh
217 | https://oss.sonatype.org/service/local/staging/deploy/maven2/
218 |
219 |
220 |
221 |
222 |
--------------------------------------------------------------------------------
/src/main/java/org/jboss/forge/addon/angularjs/CopyResourcesStrategy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 Red Hat, Inc. and/or its affiliates.
3 | *
4 | * Licensed under the Eclipse Public License version 1.0, available at
5 | * http://www.eclipse.org/legal/epl-v10.html
6 | */
7 | package org.jboss.forge.addon.angularjs;
8 |
9 | import org.jboss.forge.addon.projects.facets.WebResourcesFacet;
10 | import org.jboss.forge.addon.resource.Resource;
11 | import org.jboss.forge.addon.scaffold.util.ScaffoldUtil;
12 |
13 | /**
14 | * A {@link ProcessingStrategy} to copy the contents of the {@link ScaffoldResource} from it's source on the classpath
15 | * to it's destination in the project's web resources.
16 | */
17 | public class CopyResourcesStrategy implements ProcessingStrategy
18 | {
19 |
20 | private final WebResourcesFacet web;
21 |
22 | public CopyResourcesStrategy(WebResourcesFacet web)
23 | {
24 | this.web = web;
25 | }
26 |
27 | @Override
28 | public Resource> execute(ScaffoldResource scaffoldResource)
29 | {
30 | return ScaffoldUtil.createOrOverwrite(web.getWebResource(scaffoldResource.getDestination()), getClass()
31 | .getResourceAsStream(scaffoldResource.getSource()));
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/jboss/forge/addon/angularjs/DetailTemplateStrategy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2013 Red Hat, Inc. and/or its affiliates.
3 | *
4 | * Licensed under the Eclipse Public License version 1.0, available at
5 | * http://www.eclipse.org/legal/epl-v10.html
6 | */
7 | package org.jboss.forge.addon.angularjs;
8 |
9 | import static org.jboss.forge.addon.angularjs.AngularScaffoldProvider.SCAFFOLD_DIR;
10 |
11 | import java.io.IOException;
12 | import java.util.List;
13 | import java.util.Map;
14 |
15 | import org.jboss.forge.addon.projects.Project;
16 | import org.jboss.forge.addon.projects.facets.WebResourcesFacet;
17 | import org.jboss.forge.addon.resource.Resource;
18 | import org.jboss.forge.addon.resource.ResourceFactory;
19 | import org.jboss.forge.addon.templates.Template;
20 | import org.jboss.forge.addon.templates.TemplateFactory;
21 | import org.jboss.forge.addon.templates.facets.TemplateFacet;
22 | import org.jboss.forge.addon.templates.freemarker.FreemarkerTemplate;
23 |
24 | /**
25 | * A strategy for generating the detail page with included files.
26 | */
27 | public class DetailTemplateStrategy implements ProcessingStrategy
28 | {
29 | private static final String BASIC_PROPERTY_DETAIL = "/views/includes/basicPropertyDetail.html.ftl";
30 | private static final String LOOKUP_PROPERTY_DETAIL = "/views/includes/lookupPropertyDetail.html.ftl";
31 | private static final String N_TO_MANY_PROPERTY_DETAIL = "/views/includes/nToManyPropertyDetail.html.ftl";
32 | private static final String N_TO_ONE_PROPERTY_DETAIL = "/views/includes/nToOnePropertyDetail.html.ftl";
33 |
34 | private final WebResourcesFacet web;
35 |
36 | private final Project project;
37 |
38 | private final Map dataModel;
39 |
40 | private final ResourceFactory resourceFactory;
41 |
42 | private final TemplateFactory templateFactory;
43 |
44 | public DetailTemplateStrategy(WebResourcesFacet web, ResourceFactory resourceFactory, Project project,
45 | TemplateFactory templateFactory, Map dataModel)
46 | {
47 | this.web = web;
48 | this.resourceFactory = resourceFactory;
49 | this.project = project;
50 | this.templateFactory = templateFactory;
51 | this.dataModel = dataModel;
52 | }
53 |
54 | @Override
55 | public Resource> execute(ScaffoldResource scaffoldResource)
56 | {
57 | @SuppressWarnings("unchecked")
58 | List