List of usage examples for org.springframework.web.context.request RequestContextHolder currentRequestAttributes
public static RequestAttributes currentRequestAttributes() throws IllegalStateException
From source file:org.medici.bia.common.util.HtmlUtils.java
private static String getShowTopicHrefUrl(ForumTopic topic, boolean community) { StringBuilder stringBuilder = new StringBuilder(""); if (topic != null) { stringBuilder.append(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()) .getRequest().getContextPath()); stringBuilder.append((community ? "/community" : "/teaching") + "/ShowTopicForum.do?topicId="); stringBuilder.append(topic.getTopicId()); // link to the last topic page stringBuilder.append("&postForPage=10&postPageNumber="); stringBuilder.append((topic.getTotalReplies() / 10) + 1); stringBuilder.append("&postPageTotal="); stringBuilder.append((topic.getTotalReplies() / 10) + 1); }//from w w w.j av a 2 s . c om return stringBuilder.toString(); }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * Returns the servlet url to show the course transcription topic. * /* w ww . ja v a 2 s .c om*/ * @param courseTopic the course topic to show * @return the servlet url */ public static String getCourseTranscriptionTopicHrefUrl(ForumTopic courseTopic) { StringBuilder stringBuilder = new StringBuilder(""); if (courseTopic != null) { int pageNumber = courseTopic.getTotalReplies() < 2 ? 1 : (((courseTopic.getTotalReplies() - 1) / 10) + 1); stringBuilder .append(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()) .getRequest().getContextPath()) .append("/teaching/ShowCourseTranscription.do?topicId=").append(courseTopic.getTopicId()) // link to the last topic page .append("&postForPage=10&postPageNumber=").append(pageNumber).append("&postPageTotal=") .append(pageNumber).append("&completeDOM=false"); } return stringBuilder.toString(); }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * //www. ja va2 s . c om * @param singleRow * @param idAccessLog * @return */ @SuppressWarnings("rawtypes") public static Object showAccessLog(List inputList, Integer idAccessLog) { if (inputList == null) { return null; } List<String> retValue = new ArrayList<String>(inputList.size()); String anchorBegin = "<a class=\"searchResult\" href=\""; anchorBegin += ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest() .getContextPath(); anchorBegin += "/admin/ShowAccessLog.do?idAccessLog="; anchorBegin += idAccessLog; anchorBegin += "\">"; String hrefEnd = "</a>"; for (int i = 0; i < inputList.size(); i++) { retValue.add(anchorBegin + inputList.get(i) + hrefEnd); } return retValue; }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * //from w w w.j a v a 2 s. co m * @param placeAllId * @param numberOfActiveEndInPlace * @param description * @return */ public static String showActiveEndPeoplePlace(Integer placeAllId, Integer numberOfActiveEndInPlace, String description) { StringBuilder anchor = new StringBuilder("<a class=\"activeEnd\" href=\""); anchor.append(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest() .getContextPath()); anchor.append("/src/geobase/ShowActiveEndPeoplePlace.do?placeAllId="); anchor.append(placeAllId); anchor.append("\">"); anchor.append(numberOfActiveEndInPlace); anchor.append(' '); anchor.append(description); anchor.append("</a>"); return anchor.toString(); }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * //from w w w. j av a2 s.c o m * @param placeAllId * @param numberOfActiveStartInPlace * @param description * @return */ public static String showActiveStartPeoplePlace(Integer placeAllId, Integer numberOfActiveStartInPlace, String description) { StringBuilder anchor = new StringBuilder("<a class=\"activeStart\" href=\""); anchor.append(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest() .getContextPath()); anchor.append("/src/geobase/ShowActiveStartPeoplePlace.do?placeAllId="); anchor.append(placeAllId); anchor.append("\">"); anchor.append(numberOfActiveStartInPlace); anchor.append(' '); anchor.append(description); anchor.append("</a>"); return anchor.toString(); }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * /*w w w.j a v a 2 s.com*/ * @param placeAllId * @param numberOfBirthInPlace * @param description * @return */ public static String showBirthPeoplePlace(Integer placeAllId, Integer numberOfBirthInPlace, String description) { StringBuilder anchor = new StringBuilder("<a class=\"birth\" href=\""); anchor.append(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest() .getContextPath()); anchor.append("/src/geobase/ShowBirthPeoplePlace.do?placeAllId="); anchor.append(placeAllId); anchor.append("\">"); anchor.append(numberOfBirthInPlace); anchor.append(' '); anchor.append(description); anchor.append("</a>"); return anchor.toString(); }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * /*from ww w. j av a 2s .co m*/ * @param placeAllId * @param numberOfDeathInPlace * @param description * @return */ public static String showDeathPeoplePlace(Integer placeAllId, Integer numberOfDeathInPlace, String description) { StringBuilder anchor = new StringBuilder("<a class=\"death\" href=\""); anchor.append(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest() .getContextPath()); anchor.append("/src/geobase/ShowDeathPeoplePlace.do?placeAllId="); anchor.append(placeAllId); anchor.append("\">"); anchor.append(numberOfDeathInPlace); anchor.append(' '); anchor.append(description); anchor.append("</a>"); return anchor.toString(); }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * /*from ww w .j a v a 2s .c o m*/ * @param inputList * @param digitization * @return */ public static List<String> showDigitizedVolumeActiveIt(List<String> inputList, Digitization digitization) { StringBuilder anchorBegin = new StringBuilder("<a class=\"showActivateModal\" href=\""); anchorBegin.append(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest() .getContextPath()); anchorBegin.append("/digitization/ShowActivateVolumeModal.do?id="); anchorBegin.append(digitization.getId()); anchorBegin.append("\">"); String hrefEnd = "</a>"; List<String> retValue = new ArrayList<String>(inputList.size()); for (int i = 0; i < inputList.size(); i++) { StringBuilder stringBuilder = new StringBuilder(anchorBegin.toString()); stringBuilder.append(inputList.get(i)); stringBuilder.append(hrefEnd); retValue.add(stringBuilder.toString()); } return retValue; }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * /* w w w . j a va2 s . c o m*/ * @param inputList * @param digitization * @return */ public static List<String> showDigitizedVolumeDeactiveIt(List<String> inputList, Digitization digitization) { StringBuilder anchorBegin = new StringBuilder("<a class=\"showDeactivateModal\" href=\""); anchorBegin.append(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest() .getContextPath()); anchorBegin.append("/digitization/ShowDeactivateVolumeModal.do?id="); anchorBegin.append(digitization.getId()); anchorBegin.append("\">"); String hrefEnd = "</a>"; List<String> retValue = new ArrayList<String>(inputList.size()); for (int i = 0; i < inputList.size(); i++) { StringBuilder stringBuilder = new StringBuilder(anchorBegin.toString()); stringBuilder.append(inputList.get(i)); stringBuilder.append(hrefEnd); retValue.add(stringBuilder.toString()); } return retValue; }
From source file:org.medici.bia.common.util.HtmlUtils.java
/** * //from w w w. jav a2s . com * @param inputList * @param entryId * @return */ public static String showDocument(Integer entryId) { if (entryId == null) { return ""; } String url = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest() .getContextPath(); url += "/src/docbase/ShowDocument.do?entryId="; url += entryId; return url; }