protected Field getTextBoxField(long ddmStructureId) { Field field = new Field(); field.setDDMStructureId(ddmStructureId); field.setName("text_box"); List<Serializable> enValues = new ArrayList<>(); enValues.add("one"); enValues.add("two"); enValues.add("three"); field.addValues(_enLocale, enValues); List<Serializable> ptValues = new ArrayList<>(); ptValues.add("um"); ptValues.add("dois"); ptValues.add("tres"); field.addValues(_ptLocale, ptValues); return field; }
protected Field getBooleanField(long ddmStructureId) { Field field = new Field(); field.setDDMStructureId(ddmStructureId); field.setName("boolean"); List<Serializable> enValues = new ArrayList<>(); enValues.add(true); enValues.add(false); field.addValues(_enLocale, enValues); return field; }
protected Field getLinkToLayoutField(long ddmStructureId, Map<String, Layout> layoutsMap) { Field field = new Field(); field.setDDMStructureId(ddmStructureId); field.setName("link_to_layout"); List<Serializable> enValues = new ArrayList<>(); for (Layout layout : layoutsMap.values()) { enValues.add(getLinkToLayoutFieldValue(layout, false)); enValues.add(getLinkToLayoutFieldValue(layout, true)); } field.addValues(_enLocale, enValues); return field; }
protected Fields getNestedFields(long ddmStructureId) { Fields fields = new Fields(); // Contact Field contact = new Field(); contact.setDDMStructureId(ddmStructureId); contact.setName("contact"); List<Serializable> enValues = new ArrayList<>(); enValues.add("joe"); enValues.add("richard"); contact.setValues(_enLocale, enValues); List<Serializable> ptValues = new ArrayList<>(); ptValues.add("joao"); ptValues.add("ricardo"); contact.addValues(_ptLocale, ptValues); fields.put(contact); // Phone Field phone = new Field(); phone.setDDMStructureId(ddmStructureId); phone.setName("phone"); List<Serializable> values = new ArrayList<>(); values.add("123"); values.add("456"); phone.setValues(_enLocale, values); phone.addValues(_ptLocale, values); fields.put(phone); // Ext Field ext = new Field(); ext.setDDMStructureId(ddmStructureId); ext.setName("ext"); values = new ArrayList<>(); values.add("1"); values.add("2"); values.add("3"); values.add("4"); values.add("5"); ext.setValues(_enLocale, values); ext.addValues(_ptLocale, values); fields.put(ext); Field fieldsDisplayField = new Field( ddmStructureId, DDMImpl.FIELDS_DISPLAY_NAME, "contact_INSTANCE_RF3do1m5,phone_INSTANCE_QK6B0wK9," + "ext_INSTANCE_L67MPqQf,ext_INSTANCE_8uxzZl41," + "ext_INSTANCE_S58K861T,contact_INSTANCE_CUeFxcrA," + "phone_INSTANCE_lVTcTviF,ext_INSTANCE_cZalDSll," + "ext_INSTANCE_HDrK2Um5"); fields.put(fieldsDisplayField); return fields; }