use of com.netsuite.webservices.v2014_2.setup.customization.types.CustomizationFieldType in project components by Talend.
the class NetSuiteMockTestBase method createCustomFieldRefs.
protected Map<String, CustomFieldRef> createCustomFieldRefs(Map<String, CustomFieldSpec<RecordType, CustomizationFieldType>> customFieldSpecs) throws Exception {
NetSuiteClientService<?> clientService = webServiceMockTestFixture.getClientService();
Map<String, CustomFieldRef> map = new HashMap<>();
for (CustomFieldSpec<RecordType, CustomizationFieldType> spec : customFieldSpecs.values()) {
CustomFieldRef fieldRef = clientService.getBasicMetaData().createInstance(spec.getFieldRefType().getTypeName());
fieldRef.setScriptId(spec.getScriptId());
fieldRef.setInternalId(spec.getInternalId());
BeanInfo beanInfo = Beans.getBeanInfo(fieldRef.getClass());
PropertyInfo valuePropInfo = beanInfo.getProperty("value");
Object value = composeValue(valuePropInfo.getWriteType());
if (value != null) {
Beans.setProperty(fieldRef, "value", value);
}
map.put(fieldRef.getScriptId(), fieldRef);
}
return map;
}
use of com.netsuite.webservices.v2014_2.setup.customization.types.CustomizationFieldType in project components by Talend.
the class NetSuiteMockTestBase method createCustomFieldCustomizationRefs.
protected Map<String, CustomizationRef> createCustomFieldCustomizationRefs(Map<String, CustomFieldSpec<RecordType, CustomizationFieldType>> customFieldSpecs) throws Exception {
Map<String, CustomizationRef> map = new HashMap<>();
for (CustomFieldSpec<RecordType, CustomizationFieldType> spec : customFieldSpecs.values()) {
CustomizationRef ref = new CustomizationRef();
ref.setScriptId(spec.getScriptId());
ref.setInternalId(spec.getInternalId());
ref.setType(spec.getRecordType());
map.put(ref.getScriptId(), ref);
}
return map;
}
use of com.netsuite.webservices.v2014_2.setup.customization.types.CustomizationFieldType in project components by Talend.
the class NetSuiteMockTestBase method createCustomFieldTypes.
protected Map<String, CustomFieldType> createCustomFieldTypes(Map<String, CustomFieldSpec<RecordType, CustomizationFieldType>> customFieldSpecs) throws Exception {
Map<String, CustomFieldType> customFieldTypeMap = new HashMap<>();
for (CustomFieldSpec<RecordType, CustomizationFieldType> spec : customFieldSpecs.values()) {
CustomFieldType fieldRecord = (CustomFieldType) spec.getFieldTypeClass().newInstance();
Beans.setProperty(fieldRecord, "internalId", spec.getInternalId());
fieldRecord.setScriptId(spec.getScriptId());
fieldRecord.setFieldType(spec.getFieldType());
for (String appliesTo : spec.getAppliesTo()) {
Beans.setProperty(fieldRecord, appliesTo, Boolean.TRUE);
}
customFieldTypeMap.put(fieldRecord.getScriptId(), fieldRecord);
}
return customFieldTypeMap;
}
use of com.netsuite.webservices.v2014_2.setup.customization.types.CustomizationFieldType in project components by Talend.
the class NetSuiteMockTestBase method createCustomFieldCustomizationRefs.
protected Map<String, CustomizationRef> createCustomFieldCustomizationRefs(Map<String, CustomFieldSpec<RecordType, CustomizationFieldType>> customFieldSpecs) throws Exception {
Map<String, CustomizationRef> map = new HashMap<>();
for (CustomFieldSpec<RecordType, CustomizationFieldType> spec : customFieldSpecs.values()) {
CustomizationRef ref = new CustomizationRef();
ref.setScriptId(spec.getScriptId());
ref.setInternalId(spec.getInternalId());
ref.setType(spec.getRecordType());
map.put(ref.getScriptId(), ref);
}
return map;
}
use of com.netsuite.webservices.v2014_2.setup.customization.types.CustomizationFieldType in project components by Talend.
the class NetSuiteMockTestBase method createCustomFieldTypes.
protected Map<String, CustomFieldType> createCustomFieldTypes(Map<String, CustomFieldSpec<RecordType, CustomizationFieldType>> customFieldSpecs) throws Exception {
Map<String, CustomFieldType> customFieldTypeMap = new HashMap<>();
for (CustomFieldSpec<RecordType, CustomizationFieldType> spec : customFieldSpecs.values()) {
CustomFieldType fieldRecord = (CustomFieldType) spec.getFieldTypeClass().newInstance();
Beans.setProperty(fieldRecord, "internalId", spec.getInternalId());
fieldRecord.setScriptId(spec.getScriptId());
fieldRecord.setFieldType(spec.getFieldType());
for (String appliesTo : spec.getAppliesTo()) {
Beans.setProperty(fieldRecord, appliesTo, Boolean.TRUE);
}
customFieldTypeMap.put(fieldRecord.getScriptId(), fieldRecord);
}
return customFieldTypeMap;
}
Aggregations