* the new type name
* @return the created knowledge type
*/
+ @Transactional
public KnowledgeElementType createType(final String name) {
KnowledgeElementType kelt = getKnowledgeElementTypeDAO()
.findByCriteria(Restrictions.eq("name", name));
*
* @return the list of all knowledge types
*/
+ @Transactional
public List<KnowledgeElementType> selectAllTypes() {
return getKnowledgeElementTypeDAO().getAll(Order.asc("rid"));
}
* the progress state
* @return the list of found knowledge types
*/
+ @Transactional
public List<KnowledgeElementType> selectTypesWhere(final ProgressState state) {
return getKnowledgeElementTypeDAO().getFilteredList(
Restrictions.eq("state", state), Order.asc("rid"));
* the knowledge type name
* @return the found knowledge type
*/
+ @Transactional
public KnowledgeElementType selectType(final String name) {
return getKnowledgeElementTypeDAO().findByCriteria(
Restrictions.eq("name", name));
* the id of a knowledge type
* @return the found knowledge type
*/
+ @Transactional
public KnowledgeElementType selectType(final long index) {
return getKnowledgeElementTypeDAO().get(index);
}
/**
* Initialize the database: create all necessary default staff defined in the configuration file.
*/
+ @Transactional
protected void initialize() {
createDocumentTypes();
createSimulationContextTypes();
/**
* Create in the database knowledge types defined in the custom configuration.
*/
+ @Transactional
private void createKnowledgeElementTypes() {
try {
KnowledgeElementType ktype = getKnowledgeElementTypeService()