Changeset 2346
- Timestamp:
- 11/12/12 09:50:10 (12 years ago)
- Location:
- vlo/trunk/vlo_webapp/src/main
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/pages/ShowResultPage.html
r1945 r2346 6 6 <div class="endgame"><br> 7 7 <div><a wicket:id="backLink" href="#"><wicket:message key="backToResult">[back]</wicket:message></a> | <a wicket:id="openBrowserLink"></a> 8 <a wicket:id="feedbackLink" style="float:right;" href="#"><img wicket:id="feedbackImage" height="32" width="32"/></a> 8 9 <p /> 9 10 </div> … … 19 20 </ul> 20 21 </div> 21 <div>22 <a wicket:id="feedback" href=""#">[[Feedback]]</a>23 </div>24 22 </div> 25 23 </wicket:extend> -
vlo/trunk/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/pages/ShowResultPage.java
r2020 r2346 12 12 import org.apache.wicket.PageParameters; 13 13 import org.apache.wicket.RequestCycle; 14 import org.apache.wicket.behavior.SimpleAttributeModifier; 14 15 import org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel; 15 16 import org.apache.wicket.extensions.markup.html.basic.SmartLinkMultiLineLabel; … … 23 24 import org.apache.wicket.markup.MarkupStream; 24 25 import org.apache.wicket.markup.html.basic.Label; 26 import org.apache.wicket.markup.html.image.Image; 25 27 import org.apache.wicket.markup.html.link.BookmarkablePageLink; 26 28 import org.apache.wicket.markup.html.link.ExternalLink; … … 32 34 import org.apache.wicket.protocol.http.WicketURLDecoder; 33 35 import org.apache.wicket.protocol.http.WicketURLEncoder; 36 import org.apache.wicket.resource.ContextRelativeResource; 34 37 import org.slf4j.Logger; 35 38 import org.slf4j.LoggerFactory; … … 46 49 public static final String PARAM_DOC_ID = "docId"; 47 50 public static final String feedbackfromURL = "http://www.clarin.eu/node/3502?url="; 51 52 private final static ImageResource FEEDBACK_IMAGE = new ImageResource(new ContextRelativeResource("Images/feedback.png"), "Report an Error"); 48 53 49 54 @SuppressWarnings("serial") … … 81 86 } 82 87 83 String thisURL = RequestUtils.toAbsolutePath(RequestCycle.get().urlFor(ShowResultPage.class, parameters).toString()); 84 try { 85 thisURL = URLEncoder.encode(thisURL,"UTF-8"); 86 } catch (UnsupportedEncodingException e) { 87 LOG.error(e.toString()); 88 } 89 add(new ExternalLink("feedback", feedbackfromURL+thisURL, "Give Feedback")); 88 // add feedback link 89 addFeedbackLink(parameters); 90 90 } 91 91 … … 199 199 } 200 200 } 201 202 private void addFeedbackLink(final PageParameters parameters) { 203 String thisURL = RequestUtils.toAbsolutePath(RequestCycle.get().urlFor(ShowResultPage.class, parameters).toString()); 204 try { 205 thisURL = URLEncoder.encode(thisURL,"UTF-8"); 206 } catch (UnsupportedEncodingException e) { 207 LOG.error(e.toString()); 208 } 209 210 Image resourceImg = new Image("feedbackImage", FEEDBACK_IMAGE.getResource()); 211 String title = "Report an error"; 212 resourceImg.add(new SimpleAttributeModifier("title", title)); 213 resourceImg.add(new SimpleAttributeModifier("alt", title)); 214 String href = getHref(feedbackfromURL+thisURL); 215 String name = feedbackfromURL+thisURL; 216 ExternalLink link = new ExternalLink("feedbackLink", href); 217 link.add(resourceImg); 218 link.add(new Label("feedbackLabel", name)); 219 add(link); 220 } 201 221 202 222 public static BookmarkablePageLink<ShowResultPage> createBookMarkableLink(String linkId, SearchPageQuery query, String docId) {
Note: See TracChangeset
for help on using the changeset viewer.