//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010 huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/willow
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : willow@lists.sourceforge.net 
 */
//----------------------------END  LICENSE----------------------------
package org.huihoo.willow.desktop;


import java.util.Hashtable;

import org.huihoo.workflow.WorkflowException;
import org.huihoo.workflow.desktop.WorkflowDesktop;
import org.huihoo.workflow.desktop.WorkflowDesktopFactory;

public class WorkflowRemoteDesktopFactoryImpl implements WorkflowDesktopFactory
{

	public WorkflowDesktop getInitialDesktop(Hashtable environment) throws WorkflowException
	{
		Hashtable env=(Hashtable)environment.clone();
		String providerURL = (String) env.get(WorkflowDesktop.PROVIDER_URL);
		int comma = providerURL != null ? providerURL.indexOf(',') : -1;
		if(comma>0)
		{
			env.put(WorkflowDesktop.PROVIDER_URL,providerURL.substring(0,comma));
		}

		return new WorkflowRemoteDesktopImpl(env);
	}

}
