Search in sources :

Example 1 with ValidationRulesConnection

use of org.talend.core.model.metadata.builder.connection.ValidationRulesConnection in project tdi-studio-se by Talend.

the class ValidationRulesUtil method getRelatedValidationRuleObjs.

public static List<IRepositoryViewObject> getRelatedValidationRuleObjs(String schemaId) {
    List<IRepositoryViewObject> rulesObjs = new ArrayList<IRepositoryViewObject>();
    if (schemaId != null) {
        try {
            IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
            List<IRepositoryViewObject> members = factory.getAll(ERepositoryObjectType.METADATA_VALIDATION_RULES);
            if (members != null && members.size() > 0) {
                for (IRepositoryViewObject member : members) {
                    if (member != null && member.getProperty() != null) {
                        Item item = member.getProperty().getItem();
                        if (item != null && item instanceof ValidationRulesConnectionItem) {
                            ValidationRulesConnectionItem validItem = (ValidationRulesConnectionItem) item;
                            ValidationRulesConnection connection = (ValidationRulesConnection) validItem.getConnection();
                            if (connection != null && !rulesObjs.contains(member)) {
                                rulesObjs.add(member);
                            }
                        }
                    }
                }
            }
        } catch (PersistenceException e) {
            ExceptionHandler.process(e);
        }
    }
    return rulesObjs;
}
Also used : ValidationRulesConnection(org.talend.core.model.metadata.builder.connection.ValidationRulesConnection) HL7ConnectionItem(org.talend.core.model.properties.HL7ConnectionItem) WSDLSchemaConnectionItem(org.talend.core.model.properties.WSDLSchemaConnectionItem) Item(org.talend.core.model.properties.Item) ValidationRulesConnectionItem(org.talend.core.model.properties.ValidationRulesConnectionItem) XmlFileConnectionItem(org.talend.core.model.properties.XmlFileConnectionItem) JobletProcessItem(org.talend.core.model.properties.JobletProcessItem) ArrayList(java.util.ArrayList) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) PersistenceException(org.talend.commons.exception.PersistenceException) ValidationRulesConnectionItem(org.talend.core.model.properties.ValidationRulesConnectionItem) IProxyRepositoryFactory(org.talend.repository.model.IProxyRepositoryFactory)

Aggregations

ArrayList (java.util.ArrayList)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 ValidationRulesConnection (org.talend.core.model.metadata.builder.connection.ValidationRulesConnection)1 HL7ConnectionItem (org.talend.core.model.properties.HL7ConnectionItem)1 Item (org.talend.core.model.properties.Item)1 JobletProcessItem (org.talend.core.model.properties.JobletProcessItem)1 ValidationRulesConnectionItem (org.talend.core.model.properties.ValidationRulesConnectionItem)1 WSDLSchemaConnectionItem (org.talend.core.model.properties.WSDLSchemaConnectionItem)1 XmlFileConnectionItem (org.talend.core.model.properties.XmlFileConnectionItem)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)1