
import com.wuweibi.module4j.ModuleActivator
import com.wuweibi.module4j.SupperModule
import com.wuweibi.module4j.module.ModuleContext
import org.marker.mushroom.beans.Menu
import org.marker.mushroom.ext.menu.MenuUtils
import org.marker.mushroom.ext.model.impl.GoodsModelImpl


import org.marker.mushroom.ext.model.ContentModelContext;

/**
 * 自定义模块
 * 
 * @author marker
 * 
 */
public class ProductModuleActivatorImpl  extends SupperModule {

	
	 
	public void start(ModuleContext context) throws Exception {

		ContentModelContext.getInstance().put(new GoodsModelImpl());
		
		
		MenuUtils menuUtils = MenuUtils.getInstance();
		
		// 文章菜单
		def menu = [
			name: "商品管理",
			url : "goods/list.do",
			desc: "系统基础内容管理",
			icon: "fa-th",
			type: "6cd7004ae4bc4aaca1435708cb7dd079" // 唯一编码
		];
		this.id = menuUtils.build(MenuUtils.L1_CONTENT, menu);
	}
	
	public void stop(ModuleContext context) throws Exception {  
		ContentModelContext.getInstance().remove("goods"); 
		MenuUtils menuUtils = MenuUtils.getInstance();
		menuUtils.remove(this.id);
	}

}
