IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > Adapter Toolkit > Implementing code from the IBM WebSphere Adapter Toolkit > Enterprise metadata discovery general interfaces and implementation for application adapters > Enterprise metadata discovery implementation samples

WBIMetadataObjectImpl samples

WBIMetadataObjectImpl represents the nodes of the tree that IBM Integration Designerdisplays during enterprise metadata discovery. In most cases these nodes map to objects in the EIS that the user selects to import a service description.

WBIMetadataObjectImpl should be extended and the following methods must be implemented.


createFilterProperties

The createFilterProperties() method returns an instance of a property group that represents properties that you can use to filter searches for child objects of a MetadataObject.

For example, if the top level node is a schema for JDBC, you might fetch table names with a filter consisting of a specific alphabet sequence. Implementation should return null if such properties are not applicable. See WBIMetadataTreeImpl.createFilterProperties in the Javadoc.


createObjectProperties

The createObjectProperties() method returns a property group that provides information about the specific object in MetadataTree. This helps inform the user about the metadata object instance. Implementation should return null if such properties are not applicable.


getChildren

The getChildren() method returns an instance of WBIMetadataObjectResponseImpl. The instance should be populated with child MetadataObjects using method setObjects(). (This is comparable to the MetadataTree.listMetadataObjects call.) The logic should use filter properties, if are supported by the implementation.

	public MetadataObjectResponse getChildren(PropertyGroup filterParameters)
throws MetadataException {
		
		WBIMetadataObjectResponseImpl response = new WBIMetadataObjectResponseImpl();
		ArrayList list = new ArrayList();
		try {
			if (boType != null) {
				List children = boType.getChildren();
				if (children != null)
					for (Iterator e = children.iterator(); e.hasNext();) {
						BOType child = (BOType) e.next();
						String name = child.getName();
						// Create the child MetadataObject
						EISSAMetadataObject childObject = new EISSAMetadataObject(tree,helper);
						childObject.setTargetNameSpace(child.getType().getNameSpace());
						childObject.setDisplayName(name);
						childObject.setBOType(child);
						if (child.getChildren() != null && child.getChildren().size() > 0) {
							childObject.setHasChildren(true);
						} 						// Mark these as not selectable
						childObject.setSelectableForImport(false);
						childObject.setContainedChild(true);
						//childObject.setContentType(getContentType());
						childObject.setBOName(name);
						
						// Set the parent object 						childObject.setParent(this);
						childObject.setLocation(childObject.getTargetNameSpace()
 + childObject.getBOName());
						
						// Copy the content and header from the 						// object created for the same complexType
						// as a top level object. This would have happened
						// in the step of DTFMetadataTree.listMetadataObjects()
						EISSAMetadataObject topObject = (EISSAMetadataObject)
tree.getMetadataObject(childObject.getLocation());
						childObject.setHeader(topObject.getHeader());
						childObject.setAliasTag(topObject.getAliasTag());
						childObject.setContent(topObject.getContent());
						childObject.setXsdName(topObject.getXsdName());
						if (childObject.getXsdName().equals(this.getXsdName())) {
							childObject.setPartOfSameXSD(true);
							topObject.setPartOfSameXSD(true);
						} 						list.add(childObject);
					} 			} else {
				if (childList != null)
					list = childList;
			} 		} catch (Exception e) {
			throw new MetadataException(e.getMessage());
		} 		response.setObjects(list);

	

		return response;
	}

Enterprise metadata discovery implementation samples