package org.concord.otrunk.util;

import org.concord.framework.otrunk.OTObjectService;
import org.concord.framework.otrunk.view.OTLabbookManager;
import org.concord.framework.otrunk.view.OTLabbookManagerProvider;
import org.concord.otrunk.util.OTLabbookBundle.ResourceSchema;

public class OTLabbookManagerProviderImpl
    implements OTLabbookManagerProvider
{
	private ResourceSchema resources;

	public OTLabbookManagerProviderImpl(OTLabbookBundle.ResourceSchema resources)
    {
	    this.resources = resources;
    }

	public OTLabbookManager getLabbookManager(OTObjectService objectService)
	{
        try {
        	OTLabbookBundle bundle = (OTLabbookBundle) objectService.getOTObject(resources.getGlobalId());
        	this.resources = bundle.resources;
    		return new OTLabbookManagerImpl(resources);
        } catch (Exception e) {
	        e.printStackTrace();
        }
        System.err.println("Cannot create OTLabbookBundle from object service");
        return null;
	}

}

Add OTLabbookManagerProvider and implementation, which provides a service which passes back a OTLabbookManager using the OTObjectService
Add OTLabbookManagerProvider and implementation, which provides a service which passes back a OTLabbookManager using the OTObjectService

git-svn-id: 8ebed0c25533aaea68ca43268d4d516467f97e6a@15264 6e01202a-0783-4428-890a-84243c50cc2b
