
package cust.report;

import java.util.*;

import wt.maturity.*;

import wt.query.QuerySpec;

import wt.lifecycle.State;

import wt.fc.QueryResult;
import wt.fc.WTObject;
import wt.fc.PersistenceHelper;

import wt.method.RemoteMethodServer;
import wt.httpgw.GatewayAuthenticator;

public class promoQue_01a {

	static String div = "\n\n************************************************************\n";

	public static void main(String[] args) throws Exception {
		RemoteMethodServer rms = RemoteMethodServer.getDefault();
		GatewayAuthenticator auth = new GatewayAuthenticator();
		auth.setRemoteUser("wcadmin");
		rms.setAuthenticator(auth);

		new promoQue_01a();
	}

	public promoQue_01a() throws Exception {

		System.out.println("\n");

		//	PromotionNotice.class
		QueryResult resPN=PersistenceHelper.manager.find(new QuerySpec(PromotionNotice.class));
		while(resPN.hasMoreElements()) {
			PromotionNotice wtobj = (PromotionNotice)resPN.nextElement();

			State wtState = wtobj.getMaturityState();

			System.out.println("PromotionNotice - Name: "+wtobj.getName());
			System.out.println("Number: "+wtobj.getNumber());
			System.out.println("Description: "+wtobj.getDescription());
			System.out.println("Object Type: "+wtobj.getType());
			System.out.println("Container: "+wtobj.getContainer());
			System.out.println("Container Name: "+wtobj.getContainerName());
			System.out.println("Organization Name: "+wtobj.getOrganizationName());

			java.sql.Timestamp wfTime = (java.sql.Timestamp)wtobj.getPromotionDate();

			System.out.println("Promotion Date: "+wfTime);
			System.out.println("Promotion Date2: "+wtobj.getPromotionDate());

			System.out.println("MaturityState: "+wtState);
			System.out.println("MaturityState2: "+wtobj.getMaturityState());

			//System.out.println("getConfiguration: "+wtobj.getConfiguration());

			System.out.println("\n");
		}
		System.out.println("Number of PromotionNotice Objects: "+resPN.size()+div);
	}
}

