Skip to content

Commit

Permalink
Corrections in various chapters.
Browse files Browse the repository at this point in the history
Corrected code snippets. And included additional instructions where absent.
  • Loading branch information
VineetReynolds committed Oct 21, 2014
1 parent a5d8022 commit eef59ee
Show file tree
Hide file tree
Showing 10 changed files with 622 additions and 343 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* </p>
*
* <p>
* Event's principle members are it's relationship to {@link EventCategory} - specifying the type of event it is - and
* Event's principal members are it's relationship to {@link EventCategory} - specifying the type of event it is - and
* {@link MediaItem} - providing the ability to add media (such as a picture) to the event for display. It also contains
* meta-data about the event, such as it's name and a description.
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,33 @@ public void setDescription(String description) {
/* toString(), equals() and hashCode() for TicketCategory, using the natural identity of the object */

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;

TicketCategory that = (TicketCategory) o;

if (description != null ? !description.equals(that.description) : that.description != null)
return false;

return true;
public String toString() {
return description;
}

@Override
public int hashCode() {
return description != null ? description.hashCode() : 0;
final int prime = 31;
int result = 1;
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
return result;
}

@Override
public String toString() {
return description;
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof TicketCategory))
return false;
TicketCategory other = (TicketCategory) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
return true;
}
}
2 changes: 1 addition & 1 deletion demo/src/main/webapp/resources/js/configurations/hybrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require(['../../../cordova'], function() {
},
onDeviceReady: function() {
// Detect if iOS 7 or higher and disable overlaying the status bar
if(window.device.platform.toLowerCase() == "ios" &&
if(window.device && window.device.platform.toLowerCase() == "ios" &&
parseFloat(window.device.version) >= 7.0) {
StatusBar.overlaysWebView(false);
StatusBar.styleDefault();
Expand Down
101 changes: 101 additions & 0 deletions tutorial/AdminHTML5.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,42 @@ Let’s add support for images to the Admin UI. `Events` and `Venues` have `Medi
...
------------------------------------------------------------------------------------------

Now that the bindings are set, we'll modify the underlying controllers to provide the URL of the MediaItem when the `{{mediaItemSelection.text}}` expression is evaluated:

.src/main/webapp/admin/scripts/scripts/controllers/editEventController.js
[source,html]
------------------------------------------------------------------------------------------
...
MediaItemResource.queryAll(function(items) {
$scope.mediaItemSelectionList = $.map(items, function(item) {
...
var labelObject = {
value : item.id,
text : item.url
};
...
});
});
...
------------------------------------------------------------------------------------------

.src/main/webapp/admin/scripts/scripts/controllers/editVenueController.js
[source,html]
------------------------------------------------------------------------------------------
...
MediaItemResource.queryAll(function(items) {
$scope.mediaItemSelectionList = $.map(items, function(item) {
...
var labelObject = {
value : item.id,
text : item.url
};
...
});
});
...
------------------------------------------------------------------------------------------

The admin site will now display the corresponding image if a media item is associated with the venue or event.

[TIP]
Expand Down Expand Up @@ -397,6 +433,71 @@ We shall now proceed to modify the AngularJS views to use the new properties in
<td><a href="#/TicketPrices/edit/{{result.id}}">{{result.ticketCategory.description}}</a></td>
------------------------------------------------------------------------------------------


=== Fixing the landing page of the Administration site

The generated administration site contains a landing page - `app.html` that works well as a standalone site.
However, we need to fix this page to make it work with the rest of the site.

For brevity, the significant sections of the corrected page are listed below:

.src/main/webapp/admin/app.html
[source,html]
------------------------------------------------------------------------------------------
<!DOCTYPE html>
<html lang="en" ng-app="ticketmonster">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ticket-monster</title>
<link href='http://fonts.googleapis.com/css?family=Rokkitt' rel='stylesheet' type='text/css'/>
<link href="styles/bootstrap.css" rel="stylesheet" media="screen">
<link href="styles/bootstrap-theme.css" rel="stylesheet" media="screen">
<link href="styles/main.css" rel="stylesheet" media="screen">
<link href="styles/custom-forge.css" rel="stylesheet" media="screen">
</head>
<body>
<div id="wrap">
<div id="logo" class="hidden-xs"><div class="wrap"><h1>Ticket Monster</h1></div></div>
<div class="navbar">
<div class="navbar-header">
<button type="button" class="navbar-toggle pull-left" data-toggle="collapse" data-target="#navbar-items">
<span class="glyphicon glyphicon-list"> Links</span>
</button>
<button type="button" class="navbar-toggle" data-toggle="offcanvas">
TicketMonster Entities <span class="glyphicon glyphicon-th text-right"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div id="navbar-items" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../index.html#about">About</a></li>
<li><a href="../index.html#events">Events</a></li>
<li><a href="../index.html#venues">Venues</a></li>
<li><a href="../index.html#bookings">Bookings</a></li>
<li><a href="../index.html#monitor">Monitor</a></li>
<li><a href="#">Administration</a></li>
</ul>
</div>
</div>
<div class="container">
...
</div>
...
</body>
</html>
------------------------------------------------------------------------------------------

It is sufficient to copy the corrected page from the project sources. Additionally, do not forget to copy the `src/main/webapp/admin/styles/custom-forge.css` file, that we now reference in the corrected page.


== Updating the ShrinkWrap deployment for the test suite

We've added classes to the project that should be in the ShrinkWrap deployment used in the test suite. Let us update the ShrinkWrap deployment to reflect this.
Expand Down

0 comments on commit eef59ee

Please sign in to comment.