congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.jbpm.form.builder.services.model.forms
Code IndexAdd Tabnine to your IDE (free)

How to use org.jbpm.form.builder.services.model.forms

Best Java code snippets using org.jbpm.form.builder.services.model.forms (Showing top 20 results out of 315)

origin: org.jbpm/form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> dataMap) throws FormEncodingException {
  FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
  this.mimeType = (String) dataMap.get("mimeType");
  this.name = (String) dataMap.get("name");
  this.value = (String) dataMap.get("value");
  this.formatter = (Formatter) decoder
      .decode((Map<String, Object>) dataMap.get("formatter"));
}
origin: org.jbpm/jbpm-form-services

@Override
public String encode(FormItemRepresentation item) throws FormEncodingException {
  if (item == null) { 
    return "null";
  }
  return jsonFromMap(item.getDataMap());
}

origin: org.jbpm/jbpm-form-services

@Override
public String saveForm(FormRepresentation form) throws FormBuilderServiceException {
  String encode = null;
  try {
    encode = FormEncodingServerFactory.getEncoder().encode(form);
  } catch (FormEncodingException ex) {
    logger.error("Error while saving form", ex);
  }
  return encode;
}

origin: org.jbpm/jbpm-form-services

@Override
public Map<String, List<MenuItemDescription>> listMenuItems() throws MenuServiceException {
  Map<String, List<MenuItemDescription>> retval = null;
  try {
    FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
    URL url = asURL("/menuItems.json");
    String json = readURL(url);
    retval = decoder.decodeMenuItemsMap(json);
  } catch (FormEncodingException e) {
    throw new MenuServiceException("Problem parsing menu items json file", e);
  } catch (URISyntaxException e) {
    throw new MenuServiceException("Problem finding menu items json file", e);
  } catch (FileNotFoundException e) {
    throw new MenuServiceException("No menu items json file found", e);
  } catch (IOException e) {
    throw new MenuServiceException("Problem reading menu items json file", e);
  } catch (Exception e) {
    throw new MenuServiceException("Unexpected error", e);
  }
  return retval;
}
origin: org.jbpm/jbpm-form-services

private void writeMenuItems(Map<String, List<MenuItemDescription>> items) throws MenuServiceException {
  try {
    FormRepresentationEncoder encoder = FormEncodingFactory.getEncoder();
    String json = encoder.encodeMenuItemsMap(items);
    URL url = asURL("/menuItems.json");
    writeToURL(url, json);
  } catch (FormEncodingException e) {
    throw new MenuServiceException("Problem transforming menu items to json", e);
  } catch (URISyntaxException e) {
    throw new MenuServiceException("Problem finding menu items json file", e);
  } catch (FileNotFoundException e) {
    throw new MenuServiceException("No menu items json file found", e);
  } catch (IOException e) {
    throw new MenuServiceException("Problem writing menu items json file", e);
  } catch (Exception e) {
    throw new MenuServiceException("Unexpected error", e);
  }
}
origin: org.jbpm/jbpm-form-services

  public FormRepresentation loadForm(String json) {
    try {
      return FormEncodingServerFactory.getDecoder().decode(json);
    } catch (FormEncodingException ex) {
      logger.error("Error while loading form", ex);
    }
    return null;
  }
}
origin: org.jbpm/form-services

@Before
public void setUp() throws Exception {
  FormEncodingFactory.register(FormEncodingServerFactory.getEncoder(), FormEncodingServerFactory.getDecoder());
}

origin: org.jbpm/jbpm-form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> dataMap) throws FormEncodingException {
  FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
  this.mimeType = (String) dataMap.get("mimeType");
  this.name = (String) dataMap.get("name");
  this.value = (String) dataMap.get("value");
  this.formatter = (Formatter) decoder
      .decode((Map<String, Object>) dataMap.get("formatter"));
}
origin: org.jbpm/form-services

@Override
public Map<String, List<MenuItemDescription>> listMenuItems() throws MenuServiceException {
  Map<String, List<MenuItemDescription>> retval = null;
  try {
    FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
    URL url = asURL("/menuItems.json");
    String json = readURL(url);
    retval = decoder.decodeMenuItemsMap(json);
  } catch (FormEncodingException e) {
    throw new MenuServiceException("Problem parsing menu items json file", e);
  } catch (URISyntaxException e) {
    throw new MenuServiceException("Problem finding menu items json file", e);
  } catch (FileNotFoundException e) {
    throw new MenuServiceException("No menu items json file found", e);
  } catch (IOException e) {
    throw new MenuServiceException("Problem reading menu items json file", e);
  } catch (Exception e) {
    throw new MenuServiceException("Unexpected error", e);
  }
  return retval;
}
origin: org.jbpm/form-services

private void writeMenuItems(Map<String, List<MenuItemDescription>> items) throws MenuServiceException {
  try {
    FormRepresentationEncoder encoder = FormEncodingFactory.getEncoder();
    String json = encoder.encodeMenuItemsMap(items);
    URL url = asURL("/menuItems.json");
    writeToURL(url, json);
  } catch (FormEncodingException e) {
    throw new MenuServiceException("Problem transforming menu items to json", e);
  } catch (URISyntaxException e) {
    throw new MenuServiceException("Problem finding menu items json file", e);
  } catch (FileNotFoundException e) {
    throw new MenuServiceException("No menu items json file found", e);
  } catch (IOException e) {
    throw new MenuServiceException("Problem writing menu items json file", e);
  } catch (Exception e) {
    throw new MenuServiceException("Unexpected error", e);
  }
}
origin: org.jbpm/form-services

@Override
public String encode(FormItemRepresentation item) throws FormEncodingException {
  if (item == null) { 
    return "null";
  }
  return jsonFromMap(item.getDataMap());
}

origin: org.jbpm/jbpm-form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> data) throws FormEncodingException {
  super.setDataMap(data);
  this.condition = (String) data.get("condition");
  FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
  this.ifBlock = (FormItemRepresentation) decoder.decode((Map<String, Object>) data.get("ifBlock"));
  this.elseBlock = (FormItemRepresentation) decoder.decode((Map<String, Object>) data.get("elseBlock"));
}

origin: org.jbpm/jbpm-form-services

private String toJson(Mappable obj) {
  StringBuilder builder = new StringBuilder();
  if (obj == null) {
    builder.append("null");
  } else {
    Map<String, Object> data = obj.getDataMap();
    if (data != null) {
      builder.append(jsonFromMap(data));
    }
  }
  return builder.toString();
}
origin: org.jbpm/form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> data) throws FormEncodingException {
  super.setDataMap(data);
  this.condition = (String) data.get("condition");
  FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
  this.ifBlock = (FormItemRepresentation) decoder.decode((Map<String, Object>) data.get("ifBlock"));
  this.elseBlock = (FormItemRepresentation) decoder.decode((Map<String, Object>) data.get("elseBlock"));
}

origin: org.jbpm/form-services

private String toJson(Mappable obj) {
  StringBuilder builder = new StringBuilder();
  if (obj == null) {
    builder.append("null");
  } else {
    Map<String, Object> data = obj.getDataMap();
    if (data != null) {
      builder.append(jsonFromMap(data));
    }
  }
  return builder.toString();
}
origin: org.jbpm/jbpm-form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> data) throws FormEncodingException {
  super.setDataMap(data);
  this.inputName = (String) data.get("inputName");
  this.variableName = (String) data.get("variableName");
  this.loopBlock = (FormItemRepresentation) FormEncodingFactory.getDecoder().decode((Map<String, Object>) data.get("loopBlock"));
}

origin: org.jbpm/form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> data) throws FormEncodingException {
  super.setDataMap(data);
  this.inputName = (String) data.get("inputName");
  this.variableName = (String) data.get("variableName");
  this.loopBlock = (FormItemRepresentation) FormEncodingFactory.getDecoder().decode((Map<String, Object>) data.get("loopBlock"));
}

origin: org.jbpm/jbpm-form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> data) throws FormEncodingException {
  super.setDataMap(data);
  this.cssClassName = (String) data.get("cssClassName");
  this.id = (String) data.get("id");
  this.cssStylesheetUrl = (String) data.get("cssStylesheetUrl");
  this.items.clear();
  List<Object> mapItems = (List<Object>) data.get("items");
  FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
  if (mapItems != null) {
    for (Object obj : mapItems) {
      Map<String, Object> itemMap = (Map<String, Object>) obj;
      FormItemRepresentation item = (FormItemRepresentation) decoder.decode(itemMap);
      this.items.add(item);
    }
  }
}

origin: org.jbpm/form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> data) throws FormEncodingException {
  super.setDataMap(data);
  this.text = (String) data.get("text");
  this.name = (String) data.get("name");
  this.id = (String) data.get("id");
  Map<String, String> i18nMap = (Map<String, String>) data.get("i18n");
  if (i18nMap != null) {
    this.i18n = new HashMap<String, String>();
    this.i18n.putAll(i18nMap);
  }
  this.format = (String) data.get("format");
  FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
  this.onClickScript = (ScriptRepresentation) decoder.decode((Map<String, Object>) data.get("onClickScript"));
}

origin: org.jbpm/jbpm-form-services

@Override
@SuppressWarnings("unchecked")
public void setDataMap(Map<String, Object> data) throws FormEncodingException {
  super.setDataMap(data);
  this.text = (String) data.get("text");
  this.name = (String) data.get("name");
  this.id = (String) data.get("id");
  Map<String, String> i18nMap = (Map<String, String>) data.get("i18n");
  if (i18nMap != null) {
    this.i18n = new HashMap<String, String>();
    this.i18n.putAll(i18nMap);
  }
  this.format = (String) data.get("format");
  FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
  this.onClickScript = (ScriptRepresentation) decoder.decode((Map<String, Object>) data.get("onClickScript"));
}

org.jbpm.form.builder.services.model.forms

Most used classes

  • FormEncodingException
  • FormEncodingFactory
  • FormRepresentationDecoder
  • FormRepresentationEncoder
  • AbstractFormRepresentationEncoder
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now