Ejemplo n.º 1
0
  public boolean querySave(DominoDocument doc) throws NotesException {
    // Create the encoded ID for the snippet
    String category = doc.getItemValueString("Category");
    String name = doc.getItemValueString("Name");
    doc.replaceItemValue("Id", AbstractNode.encodeSnippet(category, name));

    return true;
  }
Ejemplo n.º 2
0
 public void remove(DominoDocument doc, String fieldName, int idx) throws Exception {
   String json = doc.getItemValueString(fieldName);
   if (!StringUtil.isSpace(json)) {
     List<Object> array = (List<Object>) JsonParser.fromJson(JsonJavaFactory.instance, json);
     if (idx < array.size()) {
       array.remove(idx);
       doc.replaceItemValue(fieldName, JsonGenerator.toJson(JsonJavaFactory.instance, array));
     }
   }
 }