// 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:   CheckInDocumentActionDelegate.java

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

import com.ptc.windchill.enterprise.templateutil.ActionValidator;
import java.io.*;
import wt.fc.EvolvableHelper;
import wt.pds.PDSObjectInput;
import wt.templateutil.processor.HTTPState;
import wt.templateutil.processor.NavBarActionDelegate;
import wt.util.WTException;
import wt.util.WTPropertyVetoException;
import wt.vc.wip.Workable;

public class CheckInDocumentActionDelegate
    implements NavBarActionDelegate, Externalizable
{

    public CheckInDocumentActionDelegate()
    {
        state = null;
        action = null;
    }

    public void writeExternal(ObjectOutput output)
        throws IOException
    {
        output.writeLong(0xd4b6b5eeea339daL);
    }

    public void readExternal(ObjectInput input)
        throws IOException, ClassNotFoundException
    {
        long readSerialVersionUID = input.readLong();
        readVersion(this, input, readSerialVersionUID, false, false);
    }

    protected boolean readVersion(CheckInDocumentActionDelegate thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
        throws IOException, ClassNotFoundException
    {
        boolean success = true;
        if(readSerialVersionUID != 0xd4b6b5eeea339daL)
        {
            success = readOldVersion(input, readSerialVersionUID, passThrough, superDone);
            if(input instanceof PDSObjectInput)
                EvolvableHelper.requestRewriteOfEvolvedBlobbedObject();
        }
        return success;
    }

    private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
        throws IOException, ClassNotFoundException
    {
        boolean success = true;
        if(readSerialVersionUID != 0xf55c3bac8461a956L)
            throw new InvalidClassException(CLASSNAME, "Local class not compatible: stream classdesc externalizationVersionUID=" + readSerialVersionUID + " local class externalizationVersionUID=" + 0xd4b6b5eeea339daL);
        else
            return success;
    }

    /**
     * @deprecated Method setState is deprecated
     */

    public void setState(HTTPState state)
    {
        this.state = state;
    }

    public void setActionName(String action)
        throws WTPropertyVetoException
    {
        this.action = action;
    }

    /**
     * @deprecated Method valid is deprecated
     */

    public Boolean valid(Object object)
    {
        return new Boolean(object instanceof Workable);
    }

    /**
     * @deprecated Method enableable is deprecated
     */

    public Boolean enableable(Object object)
        throws WTException
    {
        return new Boolean(ActionValidator.isCheckInValid(object));
    }

    /**
     * @deprecated Method getContextServiceName is deprecated
     */

    public String getContextServiceName()
    {
        return "CHECKINDOCUMENT";
    }

    protected void setContextServiceName(String s)
    {
    }

    public HTTPState getState()
    {
        return state;
    }

    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;
    static final long serialVersionUID = 1L;
    public static final long EXTERNALIZATION_VERSION_UID = 0xd4b6b5eeea339daL;
    protected static final long OLD_FORMAT_VERSION_UID = 0xf55c3bac8461a956L;
    private HTTPState state;
    private String action;
    public static final String CONTEXT_SERVICE_NAME = "CHECKINDOCUMENT";

    static 
    {
        CLASSNAME = (com.ptc.windchill.pdmlink.doc.server.processors.CheckInDocumentActionDelegate.class).getName();
    }
}
