Search in sources :

Example 1 with SubContainer

use of org.talend.repository.generic.model.genericMetadata.SubContainer in project tdi-studio-se by Talend.

the class GenericRepository method getContainer.

private SubContainer getContainer(GenericConnection connection, String repositoryLocation) {
    SubContainer theContainer = null;
    String containers = repositoryLocation;
    if (containers.indexOf(IGenericConstants.REPOSITORY_LOCATION_SEPARATOR) != -1) {
        containers = containers.substring(repositoryLocation.indexOf(IGenericConstants.REPOSITORY_LOCATION_SEPARATOR) + 1);
        String[] containersArray = containers.split(IGenericConstants.REPOSITORY_LOCATION_SEPARATOR);
        for (String container : containersArray) {
            if (theContainer == null) {
                theContainer = getTheContainer(connection, container);
            } else {
                theContainer = getTheContainer(theContainer, container);
                if (theContainer == null) {
                    //$NON-NLS-1$
                    throw new RuntimeException("Failed to find the SubContainer named:" + container);
                }
            }
        }
    }
    return theContainer;
}
Also used : SubContainer(org.talend.repository.generic.model.genericMetadata.SubContainer)

Example 2 with SubContainer

use of org.talend.repository.generic.model.genericMetadata.SubContainer in project tdi-studio-se by Talend.

the class GenericRepository method createContainer.

private SubContainer createContainer(String containerName, String serializedProperties) {
    SubContainer subContainer = GenericMetadataFactory.eINSTANCE.createSubContainer();
    subContainer.setName(containerName);
    subContainer.setCompProperties(serializedProperties);
    return subContainer;
}
Also used : SubContainer(org.talend.repository.generic.model.genericMetadata.SubContainer)

Example 3 with SubContainer

use of org.talend.repository.generic.model.genericMetadata.SubContainer in project tdi-studio-se by Talend.

the class GenericRepositoryContentHandler method createSubNodes.

private void createSubNodes(RepositoryNode parentNode, IRepositoryViewObject repObj, Package pack) {
    List<SubContainer> subContainers = PackageHelper.getOwnedElements(pack, SubContainer.class);
    if (subContainers.size() > 0) {
        for (SubContainer subContainer : subContainers) {
            RepositoryNode subContainerNode = createSubContainerNode(parentNode, subContainer.getName());
            createSubNodes(subContainerNode, repObj, subContainer);
        }
    } else {
        List<MetadataTable> metadataTables = PackageHelper.getOwnedElements(pack, MetadataTable.class);
        for (MetadataTable metadataTable : metadataTables) {
            createTable(parentNode, repObj, metadataTable);
        }
    }
}
Also used : MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) StableRepositoryNode(org.talend.repository.model.StableRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) SubContainer(org.talend.repository.generic.model.genericMetadata.SubContainer)

Aggregations

SubContainer (org.talend.repository.generic.model.genericMetadata.SubContainer)3 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1 StableRepositoryNode (org.talend.repository.model.StableRepositoryNode)1