/** * Access to a localized bundle property, which can be customized. * * @param key bundle property key * @return bundle property value */ public final String getString(String key) { return this.internationalizationService.getString(key, this.locale, this.classLoader, this.applicationContext); }
/** * Get bundle factory. * * @param internationalizationService internationalization service * @return bundle factory */ @Bean public IBundleFactory getBundleFactory(IInternationalizationService internationalizationService) { return internationalizationService.getBundleFactory(this.getClass().getClassLoader(), this.applicationContext); }
/** * 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); }
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());
/** * {@inheritDoc} */ @Override protected void doTag(NuxeoController nuxeoController, DocumentDTO document) throws JspException, IOException { if (document.isCommentable()) { // Internationalization bundle Bundle bundle = this.bundleFactory.getBundle(nuxeoController.getRequest().getLocale()); // Container Element container = this.generateContainer(nuxeoController, document, bundle); // Delete confirmation fancybox Element fancybox = this.generateDeleteConfirmationFancybox(nuxeoController, document, bundle); // HTML writer HTMLWriter htmlWriter = new HTMLWriter(this.getJspContext().getOut()); htmlWriter.setEscapeText(false); htmlWriter.write(container); htmlWriter.write(fancybox); } }
/** * 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 * @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); }
/** * Constructor. * * @param portletContext portlet context */ public PortletModule(PortletContext portletContext) { super(portletContext); // Bundle factory IInternationalizationService internationalizationService = Locator.findMBean(IInternationalizationService.class, IInternationalizationService.MBEAN_NAME); this.bundleFactory = internationalizationService.getBundleFactory(this.getClass().getClassLoader()); }
/** * 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); } } } }
/** * Access to a localized bundle property, which can be customized. * * @param key bundle property key * @param args property arguments * @return bundle property value */ public final String getString(String key, Object... args) { return this.internationalizationService.getString(key, this.locale, this.classLoader, this.applicationContext, args); }
/** * {@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); }
/** * Constructor. */ public FileSizeTag() { super(); // Bundle factory IInternationalizationService internationalizationService = Locator.findMBean(IInternationalizationService.class, IInternationalizationService.MBEAN_NAME); this.bundleFactory = internationalizationService.getBundleFactory(this.getClass().getClassLoader()); }
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()");
/** * Access to a localized bundle property, which can be customized. * * @param key bundle property key * @param customizedClassLoader customized class loader * @param args property arguments * @return bundle property value */ public final String getString(String key, ClassLoader customizedClassLoader, Object... args) { return this.internationalizationService.getString(key, this.locale, this.classLoader, customizedClassLoader, this.applicationContext, args); }
/** * Constructor. */ public CommentsTag() { super(); // Internationalization bundle factory IInternationalizationService internationalizationService = Locator.findMBean(IInternationalizationService.class, IInternationalizationService.MBEAN_NAME); this.bundleFactory = internationalizationService.getBundleFactory(this.getClass().getClassLoader()); // Person service this.personService = DirServiceFactory.getService(PersonService.class); }
/** * Access to bundle resource string. * * @param key bundle resource key * @return internationalized string */ public String getString(String key) { return this.internationalizationService.getString(key, this.locale); }
public PortalGenericPortlet() { super(); this.notificationsService = Locator.findMBean(INotificationsService.class, INotificationsService.MBEAN_NAME); IInternationalizationService internationalizationService = Locator.findMBean(IInternationalizationService.class, IInternationalizationService.MBEAN_NAME); this.bundleFactory = internationalizationService.getBundleFactory(this.getClass().getClassLoader()); this.portalUrlFactory = Locator.findMBean(IPortalUrlFactory.class, IPortalUrlFactory.MBEAN_NAME); this.directoryServiceLocator = Locator.findMBean(IDirectoryServiceLocator.class, IDirectoryServiceLocator.MBEAN_NAME); this.menubarService = Locator.findMBean(IMenubarService.class, IMenubarService.MBEAN_NAME); this.traceServiceLocator = Locator.findMBean(ITraceServiceLocator.class, ITraceServiceLocator.MBEAN_NAME); }
/** * Constructor. */ public CMSPortlet() { super(); // Log this.logger = LogFactory.getLog(CMSPortlet.class); // Nuxeo service this.nuxeoService = Locator.findMBean(INuxeoService.class, INuxeoService.MBEAN_NAME); // CMS service locator this.cmsServiceLocator = Locator.findMBean(ICMSServiceLocator.class, ICMSServiceLocator.MBEAN_NAME); // Browser service this.browserService = Locator.findMBean(IBrowserService.class, IBrowserService.MBEAN_NAME); // Portal URL factory this.portalUrlFactory = Locator.findMBean(IPortalUrlFactory.class, IPortalUrlFactory.MBEAN_NAME); // Internationalization bundle factory IInternationalizationService internationalizationService = Locator.findMBean(IInternationalizationService.class, IInternationalizationService.MBEAN_NAME); this.bundleFactory = internationalizationService.getBundleFactory(this.getClass().getClassLoader()); }