/** * {@inheritDoc} */ @Override public Link getMyCardUrl(PortalControllerContext portalControllerContext) throws PortalException { Bundle bundle = this.bundleFactory.getBundle(portalControllerContext.getHttpServletRequest().getLocale()); Map<String, String> properties = new HashMap<String, String>(); properties.put(InternalConstants.PROP_WINDOW_TITLE, bundle.getString(InternationalizationConstants.KEY_MY_PROFILE)); properties.put("osivia.hideTitle", "1"); properties.put("osivia.ajaxLink", "1"); properties.put(DynaRenderOptions.PARTIAL_REFRESH_ENABLED, String.valueOf(true)); Map<String, String> parameters = new HashMap<String, String>(); String url = this.urlFactory.getStartPortletInNewPage(portalControllerContext, "myprofile", bundle.getString(InternationalizationConstants.KEY_MY_PROFILE), this.getCardInstance(), properties, parameters); return new Link(url, false); }
/** * Generate comment informations DOM4J element. * * @param nuxeoController Nuxeo controller * @param bundle internationalization bundle * @param comment comment DTO * @return DOM4J element * @throws JspException */ private Element generateInformations(NuxeoController nuxeoController, Bundle bundle, CommentDTO comment) throws JspException { // Informations Element container = DOM4JUtils.generateDivElement("pull-left"); // paragraph Element paragraph = DOM4JUtils.generateElement(HTMLConstants.P, "small", null); container.add(paragraph); // Author Element author = this.generateAuthor(nuxeoController, comment.getAuthor()); paragraph.add(author); // Separator Element separator = DOM4JUtils.generateElement(HTMLConstants.SPAN, null, "–"); paragraph.add(separator); // Date Element date = this.generateDate(bundle.getLocale(), comment.getCreationDate()); paragraph.add(date); return container; }
/** * Return a label in resources files * @param pcc * @param label the key in resources bundle * @return the label translated */ protected String getMessage(PortalControllerContext pcc, String label) { Bundle bundle = this.getBundleFactory().getBundle(pcc.getRequest().getLocale()); return bundle.getString(label); }
/** * Return a label in resources files * @param pcc * @param label the key in resources bundle * @param args some args * @return the label translated */ protected String getMessage(PortalControllerContext pcc, String label, Object... args) { Bundle bundle = this.getBundleFactory().getBundle(pcc.getRequest().getLocale()); return bundle.getString(label, args); }
replyUrlBuilder.append("-reply-comment-"); replyUrlBuilder.append(comment.getId()); Element reply = DOM4JUtils.generateLinkElement(replyUrlBuilder.toString(), null, null, "btn btn-default no-ajax-link", bundle.getString("REPLY"), "glyphicons glyphicons-chat"); DOM4JUtils.addDataAttribute(reply, "toggle", "collapse"); deleteUrlBuilder.append("-delete-comment"); Element delete = DOM4JUtils.generateLinkElement("javascript:;", null, null, "btn btn-default", bundle.getString("DELETE"), "halflings halflings-trash"); DOM4JUtils.addDataAttribute(delete, "fancybox", StringUtils.EMPTY); DOM4JUtils.addDataAttribute(delete, "src", deleteUrlBuilder.toString());
title = bundle.getString("EDITOR_LINK_TITLE"); } else { title = null;
/** * call the execute method on each of the direct children of the currentPath * * @param filterContext */ public void executeChildren(FormFilterContext filterContext) throws FormFilterException, PortalException { List<FormFilterInstance> filters = filtersByParentPathMap.get(currentPath); if (filters != null) { Collections.sort(filters); for (FormFilterInstance formFilterI : filters) { FormFilter formFilter = formFilterI.getFormFilter(); if(formFilter!=null){ try { formFilter.execute(filterContext, new FormFilterExecutor(filtersByParentPathMap, formFilterI.getPath(), formFilterI.getId(), bundle)); } catch (FormFilterException | PortalException e) { throw e; } catch (Exception e) { throw new PortalException(formFilterI.getName(), e); } }else{ String msg = bundle.getString("FORMS_FILTER_NOT_FOUND", formFilterI.getName()); throw new PortalException(msg); } } } }
Element label = DOM4JUtils.generateElement(HTMLConstants.LABEL, null, bundle.getString("COMMENT_CONTENT")); DOM4JUtils.addAttribute(label, HTMLConstants.FOR, labelTarget); group1.add(label); Element submitButton = DOM4JUtils.generateElement(HTMLConstants.BUTTON, "btn btn-primary", bundle.getString("SAVE")); DOM4JUtils.addAttribute(submitButton, HTMLConstants.TYPE, HTMLConstants.INPUT_TYPE_SUBMIT); group2.add(submitButton); Element cancelButton = DOM4JUtils.generateElement(HTMLConstants.BUTTON, "btn btn-default", bundle.getString("CANCEL")); DOM4JUtils.addAttribute(cancelButton, HTMLConstants.TYPE, HTMLConstants.INPUT_TYPE_BUTTON); DOM4JUtils.addAttribute(cancelButton, HTMLConstants.ONCLICK, "$JQry(this).closest('.collapse').collapse('hide')");
Element message = DOM4JUtils.generateElement(HTMLConstants.P, "text-center", bundle.getString("COMMENT_SUPPRESSION_CONFIRM_MESSAGE")); formGroup.add(message); Element submit = DOM4JUtils.generateElement(HTMLConstants.BUTTON, "btn btn-warning", bundle.getString("YES"), "halflings halflings-alert", null); DOM4JUtils.addAttribute(submit, HTMLConstants.TYPE, HTMLConstants.INPUT_TYPE_SUBMIT); buttonsContainer.add(submit); Element cancel = DOM4JUtils.generateElement(HTMLConstants.BUTTON, "btn btn-default", bundle.getString("NO")); DOM4JUtils.addAttribute(cancel, HTMLConstants.TYPE, HTMLConstants.INPUT_TYPE_BUTTON); DOM4JUtils.addAttribute(cancel, HTMLConstants.ONCLICK, "closeFancybox()");
Element panelTitle = DOM4JUtils.generateElement(HTMLConstants.H3, "panel-title", bundle.getString("COMMENTS"), "glyphicons glyphicons-conversation", null); panelHeading.add(panelTitle); bundle.getString("COMMENT_ADD"), "glyphicons glyphicons-chat"); DOM4JUtils.addDataAttribute(addToggle, "toggle", "collapse"); panelBody.add(addToggle); Element addContentLabel = DOM4JUtils.generateElement(HTMLConstants.LABEL, "control-label", bundle.getString("COMMENT_CONTENT")); DOM4JUtils.addAttribute(addContentLabel, HTMLConstants.FOR, namespace + "-comment-content"); addContentFormGroup.add(addContentLabel); Element addSubmit = DOM4JUtils.generateElement(HTMLConstants.BUTTON, "btn btn-primary", bundle.getString("SAVE")); DOM4JUtils.addAttribute(addSubmit, HTMLConstants.TYPE, HTMLConstants.INPUT_TYPE_SUBMIT); addButtonsFormGroup.add(addSubmit); Element addCancel = DOM4JUtils.generateElement(HTMLConstants.BUTTON, "btn btn-default", bundle.getString("CANCEL")); DOM4JUtils.addAttribute(addCancel, HTMLConstants.TYPE, HTMLConstants.INPUT_TYPE_BUTTON); DOM4JUtils.addAttribute(addCancel, HTMLConstants.ONCLICK, "$JQry('#" + namespace + "-add-comment').collapse('hide')");