List of usage examples for com.liferay.portal.kernel.util StringPool DASH
String DASH
To view the source code for com.liferay.portal.kernel.util StringPool DASH.
Click Source Link
From source file:com.slemarchand.quicksignup.portlet.QuickSignUpPortlet.java
License:Open Source License
protected User addUser(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); Company company = themeDisplay.getCompany(); String authType = company.getAuthType(); boolean autoPassword = false; String password1 = null;/* www . j a v a2 s.c o m*/ String password2 = null; boolean autoScreenName = !authType.equals(CompanyConstants.AUTH_TYPE_SN); String screenName = ParamUtil.getString(actionRequest, "screenName"); String emailAddress = ParamUtil.getString(actionRequest, "emailAddress"); long facebookId = 0; String openId = StringPool.BLANK; String firstName = ParamUtil.getString(actionRequest, "firstName"); String middleName = StringPool.BLANK; String lastName = ParamUtil.getString(actionRequest, "lastName"); int prefixId = 0; int suffixId = 0; boolean male = ParamUtil.getBoolean(actionRequest, "male", true); int birthdayMonth = 1; int birthdayDay = 1; int birthdayYear = 1970; String jobTitle = StringPool.BLANK; long[] groupIds = null; long[] organizationIds = null; long[] roleIds = null; long[] userGroupIds = null; boolean sendEmail = true; ServiceContext serviceContext = ServiceContextFactory.getInstance(User.class.getName(), actionRequest); password1 = ParamUtil.getString(actionRequest, "password"); password2 = password1; User user = UserServiceUtil.addUser(company.getCompanyId(), autoPassword, password1, password2, autoScreenName, screenName, emailAddress, facebookId, openId, themeDisplay.getLocale(), firstName, middleName, lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds, roleIds, userGroupIds, sendEmail, serviceContext); long userId = user.getUserId(); user = UserLocalServiceUtil.updatePasswordReset(userId, false); PasswordPolicy passwordPolicy = PasswordPolicyLocalServiceUtil.getPasswordPolicyByUserId(userId); passwordPolicy.setChangeRequired(false); PasswordPolicyLocalServiceUtil.updatePasswordPolicy(passwordPolicy); if (_USERS_REMINDER_QUERIES_ENABLED) { user = UserLocalServiceUtil.updateReminderQuery(userId, StringPool.DASH, UUID.randomUUID().toString()); } user = UserLocalServiceUtil.updateAgreedToTermsOfUse(userId, true); return user; }
From source file:jorgediazest.indexchecker.model.IndexCheckerModelQuery.java
License:Open Source License
@SuppressWarnings("unchecked") protected void addRolesFieldsToData(Map<Long, Data> roleMap, String className, Data data, String permissionsField) throws PortalException { Object aux = data.get(permissionsField); Set<List<Object>> resourcePermissions = null; if (aux instanceof List) { resourcePermissions = new HashSet<List<Object>>(); resourcePermissions.add((List<Object>) aux); } else if (aux instanceof Set) { resourcePermissions = (Set<List<Object>>) aux; }//from www .j a v a2s . c o m if (resourcePermissions == null) { return; } Set<String> roleIds = new HashSet<String>(); Set<String> groupRoleIds = new HashSet<String>(); for (List<Object> resourcePermission : resourcePermissions) { long roleId = (Long) resourcePermission.get(0); long actionIds = (Long) resourcePermission.get(1); if (resourcePermission.size() > 2) { int scope = (Integer) resourcePermission.get(2); if (scope != ResourceConstants.SCOPE_INDIVIDUAL) { continue; } } if (hasActionId(actionIds, className, ActionKeys.VIEW)) { Data role = roleMap.get(roleId); if (role == null) { continue; } long groupId = data.get("permissionsGroupId", 0L); int type = role.get("type", -1); if ((type == RoleConstants.TYPE_ORGANIZATION) || (type == RoleConstants.TYPE_SITE)) { groupRoleIds.add(groupId + StringPool.DASH + roleId); } else { roleIds.add(Long.toString(roleId)); } } } data.set("roleId", roleIds); data.set("groupRoleId", groupRoleIds); }
From source file:org.apache.jsp.html.taglib.ui.icon_005fdeactivate.page_jsp.java
License:Open Source License
public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null;//from www. j av a 2 s . c om PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html; charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; /** * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ out.write('\n'); out.write('\n'); /** * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ out.write('\n'); out.write('\n'); /** * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ out.write('\n'); out.write('\n'); /** * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); // liferay-theme:defineObjects com.liferay.taglib.theme.DefineObjectsTag _jspx_th_liferay_002dtheme_005fdefineObjects_005f0 = (com.liferay.taglib.theme.DefineObjectsTag) _005fjspx_005ftagPool_005fliferay_002dtheme_005fdefineObjects_005fnobody .get(com.liferay.taglib.theme.DefineObjectsTag.class); _jspx_th_liferay_002dtheme_005fdefineObjects_005f0.setPageContext(_jspx_page_context); _jspx_th_liferay_002dtheme_005fdefineObjects_005f0.setParent(null); int _jspx_eval_liferay_002dtheme_005fdefineObjects_005f0 = _jspx_th_liferay_002dtheme_005fdefineObjects_005f0 .doStartTag(); if (_jspx_th_liferay_002dtheme_005fdefineObjects_005f0 .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fliferay_002dtheme_005fdefineObjects_005fnobody .reuse(_jspx_th_liferay_002dtheme_005fdefineObjects_005f0); return; } _005fjspx_005ftagPool_005fliferay_002dtheme_005fdefineObjects_005fnobody .reuse(_jspx_th_liferay_002dtheme_005fdefineObjects_005f0); com.liferay.portal.theme.ThemeDisplay themeDisplay = null; com.liferay.portal.model.Company company = null; com.liferay.portal.model.Account account = null; com.liferay.portal.model.User user = null; com.liferay.portal.model.User realUser = null; com.liferay.portal.model.Contact contact = null; com.liferay.portal.model.Layout layout = null; java.util.List layouts = null; java.lang.Long plid = null; com.liferay.portal.model.LayoutTypePortlet layoutTypePortlet = null; java.lang.Long portletGroupId = null; com.liferay.portal.kernel.security.permission.PermissionChecker permissionChecker = null; java.util.Locale locale = null; java.util.TimeZone timeZone = null; com.liferay.portal.model.Theme theme = null; com.liferay.portal.model.ColorScheme colorScheme = null; com.liferay.portal.theme.PortletDisplay portletDisplay = null; themeDisplay = (com.liferay.portal.theme.ThemeDisplay) _jspx_page_context.findAttribute("themeDisplay"); company = (com.liferay.portal.model.Company) _jspx_page_context.findAttribute("company"); account = (com.liferay.portal.model.Account) _jspx_page_context.findAttribute("account"); user = (com.liferay.portal.model.User) _jspx_page_context.findAttribute("user"); realUser = (com.liferay.portal.model.User) _jspx_page_context.findAttribute("realUser"); contact = (com.liferay.portal.model.Contact) _jspx_page_context.findAttribute("contact"); layout = (com.liferay.portal.model.Layout) _jspx_page_context.findAttribute("layout"); layouts = (java.util.List) _jspx_page_context.findAttribute("layouts"); plid = (java.lang.Long) _jspx_page_context.findAttribute("plid"); layoutTypePortlet = (com.liferay.portal.model.LayoutTypePortlet) _jspx_page_context .findAttribute("layoutTypePortlet"); portletGroupId = (java.lang.Long) _jspx_page_context.findAttribute("portletGroupId"); permissionChecker = (com.liferay.portal.kernel.security.permission.PermissionChecker) _jspx_page_context .findAttribute("permissionChecker"); locale = (java.util.Locale) _jspx_page_context.findAttribute("locale"); timeZone = (java.util.TimeZone) _jspx_page_context.findAttribute("timeZone"); theme = (com.liferay.portal.model.Theme) _jspx_page_context.findAttribute("theme"); colorScheme = (com.liferay.portal.model.ColorScheme) _jspx_page_context.findAttribute("colorScheme"); portletDisplay = (com.liferay.portal.theme.PortletDisplay) _jspx_page_context .findAttribute("portletDisplay"); out.write("\r\n"); out.write("\r\n"); /** * Copyright (c) 2000-2006 Liferay, LLC. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); //@ page import="com.liferay.portal.kernel.util.PortletExtKeys" out.write("\r\n"); out.write("\r\n"); String contextPath = PropsUtil.get(PropsUtil.PORTAL_CTX); if (contextPath.equals("/")) { contextPath = ""; } out.write('\r'); out.write('\n'); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write('\n'); out.write('\n'); RenderRequest renderRequest = (RenderRequest) request.getAttribute(JavaConstants.JAVAX_PORTLET_REQUEST); RenderResponse renderResponse = (RenderResponse) request .getAttribute(JavaConstants.JAVAX_PORTLET_RESPONSE); String namespace = StringPool.BLANK; if (renderRequest != null) { namespace = renderResponse.getNamespace(); } String currentURL = PortalUtil.getCurrentURL(request); out.write('\n'); out.write('\n'); /** * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ out.write('\n'); out.write('\n'); String image = (String) request.getAttribute("liferay-ui:icon:image"); String message = (String) request.getAttribute("liferay-ui:icon:message"); if (message == null) { message = StringUtil.replace(image, StringPool.UNDERLINE, StringPool.DASH); } String src = (String) request.getAttribute("liferay-ui:icon:src"); if (Validator.isNull(src)) { src = themeDisplay.getPathThemeImages() + "/common/" + image + ".png"; } String url = (String) request.getAttribute("liferay-ui:icon:url"); String target = (String) request.getAttribute("liferay-ui:icon:target"); boolean toolTip = GetterUtil.getBoolean((String) request.getAttribute("liferay-ui:icon:toolTip")); String details = null; if (toolTip) { details = "onmousemove=\"ToolTip.show(event, this, '" + UnicodeLanguageUtil.get(pageContext, message) + "')\""; } else { details = "title=\"" + LanguageUtil.get(pageContext, message) + "\""; } out.write('\n'); out.write('\n'); String jsUrl = "javascript: if (confirm('" + UnicodeLanguageUtil.get(pageContext, "are-you-sure-you-want-to-deactivate-this") + "')) { self.location= '" + HttpUtil.encodeURL(url) + "'; } else { self.focus(); }"; out.write('\n'); out.write('\n'); // liferay-ui:icon com.liferay.taglib.ui.IconTag _jspx_th_liferay_002dui_005ficon_005f0 = (com.liferay.taglib.ui.IconTag) _005fjspx_005ftagPool_005fliferay_002dui_005ficon_005furl_005fimage_005fnobody .get(com.liferay.taglib.ui.IconTag.class); _jspx_th_liferay_002dui_005ficon_005f0.setPageContext(_jspx_page_context); _jspx_th_liferay_002dui_005ficon_005f0.setParent(null); _jspx_th_liferay_002dui_005ficon_005f0.setImage("deactivate"); _jspx_th_liferay_002dui_005ficon_005f0.setUrl(jsUrl); int _jspx_eval_liferay_002dui_005ficon_005f0 = _jspx_th_liferay_002dui_005ficon_005f0.doStartTag(); if (_jspx_th_liferay_002dui_005ficon_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fliferay_002dui_005ficon_005furl_005fimage_005fnobody .reuse(_jspx_th_liferay_002dui_005ficon_005f0); return; } _005fjspx_005ftagPool_005fliferay_002dui_005ficon_005furl_005fimage_005fnobody .reuse(_jspx_th_liferay_002dui_005ficon_005f0); } catch (Throwable t) { if (!(t instanceof SkipPageException)) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); } }
From source file:org.opencps.dossiermgt.portlet.DossierMgtFrontOfficePortlet.java
License:Open Source License
/** * @param actionRequest/*from w ww. j a v a 2 s. c om*/ * @param actionResponse * @throws IOException */ public void createReport(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException { /* * ThemeDisplay themeDisplay = (ThemeDisplay) * actionRequest.getAttribute(WebKeys.THEME_DISPLAY); */ AccountBean accountBean = AccountUtil.getAccountBean(actionRequest); long dossierFileId = ParamUtil.getLong(actionRequest, DossierFileDisplayTerms.DOSSIER_FILE_ID); String sourceFileName = StringPool.BLANK; InputStream inputStream = null; File file = null; JSONObject responseJSON = JSONFactoryUtil.createJSONObject(); String fileExportDir = StringPool.BLANK; try { validateCreateDynamicForm(dossierFileId, accountBean); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); serviceContext.setAddGroupPermissions(true); serviceContext.setAddGuestPermissions(true); // Get dossier file DossierFile dossierFile = DossierFileLocalServiceUtil.getDossierFile(dossierFileId); // Get dossier part DossierPart dossierPart = DossierPartLocalServiceUtil.getDossierPart(dossierFile.getDossierPartId()); Dossier dossier = DossierLocalServiceUtil.getDossier(dossierFile.getDossierId()); // Get account folder // DLFolder accountForlder = accountBean.getAccountFolder(); // Get dossier folder /* * DLFolder dosserFolder = DLFolderUtil.addFolder( * themeDisplay.getUserId(), themeDisplay.getScopeGroupId(), * themeDisplay.getScopeGroupId(), false, * accountForlder.getFolderId(), * String.valueOf(dossier.getCounter()), StringPool.BLANK, false, * serviceContext); */ String formData = dossierFile.getFormData(); String jrxmlTemplate = dossierPart.getFormReport(); // Validate json string JSONFactoryUtil.createJSONObject(formData); String outputDestination = PortletPropsValues.OPENCPS_FILE_SYSTEM_TEMP_DIR; String fileName = System.currentTimeMillis() + StringPool.DASH + dossierFileId + StringPool.DASH + dossierPart.getDossierpartId() + ".pdf"; fileExportDir = exportToPDFFile(jrxmlTemplate, formData, null, outputDestination, fileName); if (Validator.isNotNull(fileExportDir)) { file = new File(fileExportDir); inputStream = new FileInputStream(file); if (inputStream != null) { sourceFileName = fileExportDir.substring(fileExportDir.lastIndexOf(StringPool.SLASH) + 1, fileExportDir.length()); String mimeType = MimeTypesUtil.getContentType(file); // Add new version if (dossierFile.getFileEntryId() > 0) { DossierFileLocalServiceUtil.addDossierFile(dossierFile.getDossierFileId(), dossier.getFolderId(), sourceFileName, mimeType, dossierFile.getDisplayName(), StringPool.BLANK, StringPool.BLANK, inputStream, file.length(), serviceContext); } else { // Update version 1 DossierFileLocalServiceUtil.updateDossierFile(dossierFileId, dossier.getFolderId(), sourceFileName, mimeType, dossierFile.getDisplayName(), StringPool.BLANK, StringPool.BLANK, inputStream, file.length(), serviceContext); } } } } catch (Exception e) { if (e instanceof NoSuchDossierFileException) { SessionErrors.add(actionRequest, NoSuchDossierFileException.class); } else if (e instanceof NoSuchAccountException) { SessionErrors.add(actionRequest, NoSuchAccountException.class); } else if (e instanceof NoSuchAccountTypeException) { SessionErrors.add(actionRequest, NoSuchAccountTypeException.class); } else if (e instanceof NoSuchAccountFolderException) { SessionErrors.add(actionRequest, NoSuchAccountFolderException.class); } else if (e instanceof NoSuchAccountOwnUserIdException) { SessionErrors.add(actionRequest, NoSuchAccountOwnUserIdException.class); } else if (e instanceof NoSuchAccountOwnOrgIdException) { SessionErrors.add(actionRequest, NoSuchAccountOwnOrgIdException.class); } else if (e instanceof PermissionDossierException) { SessionErrors.add(actionRequest, PermissionDossierException.class); } else if (e instanceof DuplicateFileException) { SessionErrors.add(actionRequest, DuplicateFileException.class); } else { SessionErrors.add(actionRequest, PortalException.class); } _log.error(e); } finally { responseJSON.put("fileExportDir", fileExportDir); PortletUtil.writeJSON(actionRequest, actionResponse, responseJSON); if (inputStream != null) { inputStream.close(); } if (file.exists()) { file.delete(); } } }
From source file:org.opencps.dossiermgt.portlet.DossierMgtFrontOfficePortlet.java
License:Open Source License
/** * @param actionRequest//from w w w . j a v a 2s .c o m * @param actionResponse * @throws IOException */ public void updateTempDynamicFormData(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException { long dossierPartId = ParamUtil.getLong(actionRequest, DossierFileDisplayTerms.DOSSIER_PART_ID); int index = ParamUtil.getInteger(actionRequest, DossierFileDisplayTerms.INDEX); String formData = ParamUtil.getString(actionRequest, DossierFileDisplayTerms.FORM_DATA); HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest); request.setAttribute( WebKeys.FORM_DATA + String.valueOf(dossierPartId) + StringPool.DASH + String.valueOf(index), formData); HttpSession session = request.getSession(); session.setAttribute( WebKeys.FORM_DATA + String.valueOf(dossierPartId) + StringPool.DASH + String.valueOf(index), formData); actionResponse.setRenderParameter("mvcPath", "/html/portlets/dossiermgt/frontoffice/dynamic_form.jsp"); }
From source file:org.opencps.dossiermgt.service.impl.DossierFileLocalServiceImpl.java
License:Open Source License
/** * @param oldDossierFileId//from ww w .ja va 2s .co m * @param folderId * @param sourceFileName * @param mimeType * @param title * @param description * @param changeLog * @param is * @param size * @param serviceContext * @return * @throws SystemException * @throws PortalException */ public DossierFile addDossierFile(long oldDossierFileId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, InputStream is, long size, ServiceContext serviceContext) throws SystemException, PortalException { DossierFile oldDossierFile = dossierFilePersistence.findByPrimaryKey(oldDossierFileId); long dossierFileId = counterLocalService.increment(DossierFile.class.getName()); DossierFile dossierFile = dossierFilePersistence.create(dossierFileId); Date now = new Date(); dossierFile.setUserId(oldDossierFile.getUserId()); dossierFile.setGroupId(serviceContext.getScopeGroupId()); dossierFile.setCompanyId(serviceContext.getCompanyId()); dossierFile.setCreateDate(now); dossierFile.setModifiedDate(now); dossierFile.setDisplayName(oldDossierFile.getDisplayName()); dossierFile.setDossierFileDate(oldDossierFile.getDossierFileDate()); dossierFile.setDossierFileMark(oldDossierFile.getDossierFileMark()); dossierFile.setDossierFileNo(oldDossierFile.getDossierFileNo()); dossierFile.setDossierFileType(oldDossierFile.getDossierFileType()); dossierFile.setDossierId(oldDossierFile.getDossierId()); dossierFile.setDossierPartId(oldDossierFile.getDossierPartId()); dossierFile.setFormData(oldDossierFile.getFormData()); dossierFile.setGroupFileId(oldDossierFile.getGroupFileId()); dossierFile.setOriginal(oldDossierFile.getOriginal()); dossierFile.setOwnerUserId(oldDossierFile.getOwnerUserId()); dossierFile.setOwnerOrganizationId(oldDossierFile.getOwnerOrganizationId()); dossierFile.setTemplateFileNo(oldDossierFile.getTemplateFileNo()); dossierFile.setVersion(oldDossierFile.getVersion() + 1); dossierFile.setOid(oldDossierFile.getOid()); // Add file FileEntry fileEntry = dlAppService.addFileEntry(serviceContext.getScopeGroupId(), folderId, sourceFileName, mimeType, oldDossierFile.getDisplayName() + StringPool.DASH + dossierFileId + StringPool.DASH + (oldDossierFile.getVersion() + 1 + StringPool.DASH + System.currentTimeMillis()), description, changeLog, is, size, serviceContext); dossierFile.setFileEntryId(fileEntry.getFileEntryId()); dossierFileLocalService.removeDossierFile(oldDossierFile.getDossierFileId()); dossierFile = dossierFilePersistence.update(dossierFile); Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(DossierFile.class); indexer.reindex(dossierFile); return dossierFile; }
From source file:org.opencps.dossiermgt.service.impl.DossierFileLocalServiceImpl.java
License:Open Source License
/** * @param oldDossierFileId//from w w w . j a v a 2 s.c o m * @param folderId * @param sourceFileName * @param mimeType * @param title * @param description * @param changeLog * @param bytes * @param serviceContext * @return * @throws SystemException * @throws PortalException */ public DossierFile addDossierFile(long oldDossierFileId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, byte[] bytes, ServiceContext serviceContext) throws SystemException, PortalException { DossierFile oldDossierFile = dossierFilePersistence.findByPrimaryKey(oldDossierFileId); long dossierFileId = counterLocalService.increment(DossierFile.class.getName()); DossierFile dossierFile = dossierFilePersistence.create(dossierFileId); Date now = new Date(); dossierFile.setUserId(oldDossierFile.getUserId()); dossierFile.setGroupId(serviceContext.getScopeGroupId()); dossierFile.setCompanyId(serviceContext.getCompanyId()); dossierFile.setCreateDate(now); dossierFile.setModifiedDate(now); dossierFile.setDisplayName(oldDossierFile.getDisplayName()); dossierFile.setDossierFileDate(oldDossierFile.getDossierFileDate()); dossierFile.setDossierFileMark(oldDossierFile.getDossierFileMark()); dossierFile.setDossierFileNo(oldDossierFile.getDossierFileNo()); dossierFile.setDossierFileType(oldDossierFile.getDossierFileType()); dossierFile.setDossierId(oldDossierFile.getDossierId()); dossierFile.setDossierPartId(oldDossierFile.getDossierPartId()); dossierFile.setFormData(oldDossierFile.getFormData()); dossierFile.setGroupFileId(oldDossierFile.getGroupFileId()); dossierFile.setOriginal(oldDossierFile.getOriginal()); dossierFile.setOwnerUserId(oldDossierFile.getOwnerUserId()); dossierFile.setOwnerOrganizationId(oldDossierFile.getOwnerOrganizationId()); dossierFile.setTemplateFileNo(oldDossierFile.getTemplateFileNo()); dossierFile.setVersion(oldDossierFile.getVersion() + 1); dossierFile.setOid(oldDossierFile.getOid()); // Add file FileEntry fileEntry = dlAppService.addFileEntry(serviceContext.getScopeGroupId(), folderId, sourceFileName, mimeType, oldDossierFile.getDisplayName() + StringPool.DASH + dossierFileId + StringPool.DASH + (oldDossierFile.getVersion() + 1 + StringPool.DASH + System.currentTimeMillis()), description, changeLog, bytes, serviceContext); dossierFile.setFileEntryId(fileEntry.getFileEntryId()); dossierFileLocalService.removeDossierFile(oldDossierFile.getDossierFileId()); dossierFile = dossierFilePersistence.update(dossierFile); Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(DossierFile.class); indexer.reindex(dossierFile); return dossierFile; }
From source file:org.opencps.dossiermgt.service.impl.DossierFileLocalServiceImpl.java
License:Open Source License
/** * @param userId/* ww w . ja v a 2s .co m*/ * @param dossierId * @param dossierPartId * @param templateFileNo * @param groupName * @param fileGroupId * @param ownerUserId * @param ownerOrganizationId * @param displayName * @param formData * @param fileEntryId * @param dossierFileMark * @param dossierFileType * @param dossierFileNo * @param dossierFileDate * @param original * @param syncStatus * @param version * @param folderId * @param sourceFileName * @param mimeType * @param title * @param description * @param changeLog * @param is * @param size * @param serviceContext * @return * @throws SystemException * @throws PortalException */ public DossierFile addDossierFile(long userId, long dossierId, long dossierPartId, String templateFileNo, String groupName, long fileGroupId, long groupDossierPartId, long ownerUserId, long ownerOrganizationId, String displayName, String formData, long fileEntryId, int dossierFileMark, int dossierFileType, String dossierFileNo, Date dossierFileDate, int original, int syncStatus, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, InputStream is, long size, ServiceContext serviceContext) throws SystemException, PortalException { long dossierFileId = counterLocalService.increment(DossierFile.class.getName()); DossierFile dossierFile = dossierFilePersistence.create(dossierFileId); Date now = new Date(); int version = 1; // Add new FileGroup if (Validator.isNotNull(groupName) && fileGroupId == 0 && groupDossierPartId > 0) { FileGroup fileGroup = fileGroupLocalService.addFileGroup(ownerUserId, dossierId, groupDossierPartId, groupName, syncStatus, serviceContext); fileGroupId = fileGroup.getFileGroupId(); } dossierFile.setUserId(userId); dossierFile.setGroupId(serviceContext.getScopeGroupId()); dossierFile.setCompanyId(serviceContext.getCompanyId()); dossierFile.setCreateDate(now); dossierFile.setModifiedDate(now); dossierFile.setDisplayName(displayName); dossierFile.setDossierFileDate(dossierFileDate); dossierFile.setDossierFileMark(dossierFileMark); dossierFile.setDossierFileNo(dossierFileNo); dossierFile.setDossierFileType(dossierFileType); dossierFile.setDossierId(dossierId); dossierFile.setDossierPartId(dossierPartId); dossierFile.setSyncStatus(syncStatus); dossierFile.setFormData(formData); dossierFile.setGroupFileId(fileGroupId); dossierFile.setOriginal(original); dossierFile.setOwnerUserId(ownerUserId); dossierFile.setOwnerOrganizationId(ownerOrganizationId); dossierFile.setTemplateFileNo(templateFileNo); if (fileGroupId > 0) { version = DossierFileLocalServiceUtil.countDossierFile(dossierId, dossierPartId, fileGroupId) + 1; } else { version = DossierFileLocalServiceUtil.countDossierFile(dossierId, dossierPartId) + 1; } dossierFile.setVersion(version); // Add file FileEntry fileEntry = dlAppService.addFileEntry(serviceContext.getScopeGroupId(), folderId, sourceFileName, mimeType, displayName + StringPool.DASH + dossierFileId + StringPool.DASH + version + StringPool.DASH + System.currentTimeMillis(), description, changeLog, is, size, serviceContext); dossierFile.setFileEntryId(fileEntry.getFileEntryId()); DossierFile curVersion = null; try { DossierPart dossierPart = dossierPartLocalService.getDossierPart(dossierPartId); if (dossierPart.getPartType() != PortletConstants.DOSSIER_PART_TYPE_OTHER && dossierPart.getPartType() != PortletConstants.DOSSIER_PART_TYPE_MULTIPLE_RESULT) { if (fileGroupId > 0) { curVersion = dossierFileLocalService.getDossierFileInUseByGroupFileId(dossierId, dossierPartId, fileGroupId); } else { curVersion = dossierFileLocalService.getDossierFileInUse(dossierId, dossierPartId); } } } catch (Exception e) { } if (curVersion != null) { dossierFile.setOid(curVersion.getOid()); dossierFileLocalService.removeDossierFile(curVersion.getDossierFileId()); } else { dossierFile.setOid(PortalUUIDUtil.generate()); } dossierFile = dossierFilePersistence.update(dossierFile); Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(DossierFile.class); indexer.reindex(dossierFile); return dossierFile; }
From source file:org.opencps.dossiermgt.service.impl.DossierFileLocalServiceImpl.java
License:Open Source License
/** * @param oldDossierFileId// w ww .j a va2 s. c o m * @param isSigned * @param folderId * @param sourceFileName * @param mimeType * @param title * @param description * @param changeLog * @param is * @param size * @param serviceContext * @return * @throws SystemException * @throws PortalException */ public DossierFile addSignDossierFile(long oldDossierFileId, boolean isSigned, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, InputStream is, long size, ServiceContext serviceContext) throws SystemException, PortalException { DossierFile oldDossierFile = dossierFilePersistence.findByPrimaryKey(oldDossierFileId); long dossierFileId = counterLocalService.increment(DossierFile.class.getName()); DossierFile dossierFile = dossierFilePersistence.create(dossierFileId); Date now = new Date(); dossierFile.setUserId(oldDossierFile.getUserId()); dossierFile.setGroupId(serviceContext.getScopeGroupId()); dossierFile.setCompanyId(serviceContext.getCompanyId()); dossierFile.setCreateDate(now); dossierFile.setModifiedDate(now); dossierFile.setDisplayName(oldDossierFile.getDisplayName()); dossierFile.setDossierFileDate(oldDossierFile.getDossierFileDate()); dossierFile.setDossierFileMark(oldDossierFile.getDossierFileMark()); dossierFile.setDossierFileNo(oldDossierFile.getDossierFileNo()); dossierFile.setDossierFileType(oldDossierFile.getDossierFileType()); dossierFile.setDossierId(oldDossierFile.getDossierId()); dossierFile.setDossierPartId(oldDossierFile.getDossierPartId()); dossierFile.setFormData(oldDossierFile.getFormData()); dossierFile.setGroupFileId(oldDossierFile.getGroupFileId()); dossierFile.setOriginal(oldDossierFile.getOriginal()); dossierFile.setOwnerUserId(oldDossierFile.getOwnerUserId()); dossierFile.setOwnerOrganizationId(oldDossierFile.getOwnerOrganizationId()); dossierFile.setTemplateFileNo(oldDossierFile.getTemplateFileNo()); dossierFile.setVersion(oldDossierFile.getVersion() + 1); dossierFile.setOid(oldDossierFile.getOid()); dossierFile.setSigned(isSigned); // Add file FileEntry fileEntry = dlAppService.addFileEntry(serviceContext.getScopeGroupId(), folderId, sourceFileName, mimeType, oldDossierFile.getDisplayName() + StringPool.DASH + dossierFileId + StringPool.DASH + (oldDossierFile.getVersion() + 1 + StringPool.DASH + System.currentTimeMillis()), description, changeLog, is, size, serviceContext); dossierFile.setFileEntryId(fileEntry.getFileEntryId()); dossierFileLocalService.removeDossierFile(oldDossierFile.getDossierFileId()); dossierFile = dossierFilePersistence.update(dossierFile); Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(DossierFile.class); indexer.reindex(dossierFile); return dossierFile; }
From source file:org.opencps.dossiermgt.service.impl.DossierFileLocalServiceImpl.java
License:Open Source License
/** * @param dossierFileId//from ww w .java 2s. c om * @param folderId * @param sourceFileName * @param mimeType * @param title * @param description * @param changeLog * @param is * @param size * @param serviceContext * @return * @throws SystemException * @throws PortalException */ public DossierFile updateDossierFile(long dossierFileId, long folderId, String sourceFileName, String mimeType, String title, String description, String changeLog, InputStream is, long size, ServiceContext serviceContext) throws SystemException, PortalException { DossierFile dossierFile = dossierFilePersistence.findByPrimaryKey(dossierFileId); Date now = new Date(); dossierFile.setModifiedDate(now); // Add file FileEntry fileEntry = dlAppService.addFileEntry(serviceContext.getScopeGroupId(), folderId, sourceFileName, mimeType, title + StringPool.DASH + dossierFileId + StringPool.DASH + dossierFile.getVersion() + StringPool.DASH + System.currentTimeMillis(), description, changeLog, is, size, serviceContext); dossierFile.setFileEntryId(fileEntry.getFileEntryId()); return dossierFilePersistence.update(dossierFile); }