@Override public String call() { return RandomUtil.createRandomId(size); } };
@Override public String call() { return RandomUtil.createRandomId(size); } };
@Override public String generateNewCode() { return RandomUtil.createRandomId(25); }
@Override public String generateNewCode() { return RandomUtil.createRandomId(25); }
public static String createRandomId() { return createRandomId(RANDOM_CODE_LENGTH); }
public static String createRandomId() { return createRandomId(RANDOM_CODE_LENGTH); }
protected List<Object[]> loadChartData() { try { chartId = RandomUtil.createRandomId(); String query = chartConfiguration.getQuery(); Session session = persistence.getSession(chartConfiguration.getDatabase()); return QueryUtils.runSql(session, query); } catch(Exception e) { logger.error("Error executing query", e); return null; } }
public String enqueue(Email email) throws QueueException { try { Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); String emailId = RandomUtil.createRandomId(20); File destinationFile = getEmailFile(emailId); checkDirectory(queuedDirectory); if(!email.getAttachments().isEmpty()) { File attachDir = getEmailAttachmentsDirectory(emailId); checkDirectory(attachDir); for(Attachment attachment : email.getAttachments()) { String attachmentId = RandomUtil.createRandomId(20); File attachmentFile = new File(attachDir, attachmentId + ".bin"); FileOutputStream fos = new FileOutputStream(attachmentFile); IOUtils.copy(attachment.getInputStream(), fos); IOUtils.closeQuietly(fos); IOUtils.closeQuietly(attachment.getInputStream()); attachment.setFilePath(attachmentFile.getAbsolutePath()); } } marshaller.marshal(email, destinationFile); return emailId; } catch (Exception e) { throw new QueueException("Couldn't enqueue mail", e); } }
page.setId(RandomUtil.createRandomId()); String calendarTitle = "Calendar (" + connectionProvider.getDatabase().getDatabaseName() + ")"; if(retries > 1) {
protected void commonUploadAttachment() throws IOException { logger.debug("Uploading attachment"); viewAttachmentUrl = null; InputStream attachmentStream = upload.getInputStream(); String attachmentId = RandomUtil.createRandomId(); File dataFile = RandomUtil.getCodeFile( pageInstance.getDirectory(), ATTACHMENT_FILE_NAME_PATTERN, attachmentId); // copy the data FileOutputStream fileOutputStream = new FileOutputStream(dataFile); IOUtils.copyLarge(attachmentStream, fileOutputStream); if(textConfiguration == null) { textConfiguration = new TextConfiguration(); } Attachment attachment = TextLogic.createAttachment( textConfiguration, attachmentId, upload.getFileName(), upload.getContentType(), upload.getSize()); attachment.setDownloadable(uploadDownloadable); viewAttachmentUrl = generateViewAttachmentUrl(attachmentId); saveConfiguration(textConfiguration); logger.info("Attachment uploaded: " + upload.getFileName() + " (" + attachmentId + ")"); IOUtils.closeQuietly(attachmentStream); IOUtils.closeQuietly(fileOutputStream); upload.delete(); logger.debug("Upload resources cleaned"); }
@DefaultHandler public Resolution execute() { if(chartConfiguration == null) { return forwardToPageActionNotConfigured(); } try { // Run/generate the chart try { Thread.currentThread().setContextClassLoader(Class.class.getClassLoader()); generateChart(); } finally { Thread.currentThread().setContextClassLoader(JFreeChartAction.class.getClassLoader()); } chartId = RandomUtil.createRandomId(); String actionurl = context.getActionPath(); UrlBuilder chartResolution = new UrlBuilder(context.getLocale(), actionurl, false) .addParameter("chartId", chartId) .addParameter("chart", ""); String url = context.getRequest().getContextPath() + chartResolution.toString(); file = RandomUtil.getTempCodeFile(CHART_FILENAME_FORMAT, chartId); jfreeChartInstance = new JFreeChartInstance(chart, file, chartId, "Chart: " + chartConfiguration.getName(), width, height, url); } catch (Exception e) { logger.error("Chart exception", e); return forwardToPageActionError(e); } return new ForwardResolution("/m/chart/jfreechart/display.jsp"); }
page.setId(RandomUtil.createRandomId()); page.setTitle(title); page.setDescription(title);
boolean supportsDetail = info.supportsDetail; String className = RandomUtil.createRandomId(); if(Character.isDigit(className.charAt(0))) { className = "_" + className;
public void toXhtml(@NotNull XhtmlBuffer xb) { xb.openElement("tr"); if (selectable) { String[] inputNameArgs = {prefix, "selection"}; String id = RandomUtil.createRandomId(10)+index; String selection = StringUtils.join(inputNameArgs); xb.openElement("td"); xb.openElement("div"); xb.addAttribute("class", SELECTION_CELL_CLASS+" squared-light "); xb.writeInputCheckbox(id, selection, key, false, false, null, String.valueOf(index)); xb.openElement("label"); xb.addAttribute("for", id); xb.closeElement("label"); xb.closeElement("div"); xb.closeElement("td"); } for (Field current : this) { xb.openElement("td"); if (!current.getErrors().isEmpty()) { xb.addAttribute("class", "has-error"); } current.valueToXhtml(xb); current.errorsToXhtml(xb); xb.closeElement("td"); } xb.closeElement("tr"); }
public void toXhtml(@NotNull XhtmlBuffer xb) { xb.openElement("tr"); if (selectable) { String[] inputNameArgs = {prefix, "selection"}; String id = RandomUtil.createRandomId(10)+index; String selection = StringUtils.join(inputNameArgs); xb.openElement("td"); xb.openElement("div"); xb.addAttribute("class", SELECTION_CELL_CLASS+" squared-light "); xb.writeInputCheckbox(id, selection, key, false, false, null, String.valueOf(index)); xb.openElement("label"); xb.addAttribute("for", id); xb.closeElement("label"); xb.closeElement("div"); xb.closeElement("td"); } for (Field current : this) { xb.openElement("td"); if (!current.getErrors().isEmpty()) { xb.addAttribute("class", "has-error"); } current.valueToXhtml(xb); current.errorsToXhtml(xb); xb.closeElement("td"); } xb.closeElement("tr"); }
logger.debug("Generating a new Id for the new page"); Page newPage = DispatcherLogic.getPage(newDirectory); String pageId = RandomUtil.createRandomId(); newPage.setId(pageId); DispatcherLogic.savePage(newDirectory, newPage);
boolean supportsDetail = info.supportsDetail; String pageId = RandomUtil.createRandomId(); String className = pageId; if(Character.isDigit(className.charAt(0))) {
xb.addAttribute("title", "select-all"); String id = RandomUtil.createRandomId(10) ; xb.addAttribute("id", id ); String js =
xb.addAttribute("title", "select-all"); String id = RandomUtil.createRandomId(10) ; xb.addAttribute("id", id ); String js =