1 23 24 package org.infoglue.cms.controllers.kernel.impl.simple; 25 26 import java.util.List ; 27 28 import org.exolab.castor.jdo.Database; 29 import org.infoglue.cms.entities.kernel.BaseEntityVO; 30 import org.infoglue.cms.entities.management.ContentTypeDefinitionVO; 31 import org.infoglue.cms.entities.workflow.WorkflowDefinition; 32 import org.infoglue.cms.entities.workflow.WorkflowDefinitionVO; 33 import org.infoglue.cms.entities.workflow.impl.simple.WorkflowDefinitionImpl; 34 import org.infoglue.cms.exception.Bug; 35 import org.infoglue.cms.exception.ConstraintException; 36 import org.infoglue.cms.exception.SystemException; 37 38 41 42 public class WorkflowDefinitionController extends BaseController 43 { 44 45 48 49 public static WorkflowDefinitionController getController() 50 { 51 return new WorkflowDefinitionController(); 52 } 53 54 public WorkflowDefinitionVO getWorkflowDefinitionVOWithId(Integer workflowDefinitionId) throws SystemException, Bug 55 { 56 return (WorkflowDefinitionVO) getVOWithId(WorkflowDefinitionImpl.class, workflowDefinitionId); 57 } 58 59 public WorkflowDefinition getWorkflowDefinitionWithId(Integer workflowDefinitionId, Database db) throws SystemException, Bug 60 { 61 return (WorkflowDefinition) getObjectWithId(WorkflowDefinitionImpl.class, workflowDefinitionId, db); 62 } 63 64 public List getWorkflowDefinitionVOList() throws SystemException, Bug 65 { 66 76 77 List workflowDefinitionVOList = getAllVOObjects(WorkflowDefinitionImpl.class, "workflowDefinitionId"); 78 79 81 return workflowDefinitionVOList; 82 } 83 84 85 public WorkflowDefinitionVO create(WorkflowDefinitionVO workflowDefinitionVO) throws ConstraintException, SystemException 86 { 87 WorkflowDefinition workflowDefinition = new WorkflowDefinitionImpl(); 88 workflowDefinition.setValueObject(workflowDefinitionVO); 89 workflowDefinition = (WorkflowDefinition) createEntity(workflowDefinition); 90 return workflowDefinition.getValueObject(); 91 } 92 93 public void delete(WorkflowDefinitionVO workflowDefinitionVO) throws ConstraintException, SystemException 94 { 95 deleteEntity(WorkflowDefinitionImpl.class, workflowDefinitionVO.getWorkflowDefinitionId()); 96 } 97 98 public WorkflowDefinitionVO update(WorkflowDefinitionVO workflowDefinitionVO) throws ConstraintException, SystemException 99 { 100 return (WorkflowDefinitionVO) updateEntity(WorkflowDefinitionImpl.class, workflowDefinitionVO); 101 } 102 103 107 108 public BaseEntityVO getNewVO() 109 { 110 return new ContentTypeDefinitionVO(); 111 } 112 } 113 | Popular Tags |