public void save() throws Exception { ConsentOrderService consentOrderService = ConsentOrderService.getConsentOrderService(); this.reOrderActnSet(); int idx; consntOrder.getConsntOrdExhbts().clear(); Iterator it = actnList.iterator(); while (it.hasNext()) { ConsntOrdExhbt exhb = (ConsntOrdExhbt) it.next(); idx = actnList.indexOf(exhb); exhb.setSeqNo(idx + 1); if (0 == exhb.getId().getRegDocEt().getUsrId()) { exhb.getId().getRegDocEt().setUsrId(usrBean.getUsrId()); } consntOrder.getConsntOrdExhbts().add(exhb); } if (isUploadDocs()) { uploadFiles(); // first saving the documents and setting upload info setUploadFilesFlag(true); } for (ConsntOrdExhbt exhibit : getConsntOrder().getConsntOrdExhbts()) { if (exhibit.getId().getRegDocEt().isToBeUploaded()) { DocumentService.getDocumentService().saveNoCommit(exhibit.getId().getRegDocEt()); exhibit.getId().getRegDocEt().setToBeUploaded(false); } } log.info("Saving Exhibits to the Consent Order"); consentOrderService.saveConsentOrder(consntOrder); this.setDocName(""); this.setFileName(""); this.setSelectedFileListSize(0); this.setPreviousSelFiles(0); this.setAddNewExhibits(false); if (!isUploadDocs()) { this.addMessage(FacesMessage.SEVERITY_INFO, " Exhibits Saved successfully."); } }
private static String genStyleCode(FacesContext facesContext) { UserBean userBean = (UserBean) facesContext.getApplication().createValueBinding("#{UserBean}").getValue(facesContext); long height = userBean.getScrHeight(); long defaultHeight = 864L; // long multiples = Math.round((height - defaultHeight)/(20 * defaultHeight/height) ); long multiples = Math.round((height - defaultHeight) / (20)); long px = 7 * Math.round((height - defaultHeight) / (20 * defaultHeight / height)); long width = userBean.getScrWidth(); long defaultWidth = 1152L; long wmultiples = Math.round((width - defaultWidth) / 20); long wpx = 10 * wmultiples; StringBuffer code = new StringBuffer(); code.append("div.h5em{height: " + (5 + (multiples <= -2 ? 1 : multiples)) + "em;}"); code.append("div.h8em{height: " + (8 + (multiples <= -6 ? 2 : multiples)) + "em;}"); code.append("div.h14em{height: " + (14 + multiples) + "em;}"); code.append("div.h15em{height: " + (15 + multiples) + "em;}"); code.append("div.h18em{height: " + (18 + multiples) + "em;}"); code.append("div.h20em{height: " + (20 + multiples) + "em;}"); code.append("div.h22em{height: " + (22 + multiples) + "em;}"); code.append("div.h25em{height: " + (25 + multiples) + "em;}"); code.append("div.h40em{height: " + (40 + multiples) + "em;}"); code.append("div.h48em{height: " + (48 + multiples) + "em;}"); code.append("div.h50em{height: " + (50 + multiples) + "em;}"); code.append("div.h25{height: " + (25 + (px <= 0 ? 0 : px)) + "px;}"); code.append("div.h40{height: " + (40 + (px <= -10 ? -5 : px)) + "px;}"); code.append("div.h45{height: " + (45 + (px <= -15 ? -10 : px)) + "px;}"); code.append("div.h50{height: " + (50 + (px <= -20 ? -10 : px)) + "px;}"); code.append("div.sph50{height: " + (50 + (px <= 0 ? 50 : px)) + "px;}"); code.append("div.h53{height: " + (53 + (px <= -23 ? -13 : px)) + "px;}"); code.append("div.h60{height: " + (60 + (px <= -25 ? -15 : px)) + "px;}"); code.append("div.h70{height: " + (70 + (px <= -30 ? -20 : px)) + "px;}"); code.append("div.h75{height: " + (75 + (px <= -35 ? -20 : px)) + "px;}"); code.append("div.h80{height: " + (80 + (px <= -40 ? -30 : px)) + "px;}"); code.append("div.sph80{height: " + (80 + (px <= 0 ? 20 : px)) + "px;}"); code.append("div.h90{height: " + (90 + (px <= -40 ? -35 : px)) + "px;}"); code.append("div.h100{height: " + (100 + (px <= -50 ? -40 : px)) + "px;}"); code.append("div.h120{height: " + (120 + (px <= -60 ? -50 : px)) + "px;}"); code.append("div.h125{height: " + (125 + (px <= -60 ? -55 : px)) + "px;}"); code.append("div.h150{height: " + (150 + (px <= -70 ? -60 : px)) + "px;}"); code.append("div.h175{height: " + (175 + px) + "px;}"); code.append("div.h200{height: " + (200 + px) + "px;}"); code.append("div.h225{height: " + (225 + px) + "px;}"); code.append("div.h250{height: " + (250 + px) + "px;}"); code.append("div.h275{height: " + (275 + px) + "px;}"); code.append("div.h300{height: " + (300 + px) + "px;}"); code.append("div.h325{height: " + (325 + px) + "px;}"); code.append("div.h350{height: " + (350 + px) + "px;}"); code.append("div.h375{height: " + (375 + px) + "px;}"); code.append("div.h400{height: " + (400 + px) + "px;}"); code.append("div.h450{height: " + (450 + px) + "px;}"); code.append("div.h500{height: " + (500 + px) + "px;}"); code.append("div.h550{height: " + (550 + px) + "px;}"); code.append("div.h600{height: " + (600 + px) + "px;}"); code.append("div.h650{height: " + (650 + px) + "px;}"); code.append(".ht8em{height: " + (8 + (multiples <= -6 ? 2 : multiples)) + "em;}"); code.append(".htOtherCond{height: " + Math.round((300 + px) / 3) + "px;}"); code.append(".ht15{height: " + (15 + (px <= 0 ? 0 : px)) + "px;}"); code.append(".ht20{height: " + (20 + (px <= 0 ? 0 : px)) + "px;}"); code.append(".ht25{height: " + (25 + (px <= 0 ? 0 : px)) + "px;}"); code.append(".ht50{height: " + (50 + (px <= -20 ? -10 : px)) + "px;}"); code.append(".ht75{height: " + (75 + (px <= -35 ? -20 : px)) + "px;}"); code.append(".ht100{height: " + (100 + (px <= -50 ? -40 : px)) + "px;}"); code.append(".ht300{height: " + (300 + px) + "px;}"); code.append(".ht350{height: " + (350 + px) + "px;}"); code.append(".ht400{height: " + (400 + px) + "px;}"); code.append(".ht450{height: " + (450 + px) + "px;}"); code.append(".ht500{height: " + (500 + px) + "px;}"); code.append(".ht550{height: " + (550 + px) + "px;}"); // code.append(".wh80{width: "+(80+wpx)+"px;}"); // code.append(".wh150{width: "+(150+wpx)+"px;}"); // code.append(".wh190{width: "+(190+wpx)+"px;}"); // code.append(".wh200{width: "+(200+wpx)+"px;}"); // code.append(".wh250{width: "+(250+wpx)+"px;}"); code.append("div.w50em{width: " + ((50 * width) / defaultWidth) + "em;}"); code.append("div.w60em{width: " + ((60 * width) / defaultWidth) + "em;}"); code.append("div.w75em{width: " + ((75 * width) / defaultWidth) + "em;}"); code.append("div.w80em{width: " + ((80 * width) / defaultWidth) + "em;}"); code.append("div.w85em{width: " + ((85 * width) / defaultWidth) + "em;}"); code.append("div.wd800{width: " + ((800 * width) / defaultWidth) + "px;}"); code.append("div.wd750{width: " + ((750 * width) / defaultWidth) + "px;}"); code.append("div.wd700{width: " + ((700 * width) / defaultWidth) + "px;}"); code.append("div.wd650{width: " + ((650 * width) / defaultWidth) + "px;}"); code.append(".wh80{width: " + ((80 * width) / defaultWidth) + "px;}"); code.append(".wh110{width: " + ((110 * width) / defaultWidth) + "px;}"); code.append(".wh120{width: " + ((120 * width) / defaultWidth) + "px;}"); code.append(".wh150{width: " + ((150 * width) / defaultWidth) + "px;}"); code.append(".wh190{width: " + ((190 * width) / defaultWidth) + "px;}"); code.append(".wh200{width: " + ((200 * width) / defaultWidth) + "px;}"); code.append(".wh250{width: " + ((250 * width) / defaultWidth) + "px;}"); code.append("table.wt500{width: " + ((500 * width) / defaultWidth) + "px;}"); code.append("table.wt750{width: " + ((750 * width) / defaultWidth) + "px;}"); code.append("span.w80{width: " + (80 * width) / defaultWidth + "px;}"); code.append("span.w100{width: " + (100 * width) / defaultWidth + "px;}"); code.append("span.w200{width: " + (200 * width) / defaultWidth + "px;}"); code.append("span.w250{width: " + (250 * width) / defaultWidth + "px;}"); code.append("span.w300{width: " + (300 * width) / defaultWidth + "px;}"); code.append("span.w350{width: " + (350 * width) / defaultWidth + "px;}"); code.append("span.w400{width: " + (400 * width) / defaultWidth + "px;}"); return code.toString(); }