Beispiel #1
0
 private String getRoleName(Map<String, String> properties) {
   String roleName = properties.get(wfVarRole);
   String role = messageService.getMessage("invitation.invitesender.email.role." + roleName);
   if (role == null) {
     role = roleName;
   }
   return role;
 }
  /** Register listeners */
  public void register() {
    // register with Dictionary Service to allow (re-)init
    dictionaryDAO.registerListener(this);

    // register with Message Service to allow (re-)init
    messageService.register(this);

    if (tenantAdminService.isEnabled()) {
      // register dictionary repository bootstrap
      tenantAdminService.register(this);

      // register repository message (I18N) service
      tenantAdminService.register(messageService);
    }
  }
  public void initMessages() {
    if (this.repositoryMessagesLocations != null) {
      // Register the messages found in the repository
      for (RepositoryLocation repositoryLocation : this.repositoryMessagesLocations) {
        StoreRef storeRef = repositoryLocation.getStoreRef();

        if (!nodeService.exists(storeRef)) {
          logger.info("StoreRef '" + storeRef + "' does not exist");
          continue; // skip this location
        }

        if (repositoryLocation.getQueryLanguage().equals(RepositoryLocation.LANGUAGE_PATH)) {
          List<NodeRef> nodeRefs =
              getNodes(storeRef, repositoryLocation, ContentModel.TYPE_CONTENT);

          if (nodeRefs.size() > 0) {
            List<String> resourceBundleBaseNames = new ArrayList<String>();

            for (NodeRef messageResource : nodeRefs) {
              String resourceName =
                  (String) nodeService.getProperty(messageResource, ContentModel.PROP_NAME);

              String bundleBaseName = messageService.getBaseBundleName(resourceName);

              if (!resourceBundleBaseNames.contains(bundleBaseName)) {
                resourceBundleBaseNames.add(bundleBaseName);
              }
            }
          }
        } else {
          logger.error(
              "Unsupported query language for messages location: "
                  + repositoryLocation.getQueryLanguage());
        }
      }
    }
  }
Beispiel #4
0
 private String buildSubject(Map<String, String> properties) {
   return messageService.getMessage(
       "invitation.invitesender.email.subject",
       ModelUtil.getProductName(repoAdminService),
       getSiteName(properties));
 }