KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > module > admininterface > commands > BaseActivationCommand


1 /**
2  *
3  */

4 package info.magnolia.module.admininterface.commands;
5
6 import info.magnolia.cms.beans.config.ContentRepository;
7 import info.magnolia.cms.exchange.Syndicator;
8 import info.magnolia.cms.util.FactoryUtil;
9 import info.magnolia.context.MgnlContext;
10
11
12 /**
13  * @author Philipp Bracher
14  * @version $Id: BaseActivationCommand.java 6896 2006-10-25 15:36:52Z philipp $
15  *
16  */

17 public abstract class BaseActivationCommand extends RuleBasedCommand {
18
19     /**
20      * You can pass a syndicator to the command (optional)
21      */

22     public static final String JavaDoc ATTRIBUTE_SYNDICATOR = "syndicator";
23
24     private Syndicator syndicator;
25
26     public Syndicator getSyndicator() {
27         // lazy bound, but only if this is a clone
28
if (syndicator == null && isClone()) {
29             syndicator = (Syndicator) FactoryUtil.newInstance(Syndicator.class);
30             syndicator.init(
31                 MgnlContext.getUser(),
32                 this.getRepository(),
33                 ContentRepository.getDefaultWorkspace(this.getRepository()),
34                 getRule());
35         }
36         return syndicator;
37     }
38
39     /**
40      * @param syndicator the syndicator to set
41      */

42     public void setSyndicator(Syndicator syndicator) {
43         this.syndicator = syndicator;
44     }
45
46 }
47
Popular Tags