01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/glossary/api-impl/src/java/org/theospi/portfolio/help/impl/GlossaryEntityProducer.java $
03: * $Id: GlossaryEntityProducer.java 17650 2006-10-31 20:05:53Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 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.help.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.theospi.portfolio.help.model.Glossary;
29:
30: public class GlossaryEntityProducer extends EntityProducerBase
31: implements EntityTransferrer {
32:
33: protected final Log logger = LogFactory.getLog(getClass());
34: public static final String GLOSSARY_PRODUCER = "ospGlossary";
35: private Glossary glossary;
36:
37: public String getLabel() {
38: return GLOSSARY_PRODUCER;
39: }
40:
41: public void init() {
42: logger.info("init()");
43: try {
44: getEntityManager().registerEntityProducer(this ,
45: GLOSSARY_PRODUCER);
46: } catch (Exception e) {
47: logger
48: .warn("Error registering Glossary Entity Producer",
49: e);
50: }
51: }
52:
53: public void transferCopyEntities(String fromContext,
54: String toContext, List ids) {
55: glossary.importResources(fromContext, toContext, ids);
56: }
57:
58: /**
59: * {@inheritDoc}
60: */
61: public String[] myToolIds() {
62: String[] toolIds = { "osp.glossary" };
63: return toolIds;
64: }
65:
66: public void setGlossary(Glossary glossary) {
67: this.glossary = glossary;
68: }
69:
70: }
|