Package pl.net.bluesoft.rnd.processtool.model.dict

Examples of pl.net.bluesoft.rnd.processtool.model.dict.ProcessDictionaryItem


        return i18NSource.getMessage(key, defaultValue);
    }

    private void prepareAndSaveNewItem(BeanItem<DBDictionaryItemWrapper> item, ProcessDBDictionary dictionary) {
    DBDictionaryItemWrapper bean = item.getBean();
        ProcessDictionaryItem lookedUpItem = dictionary.lookup(bean.getKey());
        if (lookedUpItem != null) {
            validationNotification(application, i18NSource, getMessage("validate.dictentry.exists"));
        }
        else {
            bean.getWrappedObject().setDictionary(dictionary);
View Full Code Here


  private Map<String, Object> getDictionaryItemMap(ProcessDictionary dict, EntryInfo entryInfo, Date date) {
    Map<String, Object> items = new HashMap<String, Object>();

        for (Object item : dict.items()) {
            ProcessDictionaryItem pdItem = (ProcessDictionaryItem)item;
            ProcessDictionaryItemValue<String> value = date != null ? pdItem.getValueForDate(date) : pdItem.getValueForCurrentDate();
      Object mappedItem = mapTo(entryInfo, pdItem, value);
      items.put(getKey(pdItem), mappedItem);
        }
        return items;
    }
View Full Code Here

  private Map<String, String> getDictionaryItemMap(ProcessDictionary dict, Date date) {
    Map<String, String> items = new HashMap<String,String>();

        for (Object item : dict.items()) {
            ProcessDictionaryItem pdItem = (ProcessDictionaryItem)item;
            ProcessDictionaryItemValue<String> value = date != null ? pdItem.getValueForDate(date) : pdItem.getValueForCurrentDate();
      items.put(getKey(pdItem), value != null ? valueOf(value.getValue()) : null);
    }
    return items;
  }
View Full Code Here

  }

  @Override
  public Object getEntryForDate(String key, Date date) {
    if (dict != null) {
      ProcessDictionaryItem pdItem = dict.lookup(key);
      if (pdItem != null) {
        ProcessDictionaryItemValue<String> value = date != null ? pdItem.getValueForDate(date) : pdItem.getValueForCurrentDate();
        if (dictDesc.getEntryClass() != null) {       
          return mapTo(entryInfo, pdItem, value);
        }
        else {
          return value != null ? valueOf(value.getValue()) : null;
View Full Code Here

                if (dict != null) {
                    Date validForDate = getValidForDate(element);
                    int i = 0;
                    for (Object o : dict.items()) {
                        ProcessDictionaryItem item = (ProcessDictionaryItem) o;
                        component.addItem(item.getKey());
                        String itemKey = item.getKey().toString();
                        ProcessDictionaryItemValue val = item.getValueForDate(validForDate);
                        String message = getMessage((String) (val != null ? val.getValue() : item.getKey()));
                        component.setItemCaption(item.getKey(),message);
                        if (element instanceof AbstractSelectWidgetElement) {
                            AbstractSelectWidgetElement select = (AbstractSelectWidgetElement) element;
                            if (select.getDefaultSelect() != null && i == select.getDefaultSelect()) {
                                component.setValue(item.getKey());
                            }
                            List<ItemElement> values = select.getValues();
                            values.add(new ItemElement(itemKey, message));
                           
                        }
View Full Code Here

        ProcessDictionary dict = processDictionaryRegistry.getSpecificOrDefaultOrGlobalDictionary(
                processDefinitionConfig, "db", dictionaryName, languageCode);
        if (dict != null) {
            Map<String, String> dictionary = new HashMap<String, String>();
            for (Object item : dict.items()) {
                ProcessDictionaryItem pdItem = (ProcessDictionaryItem) item;
                dictionary.put(pdItem.getKey().toString(), pdItem.getValueForCurrentDate().toString());
            }
            dictionaryMap.put(dictionaryKey(languageCode, dictionaryName), dictionary);
        }
    }
View Full Code Here

    return icon;
  }

  private static String getMessageFromDictionary(ProcessDictionary dict, I18NSource i18NSource, String key, boolean showEditButton, boolean showDebugKey)
  {
    ProcessDictionaryItem dictItem = dict.lookup(key);
   
    StringBuilder messageBuilder = new StringBuilder();
   
    messageBuilder.append("<div id=\"editor1\">");
   
    if(dictItem == null)
      messageBuilder.append(i18NSource.getMessage("help.empty").replaceAll("\\{0\\}", key));
    else
      messageBuilder.append(dictItem.getValueForCurrentDate().getValue());
   
    messageBuilder.append("</div>");
   
    /* Add edit icon */
    if(showEditButton)
    {
      String processDefinitionName = dict.getProcessDefinition() == null ? null : dict.getProcessDefinition().getBpmDefinitionKey();
      String dictionaryId = dict.getDictionaryId();
      String languageCode = i18NSource.getLocale().toString();
      String dictionaryItemKey = key;
      String dictionaryItemValue = dictItem == null ? "" : dictItem.getValueForCurrentDate().getValue().toString();
     
      String escapedValue = StringEscapeUtils.escapeHtml4(dictionaryItemValue);
     
     
      messageBuilder.append("<br/>");
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.model.dict.ProcessDictionaryItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.