Skip to content

Commit

Permalink
[BUGFIX] Fix image file data value in json response
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto committed May 21, 2013
1 parent ef5f509 commit 4423064
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 49 deletions.
3 changes: 3 additions & 0 deletions src/resources/ImageResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public Image uploadImage(
} catch (SolrServerException e) {
e.printStackTrace();
}
image.getFile().setData(new byte[0]);
return image;
}

Expand Down Expand Up @@ -229,6 +230,8 @@ public String uploadImageIe(
image.setFile(file);

this.getImageService().insert(image);
image.getFile().setData(new byte[0]);

ObjectMapper mapper = new ObjectMapper();
try {
str = mapper.writeValueAsString(file);
Expand Down
210 changes: 161 additions & 49 deletions webroot/functunit-ui-booking.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<link rel="stylesheet" type="text/css" href="js/funcunit/qunit/qunit.css" />
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="http://wbpreview.com/previews/WB0L805L0/css/bootstrap-responsive.css" rel="stylesheet">
<link href="http://clabs.co/projects/acme_less/css/glyphicons.css" rel="stylesheet" >
<!-- Change SRC to point to your copy of funcunit.js -->
<script type='text/javascript' src='js/funcunit/funcunit.js'></script>
<script type='text/javascript' src='js/lib/jquery.min.js'></script>
Expand All @@ -25,7 +26,7 @@
// This view turns a Booking model into HTML. Will create LI elements.
$(document).ready( function(){
var BookingView = Backbone.View.extend({
tagName: 'li',
tagName: 'div',

events:{
'click': 'toggleBooking'
Expand Down Expand Up @@ -172,7 +173,7 @@
</div>
</div>


<div class="m-top"></div>

<aside class="sidebar">
<ul class="nav nav-tabs nav-stacked">
Expand Down Expand Up @@ -216,7 +217,7 @@
<a href="form.html">
<div>
<div class="ico">
<img src="./img/ico/ico-setting.gif">
<img src="./images/ico/ico-setting.gif">
</div>
<div class="title">
Settings
Expand Down Expand Up @@ -268,94 +269,94 @@
<div class="page-header">
<h1>Guests</h1>
</div>
<div class="row-fluid">

<div class="alert alert-info">
<button data-dismiss="alert" class="close">x</button>
<strong>Warning!</strong> You have 4 new messages
<a href="#">
<span class="label label-important">Read it!</span>
</a>
</div>

<div class="alert">
<button data-dismiss="alert" class="close">x</button>
<strong>Warning!</strong> You have 50 pending orders
<a href="#">
<span class="label label-info">Check it now!</span>
</a>
</div>
</div>
<div class="row-fluid">
<div class="span4 m-widget">
<div class="span5 m-widget">
<div class="m-widget-header">
<h3>Recent orders</h3>
<h3>Guests</h3>
</div>
<div class="m-widget-body">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>&nbsp;</th>
<th>Date In</th>
<th>Date Out</th>
<th>Sex</th>
<th>Tourism type</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>#0001</td>
<td><a href="#">Order item 1</a></td>
<td>Alberto Buschettu</td>
<td><a href="#">12/12/2006</a></td>
<td><a href="#">15/12/2006</a></td>
<td>M</td>
<td><span class="label label-important">cultural</span></td>
<td class="tr">
<a class="btn btn-primary" href="#">View</a>
<a class="" href="#"><i class="icon-search"></i></a>
</td>
<td>
<a class="" href="#"><i class="icon-remove"></i></a>
</td>
</tr>
<tr>
<td>#0002</td>
<td><a href="#">Order item 2</a></td>
<td>Francesco Buschettu</td>
<td><a href="#">12/12/2006</a></td>
<td><a href="#">15/12/2006</a></td>
<td>M</td>
<td><span class="label label-important">cultural</span></td>
<td class="tr">
<a class="btn btn-primary" href="#">View</a>
</td>
<td>
<a class="" href="#"><i class="icon-remove"></i></a>
</td>
</tr>
<tr>
<td>#0003</td>
<td><a href="#">Order item 3</a></td>
<td>Giuseppe Buschettu</td>
<td><a href="#">12/12/2006</a></td>
<td><a href="#">15/12/2006</a></td>
<td>M</td>
<td><span class="label label-important">cultural</span></td>
<td class="tr">
<a class="btn btn-primary" href="#">View</a>
</td>
<td>
<a class="" href="#"><i class="icon-remove"></i></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>

<div class="span8 m-widget">
<div class="span5 m-widget">
<div class="m-widget-header">
<h3>Today stats</h3>
<h3>Booker and Groupleader</h3>
</div>

<div class="m-widget-body">
<div class="row-fluid">
<a class="span3 m-stats-item" href="#">
<span class="m-stats-val">200+</span>
Orders
<a class="span4 m-stats-item" href="#">
<span class="m-stats-val">Franco Pinna</span>
booker
</a>

<a class="span3 m-stats-item" href="#">
<span class="m-stats-val">50</span>
Pending orders
<a class="span4 m-stats-item" href="#">
<span class="m-stats-val">Mario Spada</span>
Group leader
</a>

<a class="span3 m-stats-item" href="#">
<span class="m-stats-val">100+</span>
Customers
</a>

<a class="span3 m-stats-item" href="#">
<span class="m-stats-val">1000</span>
Products
</a>

</div>

</div>
</div>
<div class="row-fluid">

</div>
</div>
</div>

Expand Down Expand Up @@ -811,6 +812,117 @@ <h3>Today stats</h3>
}
}


.message .attachments {
border-bottom: 3px solid #F9F9F9;
border-top: 3px solid #F9F9F9;
font-size: 12px;
margin-bottom: 20px;
padding: 10px 0;
}
.message .attachments ul {
list-style: none outside none;
margin: 0;
}
.message .attachments ul li {
margin: 10px 0;
}
.message .attachments ul li span.label {
font-size: 12px !important;
}
.message .attachments ul li span.quickMenu {
float: right;
text-align: right;
}
.message .attachments ul li span.quickMenu .glyphicons {
padding: 5px 0 5px 25px;
}
.message .attachments ul li span.quickMenu .glyphicons i:before {
color: #3B3B41;
font-size: 14px;
margin: -2px 0 0 5px;
}
.priority.high {
background: none repeat scroll 0 0 #FFEDED;
margin-bottom: 1px;
}
.priority.high span {
background: none repeat scroll 0 0 #FF5454;
color: #FFFFFF;
display: inline-block;
font-size: 12px;
padding: 2px 10px;
}
.priority.medium {
background: none repeat scroll 0 0 #FEF8EB;
margin-bottom: 1px;
}
.priority.medium span {
background: none repeat scroll 0 0 #FABB3D;
color: #FFFFFF;
display: inline-block;
font-size: 12px;
padding: 2px 10px;
}
.priority.low {
background: none repeat scroll 0 0 #E4F5DC;
margin-bottom: 1px;
}
.priority.low span {
background: none repeat scroll 0 0 #78CD51;
color: #FFFFFF;
display: inline-block;
font-size: 12px;
padding: 2px 10px;
}
.task {
border-bottom: 1px solid #F9F9F9;
margin-bottom: 1px;
position: relative;
}
.task .desc {
display: inline-block;
font-size: 12px;
padding: 10px;
width: 75%;
}
.task .desc .title {
font-size: 18px;
margin-bottom: 5px;
}
.task .time {
display: inline-block;
font-size: 12px;
padding: 10px 10px 10px 0;
position: absolute;
right: 0;
text-align: right;
top: 0;
width: 15%;
}
.task .time .date {
font-size: 18px;
margin-bottom: 5px;
}
.task.last {
border-bottom: 1px solid transparent;
}
.task.high {
border-left: 2px solid #FF5454;
}
.task.medium {
border-left: 2px solid #FABB3D;
}
.task.low {
border-left: 2px solid #78CD51;
}
.timeline {
background: url("../img/timeline-bg.png") repeat-y scroll center top transparent;
height: 100%;
margin: 20px auto;
width: auto;
}

</style>


Expand Down

0 comments on commit 4423064

Please sign in to comment.