/*
 * @(#)WebRoboTamer.java
 * Copyright 2001 Nomura Research Institute, LTD. All rights reserved.
 * RIDUAL : Web Robo Tamer
 * @author  Intelligent Technology Inc.
 * @version 1.00 2002/08/29
 */
package jp.co.nri.rid.web;

import	java.util.*;
import	jp.co.nri.rid.error.*;
import	jp.co.iti.fagot.util.*;
import	jp.co.iti.fagot.doc.DocManager;

/**
 * メッセージをridual環境から取得できるようにしたWebRoboTamer。
 */
public class RWebRoboTamer extends WebRoboTamer{
	public void get(String target) throws RidException{
		WebMessages messages = new RWebMessages();
		
		ZProperties	properties	= DocManager.loadProperty(DocManager.ELEMENT);
		String		staticpage	= properties.getProperty("import.page.extensions.static");
		String		dynamicpage	= properties.getProperty("import.page.extensions.dynamic");
		String		content		= properties.getProperty("import.resource.extensions");
		
		Vector pages = new Vector();
		StringTokenizer st = new StringTokenizer(staticpage ," ");
		while(st.hasMoreTokens())	pages.add(st.nextToken());
		
		st = new StringTokenizer(dynamicpage ," ");
		while(st.hasMoreTokens())	pages.add(st.nextToken());
		
		Vector contents = new Vector();
		st = new StringTokenizer(content ," ");
		while(st.hasMoreTokens())	contents.add(st.nextToken());
		
		super.get(target ,messages ,(String[])pages.toArray(new String[0]) ,(String[])contents.toArray(new String[0]));
		
		if(0<messages.size()) throw new RidException(messages.toString());
	}
}
