01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/wizard/api-impl/src/java/org/theospi/portfolio/wizard/impl/WizardEntityProducer.java $
03: * $Id: WizardEntityProducer.java 17650 2006-10-31 20:05:53Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.theospi.portfolio.wizard.impl;
21:
22: import java.util.List;
23:
24: import org.apache.commons.logging.Log;
25: import org.apache.commons.logging.LogFactory;
26: import org.sakaiproject.entity.api.EntityTransferrer;
27: import org.sakaiproject.metaobj.shared.mgt.EntityProducerBase;
28: import org.sakaiproject.service.legacy.resource.DuplicatableToolService;
29:
30: /**
31: * Created by IntelliJ IDEA.
32: * User: John Ellis
33: * Date: Nov 14, 2005
34: * Time: 6:03:02 PM
35: * To change this template use File | Settings | File Templates.
36: */
37: public class WizardEntityProducer extends EntityProducerBase implements
38: EntityTransferrer {
39:
40: protected final Log logger = LogFactory.getLog(getClass());
41: public static final String WIZARD_PRODUCER = "ospWizard";
42: private DuplicatableToolService wizardManager;
43:
44: public String getLabel() {
45: return WIZARD_PRODUCER;
46: }
47:
48: public void init() {
49: logger.info("init()");
50: try {
51: getEntityManager().registerEntityProducer(this ,
52: WIZARD_PRODUCER);
53: } catch (Exception e) {
54: logger.warn("Error registering Wizard Entity Producer", e);
55: }
56: }
57:
58: public void transferCopyEntities(String fromContext,
59: String toContext, List ids) {
60: wizardManager.importResources(fromContext, toContext, ids);
61: }
62:
63: /**
64: * {@inheritDoc}
65: */
66: public String[] myToolIds() {
67: String[] toolIds = { "osp.wizard" };
68: return toolIds;
69: }
70:
71: public void setWizardManager(DuplicatableToolService wizardManager) {
72: this.wizardManager = wizardManager;
73: }
74:
75: }
|