All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.maximo.oslc.AnotherTest Maven / Gradle / Ivy

Go to download

The Maximo REST client library provides a set of driver API's which can be consumed by an JAVA based web component that would like to interface with a Maximo instance

There is a newer version: 1.0.2
Show newest version
package com.ibm.maximo.oslc;

import java.io.IOException;
import java.net.URL;

public class AnotherTest {
	public static void main(String[] args) throws IOException, OslcException
	{
		MaximoConnector mc = new MaximoConnector(new Options().user("wilson")
				.password("wilson").mt(false).lean(true).auth("maxauth")
				.host("localhost").port(7001)).debug(true);
		mc.connect();
		
		ResourceSet selectSet = mc.resourceSet("REP_PO")
				.select("ponum", "status", "statusdate")
				.pageSize(10).fetch(null);

		
		int i=0;
		Resource r = selectSet.member(i).load();
		while(r != null)
		{
			r.reload();
			Util.jsonPrettyPrinter(r.toJSON());
			r = selectSet.member(++i);
		}
		
		Util.jsonPrettyPrinter(selectSet.count());
		Resource resource = selectSet.member(0).load();
		
		Util.jsonPrettyPrinter(resource.toJSON());
		
		URL polineHref = new URL(resource.toJSON().getString("poline_collectionref"));
		
		System.out.println(polineHref);
		
		ResourceSet polineSet = new ResourceSet(polineHref,mc).fetch();
		
		Resource polineRes = polineSet.member(0);
		
		Util.jsonPrettyPrinter(polineRes.toJSON());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy