01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/presentation/api-impl/src/java/org/theospi/portfolio/presentation/model/impl/PresentationContentEntityProducer.java $
03: * $Id: PresentationContentEntityProducer.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.presentation.model.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.Entity;
27: import org.sakaiproject.entity.api.EntityTransferrer;
28: import org.sakaiproject.metaobj.shared.mgt.EntityProducerBase;
29: import org.sakaiproject.service.legacy.resource.DuplicatableToolService;
30:
31: /**
32: * Created by IntelliJ IDEA.
33: * User: John Ellis
34: * Date: Nov 7, 2005
35: * Time: 6:48:14 PM
36: * To change this template use File | Settings | File Templates.
37: */
38: public class PresentationContentEntityProducer extends
39: EntityProducerBase implements EntityTransferrer {
40: protected final Log logger = LogFactory.getLog(getClass());
41: protected static final String PRODUCER_NAME = "ospPresentation";
42: private DuplicatableToolService presentationManager;
43:
44: public String getLabel() {
45: return PRODUCER_NAME;
46: }
47:
48: public void init() {
49: logger.info("init()");
50: try {
51: getEntityManager().registerEntityProducer(this ,
52: Entity.SEPARATOR + PRODUCER_NAME);
53: } catch (Exception e) {
54: logger
55: .warn(
56: "Error registering Presentation Content Entity Producer",
57: e);
58: }
59: }
60:
61: public void transferCopyEntities(String fromContext,
62: String toContext, List ids) {
63: presentationManager
64: .importResources(fromContext, toContext, ids);
65: }
66:
67: /**
68: * {@inheritDoc}
69: */
70: public String[] myToolIds() {
71: String[] toolIds = { "osp.presTemplate" };
72: return toolIds;
73: }
74:
75: public void setPresentationManager(
76: DuplicatableToolService presentationManager) {
77: this.presentationManager = presentationManager;
78: }
79: }
|