Skip to content

Commit 2b80ca6

Browse files
committed
Fixing up the admin and the forge scaffold
Previous commit took out the fix for main index.html I don't think the admin/index.xhtml needs to be changed Add guava version Moving the index.xhtml file to the proper location Mostly putting the patch back to the way it was Changing the method name so forge doesn't think it's a getter
1 parent 6b02adb commit 2b80ca6

File tree

3 files changed

+142
-14
lines changed

3 files changed

+142
-14
lines changed

demo/admin_layer.fsh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ scaffold setup;
1515

1616
@/* Enable RichFaces for wizzy widgets from entities */;
1717

18-
richfaces setup;
19-
18+
richfaces setup;
2019

2120
@/* Scaffold CRUD views for the entities that an admin would start drilling down into the data model from */;
2221

2322
scaffold from-entity org.jboss.jdf.example.ticketmonster.model.* --targetDir admin;
2423

24+
@/* Add in the version of Guava that works with Errai until a version of RichFaces has a more current version */;
25+
26+
project add-dependency com.google.guava:guava:12.0:compile
27+
2528
@/* Ask the user whether they want to patch in the changes described in the tutorial */;
2629

2730
set ACCEPT_DEFAULTS false;
@@ -34,6 +37,7 @@ if ( SHELL.promptBoolean("Apply manual functional changes described in tutorial?
3437
rm --force src/main/webapp/index.xhtml;
3538
} else if (v.startsWith("1.1.") || v.startsWith("1.2")) {
3639
echo Applying manual changes described in tutorial based on admin_layer_functional.patch;
40+
mv src/main/webapp/index.xhtml src/main/webapp/admin/index.xhtml;
3741
git apply -v --ignore-whitespace --ignore-space-change patches/admin_layer_functional.patch;
3842
} else {
3943
@SHELL.println("The version " + v + " is not supported yet, attempting to apply latest patch");

demo/patches/admin_layer_functional.patch

Lines changed: 134 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ index 689cc8c..f9aa6c1 100644
2727
}
2828
else
2929
{
30-
diff --git ../demo/src/main/webapp/admin/index.html ../demo/src/main/webapp/admin/index.html
31-
index 902113f..4036f32 100644
32-
--- ../demo/src/main/webapp/admin/index.html
33-
+++ ../demo/src/main/webapp/admin/index.html
34-
@@ -1,1 +1 @@
35-
-<meta http-equiv="refresh" content="0;url=./faces/admin/index.xhtml" />
36-
\ No newline at end of file
37-
+<meta http-equiv="refresh" content="0;url=../faces/admin/index.xhtml" />
38-
\ No newline at end of file
30+
diff --git ../demo/src/main/webapp/WEB-INF/web.xml ../demo/src/main/webapp/WEB-INF/web.xml
31+
index d1afd7b..e62b752 100644
32+
--- ../demo/src/main/webapp/WEB-INF/web.xml
33+
+++ ../demo/src/main/webapp/WEB-INF/web.xml
34+
@@ -32,7 +32,4 @@
35+
<session-config>
36+
<session-timeout>30</session-timeout>
37+
</session-config>
38+
- <welcome-file-list>
39+
- <welcome-file>faces/index.xhtml</welcome-file>
40+
- </welcome-file-list>
41+
</web-app>
3942
diff --git ../demo/src/main/webapp/admin/event/view.xhtml ../demo/src/main/webapp/admin/event/view.xhtml
4043
index 451479f..b952db0 100644
4144
--- ../demo/src/main/webapp/admin/event/view.xhtml
@@ -56,6 +59,84 @@ index 451479f..b952db0 100644
5659
</h:link>
5760
<h:outputText/>
5861
<h:outputLabel for="eventBeanEventCategory" value="Category:"/>
62+
diff --git ../demo/src/main/webapp/admin/index.html ../demo/src/main/webapp/admin/index.html
63+
index 902113f..4036f32 100644
64+
--- ../demo/src/main/webapp/admin/index.html
65+
+++ ../demo/src/main/webapp/admin/index.html
66+
@@ -1,70 +1 @@
67+
-<!DOCTYPE html>
68+
-<html>
69+
-<head>
70+
- <title>Ticket Monster</title>
71+
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
72+
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0;">
73+
-
74+
-
75+
- <link type="text/css" rel="stylesheet" href="../resources/css/screen.css"/>
76+
- <link rel="stylesheet" href="../resources/css/bootstrap.css" type="text/css" media="all"/>
77+
- <link rel="stylesheet" href="../resources/css/custom.css" type="text/css" media="all">
78+
-
79+
- <link href='http://fonts.googleapis.com/css?family=Rokkitt' rel='stylesheet' type='text/css'>
80+
-
81+
- <!-- Add JavaScript library for IE6-8 support of HTML5 elements -->
82+
- <!--[if lt IE 9]>
83+
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
84+
- <![endif]-->
85+
-
86+
-</head>
87+
-<body>
88+
-
89+
-<!--
90+
- Helper page, to be replaced by Forge generation
91+
--->
92+
-<div id="logo"><div class="wrap"><h1>Ticket Monster</h1></div></div>
93+
-<div id="container">
94+
- <div id="menu">
95+
- <div class="navbar">
96+
- <div class="navbar-inner">
97+
- <div class="container">
98+
- <ul class="nav">
99+
- <li><a href="../#about">About</a></li>
100+
- <li><a href="../#events">Events</a></li>
101+
- <li><a href="../#venues">Venues</a></li>
102+
- <li><a href="../#bookings">Bookings</a></li>
103+
- <li><a href="../booking-monitor.html">Monitor</a></li>
104+
- <li><a href="../admin">Administration</a></li>
105+
- </ul>
106+
- </div>
107+
- </div>
108+
- </div>
109+
- </div>
110+
- <div id="content" class="container-fluid">
111+
- <div class="well">
112+
- <h2 class="page-header special-title">Don't Forget About Forge</h2>
113+
-
114+
- <p>You must use JBoss Forge to generate the administration console. For doing so,
115+
- follow the next steps:</p>
116+
-
117+
- <ol>
118+
- <li>Install JBoss Forge</li>
119+
- <li>Start JBoss Forge by running the following in the command prompt: <pre>$ forge</pre></li>
120+
- <li>Verify that the Forge plugin is installed by running <pre>$ forge list-plugins</pre> and verifying that <code>org.richfaces.forge.richfaces-forge-plugin</code> is in the returned list.</li>
121+
- <li>If the outcome of the previous step was that the Richfaces plugin was not installed, do that now: <pre>$ forge install-plugin richfaces</pre></li>
122+
- <li>Once the Forge prompt is up, run: <pre>$ run admin_layer.fsh</pre> (answering <i>yes</i> on questions concerning patches)</li>
123+
- <li>Rebuild and redeploy</li>
124+
- </ol>
125+
-
126+
- <p>Navigate back to this page, you should see the Forge landing page instead.</p>
127+
- </div>
128+
- </div>
129+
-</div>
130+
-
131+
-<footer style="">
132+
- <div style="text-align: center;"><img src="../resources/img/dualbrand_as7eap.png" alt="HTML5"/></div>
133+
-</footer>
134+
-
135+
-</body>
136+
-</html>
137+
\ No newline at end of file
138+
+<meta http-equiv="refresh" content="0;url=../faces/admin/index.xhtml" />
139+
\ No newline at end of file
59140
diff --git ../demo/src/main/webapp/admin/venue/view.xhtml ../demo/src/main/webapp/admin/venue/view.xhtml
60141
index 06edc33..6676fbf 100644
61142
--- ../demo/src/main/webapp/admin/venue/view.xhtml
@@ -78,6 +159,50 @@ index 06edc33..6676fbf 100644
78159
</h:link>
79160
<h:outputText/>
80161
<h:outputLabel for="venueBeanVenueDescription" value="Description:"/>
162+
diff --git ../demo/src/main/webapp/index.html ../demo/src/main/webapp/index.html
163+
index b1c9bee..834133c 100644
164+
--- ../demo/src/main/webapp/index.html
165+
+++ ../demo/src/main/webapp/index.html
166+
@@ -1 +1,36 @@
167+
-<meta http-equiv="refresh" content="0;url=./faces/index.xhtml" />
168+
\ No newline at end of file
169+
+<!DOCTYPE html>
170+
+<html>
171+
+<head>
172+
+ <title>Ticket Monster</title>
173+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
174+
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"/>
175+
+
176+
+ <script type="text/javascript" src="resources/js/libs/modernizr-2.0.6.js"></script>
177+
+
178+
+ <!--
179+
+ A simple check on the client. For touch devices or small-resolution screens)
180+
+ show the mobile client. By enabling the mobile client on a small-resolution screen
181+
+ we allow for testing outside a mobile device (like for example the Mobile Browser
182+
+ simulator in JBoss Tools and JBoss Developer Studio).
183+
+ -->
184+
+ <script type="text/javascript">
185+
+ var loader = document.createElement("script")
186+
+ loader.setAttribute("src", "resources/js/libs/require.js");
187+
+ if ( navigator.userAgent == "TicktetMonster Cordova Webview iOS" ) {
188+
+ environment="hybrid-ios"
189+
+ }
190+
+ else if ( navigator.userAgent == "TicketMonster Cordova Webview Android" ) {
191+
+ environment="hybrid-android"
192+
+ }
193+
+ else if (Modernizr.touch || Modernizr.mq("only all and (max-width: 480px)")) {
194+
+ environment = "mobile"
195+
+ } else {
196+
+ environment = "desktop"
197+
+ };
198+
+ loader.setAttribute("data-main","resources/js/configurations/" + environment);
199+
+ document.head.appendChild(loader)
200+
+ </script>
201+
+</head>
202+
+<body>
203+
+</body>
204+
+</html>
205+
\ No newline at end of file
81206
diff --git ../demo/src/main/webapp/resources/tm/image.xhtml ../demo/src/main/webapp/resources/tm/image.xhtml
82207
new file mode 100644
83208
index 0000000..ceafffb
@@ -110,4 +235,3 @@ index 0000000..ceafffb
110235
+</body>
111236
+</html>
112237
\ No newline at end of file
113-

demo/src/main/java/org/jboss/jdf/example/ticketmonster/model/SectionAllocation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public ArrayList<Seat> allocateSeats(int seatCount, boolean contiguous) {
208208

209209
if (seats.size() == seatCount) {
210210
for (Seat seat : seats) {
211-
allocate(seat.getRowNumber() - 1, seat.getNumber() - 1, 1, getExpirationTimestamp());
211+
allocate(seat.getRowNumber() - 1, seat.getNumber() - 1, 1, expirationTimestamp());
212212
}
213213
return seats;
214214
} else {
@@ -318,7 +318,7 @@ public Long getId() {
318318
return id;
319319
}
320320

321-
private long getExpirationTimestamp() {
321+
private long expirationTimestamp() {
322322
return System.currentTimeMillis() + EXPIRATION_TIME;
323323
}
324324

0 commit comments

Comments
 (0)