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

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

import java.util.*;
import wt.fc.Persistable;
import wt.fc.ReferenceFactory;
import wt.httpgw.URLFactory;
import wt.templateutil.processor.*;
import wt.util.*;

// Referenced classes of package com.ptc.windchill.pdmlink.doc.server.processors:
//            CopyDocUfidActionDelegate

public class CopyDocUfidURLActionDelegate extends CopyDocUfidActionDelegate
    implements NavBarURLActionDelegate
{

    public CopyDocUfidURLActionDelegate()
    {
        actionName = null;
        classURL = null;
        resourceBundle = null;
        resourceKey = null;
        helper = new NavBarURLActionDelegateHelper();
    }

    public String getActionName()
    {
        return helper.getActionName();
    }

    public String getClassURL()
    {
        return null;
    }

    public void setClassURL(String s)
        throws WTPropertyVetoException
    {
    }

    public String URL(Object object)
        throws WTException
    {
        String oid = (new ReferenceFactory()).getReferenceString((Persistable)object);
        Boolean validation = enableable(object);
        String url_string = null;
        Locale loc = WTContext.getContext().getLocale();
        ResourceBundle utilRb = ResourceBundle.getBundle("com.ptc.netmarkets.util.utilResource", loc);
        String alertMessage = utilRb.getString("87");
        String noneMessage = utilRb.getString("43");
        URLFactory urlFactory = getState().getURLFactory();
        String cookieName = "DocStructure-" + getState().getContextObj();
        HashMap map = new HashMap();
        map.put("oid", getState().getContextObj().toString());
        map.put("action", "Copy");
        map.put("spscopy", "true");
        map.put("cookie", cookieName);
        if(validation.booleanValue())
        {
            helper.setOidAdded(true);
            url_string = urlFactory.getHREF("/netmarkets/jsp/object/copy.jsp", map, true);
        }
        return "javascript:copyObjectMainAll(window.document.forms.DocumentStructureInformationBody,'" + url_string + "',window.document.forms.DocumentStructureInformationBody.elements,false,'" + alertMessage + "','" + noneMessage + "')";
    }

    public String getURLLabel(Locale locale)
    {
        return helper.getURLLabel(locale);
    }

    public boolean isURLProvider(HashMap queryValueMap, Object object)
    {
        return helper.isURLProvider(queryValueMap, object);
    }

    public void setResourceKey(String key)
    {
        helper.setResourceKey(key);
    }

    public void setResourceBundleStr(String resourceBundle)
    {
        helper.setResourceBundleStr(resourceBundle);
    }

    public void setState(HTTPState state)
    {
        helper.setState(state);
    }

    public HTTPState getState()
    {
        return helper.getState();
    }

    public void setActionName(String action)
    {
        try
        {
            helper.setActionName(action);
        }
        catch(WTPropertyVetoException wpve)
        {
            wpve.printStackTrace();
        }
    }

    public void setMethod(String method)
    {
        helper.setMethod(method);
    }

    private String actionName;
    private String classURL;
    private String resourceBundle;
    private String resourceKey;
    private static final String UTIL_RESOURCE = "com.ptc.netmarkets.util.utilResource";
    protected NavBarURLActionDelegateHelper helper;
}
