public SystemPlatypusPrincipal() { super("system-" + IdGenerator.genId(), null, null, null); }
public Form() throws Exception { this("form-" + IdGenerator.genId()); }
public AnonymousPlatypusPrincipal() { this("anonymous-" + IdGenerator.genId()); }
public Form(JComponent aView) throws Exception { this(aView, "form-" + IdGenerator.genId()); }
public void regenerateId() { entityId = IdGenerator.genId(); }
protected static String generateReportPath(String aFileName, String aFormat) { String reportPath = System.getProperty(ClientConstants.USER_HOME_PROP_NAME); if (!reportPath.endsWith(File.separator)) { reportPath += File.separator; } reportPath += ClientConstants.USER_HOME_PLATYPUS_DIRECTORY_NAME; File newDir = new File(reportPath); if (!newDir.exists()) { newDir.mkdir(); } reportPath += File.separator + "reports"; newDir = new File(reportPath); if (!newDir.exists()) { newDir.mkdir(); } String suffix = "." + (aFormat != null ? aFormat : PlatypusFiles.REPORT_LAYOUT_EXTENSION_X); String reportName = aFileName; if (reportName.toLowerCase().endsWith(suffix.toLowerCase())) { reportName = reportName.substring(0, reportName.length() - suffix.length()); } reportName += "-" + IdGenerator.genId() + suffix; reportPath += File.separator + reportName; return reportPath; }
public Object generateValue() { Object value; if (type != null) { switch (type) { case Scripts.NUMBER_TYPE_NAME: value = IdGenerator.genId(); break; case Scripts.STRING_TYPE_NAME: value = IdGenerator.genStringId(); break; case Scripts.DATE_TYPE_NAME: value = new Date(); break; case Scripts.BOOLEAN_TYPE_NAME: value = false; break; default: value = null; break; } } else { value = null; } return value; }
protected void writeReportResponse(Report report) throws URISyntaxException, IOException { String docsRoot = servletRequest.getServletContext().getRealPath("/"); String userHomeInApplication = "/reports/" + userName + "/"; File userDir = new File(docsRoot + userHomeInApplication); if (!userDir.exists()) { userDir.mkdirs(); } String suffix = "." + report.getFormat(); String reportName = report.getName(); if (reportName.toLowerCase().endsWith(suffix.toLowerCase())) { reportName = reportName.substring(0, reportName.length() - suffix.length()); } reportName += "-" + IdGenerator.genId() + suffix; File rep = new File(docsRoot + userHomeInApplication + reportName); try (FileOutputStream out = new FileOutputStream(rep)) { out.write(report.getBody()); out.flush(); } String reportLocation = userHomeInApplication + reportName; if (!"/".equals(servletRequest.getContextPath())) { reportLocation = servletRequest.getContextPath() + reportLocation; } reportLocation = new URI(null, null, reportLocation, null).toASCIIString(); writeResponse(reportLocation, servletResponse, PlatypusHttpResponseReader.REPORT_LOCATION_CONTENT_TYPE, async); }
uploadedFileName.append(IdGenerator.genId()).append("-").append(fileName); try { try {
try { Session created = SessionManager.Singleton.instance.create(platypusSessionId == null ? IdGenerator.genId() + "" : platypusSessionId); if (dataContext == null) { httpSession.removeAttribute(PLATYPUS_USER_CONTEXT_ATTR_NAME);
try { com.eas.server.Session created = SessionManager.Singleton.instance.create(platypusSessionId == null ? IdGenerator.genId() + "" : platypusSessionId); if (dataContext == null) { websocketSession.getUserProperties().remove(PlatypusHttpServlet.PLATYPUS_USER_CONTEXT_ATTR_NAME);
public String getAppElementId() throws IOException { Integer appElementType = getAppElementType(); if (appElementType != null) { switch (appElementType) { case ClientConstants.ET_COMPONENT: case ClientConstants.ET_FORM: case ClientConstants.ET_REPORT: { return null; } case ClientConstants.ET_QUERY: { File sqlFile = findFileByExtension(PlatypusFiles.SQL_EXTENSION); String fileContent = FileUtils.readString(sqlFile, PlatypusFiles.DEFAULT_ENCODING); return PlatypusFilesSupport.getAnnotationValue(fileContent, JsDoc.Tag.NAME_TAG); } case ClientConstants.ET_DB_SCHEME: return IdGenerator.genId() + ""; default: return null; } } else { return null; } }