use of org.talend.daikon.NamedThing in project components by Talend.
the class MarketoCustomObjectsSchemasProperties method beforeFormPresentCustomObjects.
public void beforeFormPresentCustomObjects() throws IOException {
List<NamedThing> customObjectsNames;
try (SandboxedInstance sandboxedInstance = getSandboxedInstance(RUNTIME_SOURCEORSINK_CLASS, USE_CURRENT_JVM_PROPS)) {
MarketoSourceOrSinkRuntime sos = (MarketoSourceOrSinkRuntime) sandboxedInstance.getInstance();
sos.initialize(null, this);
customObjectsNames = sos.getSchemaNames(null);
}
selectedCustomObjectsNames.setPossibleValues(customObjectsNames);
getForm(FORM_CUSTOMOBJECTS).setAllowBack(true);
getForm(FORM_CUSTOMOBJECTS).setAllowFinish(true);
}
use of org.talend.daikon.NamedThing in project components by Talend.
the class DefaultMetaDataSource method getSearchableTypes.
/**
* {@inheritDoc}
*/
@Override
public Collection<NamedThing> getSearchableTypes() {
List<NamedThing> searchableTypes = new ArrayList<>(256);
Collection<RecordTypeInfo> recordTypes = getRecordTypes();
for (RecordTypeInfo recordTypeInfo : recordTypes) {
RecordTypeDesc recordTypeDesc = recordTypeInfo.getRecordType();
if (recordTypeDesc.getSearchRecordType() != null) {
SearchRecordTypeDesc searchRecordType = clientService.getBasicMetaData().getSearchRecordType(recordTypeDesc);
if (searchRecordType != null) {
searchableTypes.add(new SimpleNamedThing(recordTypeInfo.getName(), recordTypeInfo.getDisplayName()));
}
}
}
return searchableTypes;
}
use of org.talend.daikon.NamedThing in project components by Talend.
the class AbstractTopLevelDefinitionTest method testGetTitle.
@Test
public void testGetTitle() {
// check getTitle with proper i18n
NamedThing i18nDefinition = getMockI18nDef();
when(i18nDefinition.getI18nMessage("definition.foo.title")).thenReturn("ZeTitle");
assertEquals("ZeTitle", i18nDefinition.getTitle());
// check getTitle with no i18n but one available for displayname
i18nDefinition = getMockI18nDef();
when(i18nDefinition.getI18nMessage("definition.foo.displayName")).thenReturn("ZedisplayName");
assertEquals("ZedisplayName", i18nDefinition.getTitle());
// check getTitle with no i18n and no i18n for display name
i18nDefinition = getMockI18nDef();
assertEquals("definition.foo.title", i18nDefinition.getTitle());
}
use of org.talend.daikon.NamedThing in project components by Talend.
the class PropertiesTester method resolveProperty.
private Property resolveProperty() {
if (argIndex >= args.length) {
System.out.println("Please specify the property name (which can be qualified)");
throw new IllegalArgumentException();
}
String prop = args[argIndex++];
NamedThing se = testProps.getProperty(prop);
if (se == null) {
System.out.println("Property: " + prop + " not found");
throw new IllegalArgumentException();
}
if (!(se instanceof Property)) {
System.out.println("Property: " + prop + " must be a leaf property");
throw new IllegalArgumentException();
}
Property p = (Property) se;
return p;
}
use of org.talend.daikon.NamedThing in project components by Talend.
the class AzureStorageSourceOrSink method getSchemaNames.
@Override
public List<NamedThing> getSchemaNames(RuntimeContainer container) throws IOException {
List<NamedThing> result = new ArrayList<>();
try {
CloudStorageAccount storageAccount = getAzureConnection(container).getCloudStorageAccount();
CloudBlobClient client = storageAccount.createCloudBlobClient();
for (CloudBlobContainer c : client.listContainers()) {
result.add(new SimpleNamedThing(c.getName(), c.getName()));
}
} catch (InvalidKeyException | URISyntaxException e) {
throw new ComponentException(e);
}
return result;
}
Aggregations