net.anotheria.anosite.gen.shared.service.BasicCMSService Maven / Gradle / Ivy
/**
********************************************************************************
*** BasicCMSService.java ***
*** generated by AnoSiteGenerator (ASG), Version: 2.6.3 ***
*** Copyright (C) 2005 - 2010 Anotheria.net, www.anotheria.net ***
*** All Rights Reserved. ***
********************************************************************************
*** Don't edit this code, if you aren't sure ***
*** that you do exactly know what you are doing! ***
*** It's better to invest time in the generator, as into the generated code. ***
********************************************************************************
*/
package net.anotheria.anosite.gen.shared.service;
import net.anotheria.anodoc.data.Module;
import net.anotheria.anodoc.service.IModuleService;
import net.anotheria.anodoc.service.ModuleServiceFactory;
import net.anotheria.asg.util.listener.IModuleListener;
public abstract class BasicCMSService extends BasicService{
public static final String MY_OWNER_ID = "anothereria";
protected IModuleService service;
static{
AnoDocConfigurator.configure();
}
protected BasicCMSService(){
service = ModuleServiceFactory.createModuleService();
}
protected void updateModule(Module mod){
try{
service.storeModule(mod);
}catch(Exception e){
log.error("updateModule", e);
}
}
protected void addModuleListener(String moduleId, IModuleListener moduleListener){
service.addModuleListener(moduleId, MY_OWNER_ID, moduleListener);
}
protected Module getModule(String moduleId){
try{
return service.getModule(MY_OWNER_ID, moduleId, true);
}catch(Exception e){
log.error("getModule", e);
}
return null;
}
}