// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) deadcode 
// Source File Name:   ViewDocumentFormTaskDelegate.java

package com.ptc.windchill.pdmlink.doc.server.processors;

import java.io.PrintStream;
import java.io.Serializable;
import java.util.Locale;
import java.util.Properties;
import wt.content.ContentHTTPStream;
import wt.httpgw.HTTPRequest;
import wt.httpgw.LanguagePreference;
import wt.templateutil.processor.*;
import wt.util.WTException;
import wt.util.WTProperties;

public class ViewDocumentFormTaskDelegate extends FormTaskDelegate
    implements Serializable
{

    public ViewDocumentFormTaskDelegate()
    {
        locale = null;
    }

    /**
     * @deprecated Method processAction is deprecated
     */

    public void processAction(ContentHTTPStream contentStream)
        throws Exception
    {
        locale = LanguagePreference.getLocale(getState().getRequestObj().getProperty("cgi.http_accept_language", ""));
        System.out.println("in new ViewDocumentFormTaskDelegate");
        RedirectObject redirectObj = new RedirectObject();
        redirectObj.setRedirection(getState());
    }

    private boolean validateForm(String pageName, Properties fData)
    {
        return true;
    }

    public String getFormValueFromSession(String formName, String inputFieldName, String defaultValue)
        throws WTException
    {
        if(formName == null || inputFieldName == null)
            throw new WTException("WizardProcessor.getFormValueFromSession(): required \"formName\" and \"inputFieldName\" parameters are missing");
        ServletSessionCookie cookie = getState().getCookieManager().getCookie(formName);
        String value = (String)cookie.get(inputFieldName);
        if(value == null && defaultValue != null)
            value = defaultValue;
        return value;
    }

    static Class _mthclass$(String x0)
    {
        return Class.forName(x0);
        ClassNotFoundException x1;
        x1;
        throw (new NoClassDefFoundError()).initCause(x1);
    }

    private static final String RESOURCE = "com.ptc.windchill.pdmlink.doc.server.processors.processorsResource";
    private static final String CLASSNAME;
    private Locale locale;
    protected static boolean VERBOSE = false;

    static 
    {
        CLASSNAME = (com.ptc.windchill.pdmlink.doc.server.processors.ViewDocumentFormTaskDelegate.class).getName();
        try
        {
            WTProperties properties = WTProperties.getLocalProperties();
            VERBOSE = properties.getProperty("wt.doc.verbose", false);
        }
        catch(Throwable t)
        {
            System.err.println("com.ptc.windchill.pdmlink.doc.server.processors.CreateDocumentFormTaskDelegate : Error reading wt.doc.* properties");
        }
    }
}
