Rational Asset Manager publishes Web services that allow you to work with the repository. Use the Rational Asset Manager Web Services Descriptor Language (WSDL) file to develop custom applications that interact with the Rational Asset Manager server. Here is an example code using client API to interact with Rational Asset Manager from a Java application. Make sure you include all required jars in class path. Use the API found in the Rational Asset Manager Javadoc located in the Reference section of the help.
package ram.update.asset.data;
import org.eclipse.core.runtime.NullProgressMonitor;
import com.ibm.ram.client.RAMAsset;
import com.ibm.ram.client.RAMSession;
import com.ibm.ram.common.data.AssetAttribute;
import com.ibm.ram.common.data.SearchQuery;
import com.ibm.ram.common.data.SearchResult;
public class UpdatedAssetAttribute {
public static void main(String[] args) {
RAMSession session;
session = new RAMSession(
"http://RAM_SERVER/com.ibm.ram.web.ws",
"USERNAME", "PASSWORD");
SearchQuery sQuery = session.createAssetQuery("ramSearch:(1fGroup,COMMUNITY)");
SearchResult searchResult = session.getAssets(sQuery);
RAMAsset[] queryAssets = (RAMAsset[]) searchResult.getAssets();
System.out.println("RAM Assets Query results::" + queryAssets.length);
for (int j = 0; j <>
try {
AssetAttribute attribute = queryAssets[j].getAssetAttribute("ATTRIBUTE_NAME");
attribute.setValues(new String[] { "NEW_VALUE" });
session.queueAssetForPut(queryAssets[j]);
session.putAssets(new NullProgressMonitor());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
}







There are 3 other APIs that RAM v7.1 provides. These include:
1. The commandline ANT Task api for integrating with deployment, build scripts or test scripts. 2. The Policy Java API on the server for writing policies.
3. The Java Client API on the client.
Post a Comment