net.anotheria.anosite.gen.ascustomaction.data.ModuleASCustomAction Maven / Gradle / Ivy
/**
********************************************************************************
*** ModuleASCustomAction.java ***
*** generated by AnoSiteGenerator (ASG), Version: 3.2.2 ***
*** Copyright (C) 2005 - 2023 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.ascustomaction.data;
import net.anotheria.anodoc.data.Module;
import net.anotheria.anodoc.data.DocumentList;
import net.anotheria.anodoc.data.IDHolder;
import net.anotheria.anodoc.data.NoSuchDocumentListException;
import java.util.List;
public class ModuleASCustomAction extends Module{
public static final String MODULE_ID = "ascustomaction";
public static final String LIST_CUSTOMACTIONDEF = "list_customactiondef";
public static final String ID_HOLDER_CUSTOMACTIONDEF = IDHolder.DOC_ID_HOLDER_PRE+"customactiondef";
public static final String LIST_ACTIONMAPPINGDEF = "list_actionmappingdef";
public static final String ID_HOLDER_ACTIONMAPPINGDEF = IDHolder.DOC_ID_HOLDER_PRE+"actionmappingdef";
public ModuleASCustomAction(){
super(MODULE_ID);
}
@SuppressWarnings("unchecked")
private DocumentList _getCustomActionDefs(){
try{
return getList(LIST_CUSTOMACTIONDEF);
}catch(NoSuchDocumentListException e){
return new DocumentList(LIST_CUSTOMACTIONDEF);
}
}
private void _updateCustomActionDefs(DocumentList list){
putList(list);
}
public List getCustomActionDefs(){
return _getCustomActionDefs().getList();
}
public CustomActionDefDocument getCustomActionDef(String id){
return _getCustomActionDefs().getDocumentById(id);
}
public void updateCustomActionDef(CustomActionDefDocument customactiondef){
DocumentList customactiondefs = _getCustomActionDefs();
customactiondefs.removeDocumentById(customactiondef.getId());
customactiondef.setLastUpdateNow();
customactiondef.setCallContextAuthor();
customactiondefs.addDocument(customactiondef);
_updateCustomActionDefs(customactiondefs);
}
public void deleteCustomActionDef(String id){
DocumentList entries = _getCustomActionDefs();
entries.removeDocumentById(id);
_updateCustomActionDefs(entries);
}
public CustomActionDefDocument createCustomActionDef(CustomActionDefDocument customactiondef ){
IDHolder idh = _getIdHolder(ID_HOLDER_CUSTOMACTIONDEF);
int id = idh.getNextIdInt();
customactiondef.renameTo(""+id);
putDocument(idh);
DocumentList entries = _getCustomActionDefs();
customactiondef.setLastUpdateNow();
customactiondef.setCallContextAuthor();
entries.addDocument(customactiondef);
_updateCustomActionDefs(entries);
return customactiondef;
}
public CustomActionDefDocument importCustomActionDef(CustomActionDefDocument customactiondef ){
IDHolder idh = _getIdHolder(ID_HOLDER_CUSTOMACTIONDEF);
idh.adjustTill(customactiondef.getId());
putDocument(idh);
DocumentList entries = _getCustomActionDefs();
customactiondef.setLastUpdateNow();
customactiondef.setCallContextAuthor();
entries.addDocument(customactiondef);
_updateCustomActionDefs(entries);
return customactiondef;
}
@SuppressWarnings("unchecked")
private DocumentList _getActionMappingDefs(){
try{
return getList(LIST_ACTIONMAPPINGDEF);
}catch(NoSuchDocumentListException e){
return new DocumentList(LIST_ACTIONMAPPINGDEF);
}
}
private void _updateActionMappingDefs(DocumentList list){
putList(list);
}
public List getActionMappingDefs(){
return _getActionMappingDefs().getList();
}
public ActionMappingDefDocument getActionMappingDef(String id){
return _getActionMappingDefs().getDocumentById(id);
}
public void updateActionMappingDef(ActionMappingDefDocument actionmappingdef){
DocumentList actionmappingdefs = _getActionMappingDefs();
actionmappingdefs.removeDocumentById(actionmappingdef.getId());
actionmappingdef.setLastUpdateNow();
actionmappingdef.setCallContextAuthor();
actionmappingdefs.addDocument(actionmappingdef);
_updateActionMappingDefs(actionmappingdefs);
}
public void deleteActionMappingDef(String id){
DocumentList entries = _getActionMappingDefs();
entries.removeDocumentById(id);
_updateActionMappingDefs(entries);
}
public ActionMappingDefDocument createActionMappingDef(ActionMappingDefDocument actionmappingdef ){
IDHolder idh = _getIdHolder(ID_HOLDER_ACTIONMAPPINGDEF);
int id = idh.getNextIdInt();
actionmappingdef.renameTo(""+id);
putDocument(idh);
DocumentList entries = _getActionMappingDefs();
actionmappingdef.setLastUpdateNow();
actionmappingdef.setCallContextAuthor();
entries.addDocument(actionmappingdef);
_updateActionMappingDefs(entries);
return actionmappingdef;
}
public ActionMappingDefDocument importActionMappingDef(ActionMappingDefDocument actionmappingdef ){
IDHolder idh = _getIdHolder(ID_HOLDER_ACTIONMAPPINGDEF);
idh.adjustTill(actionmappingdef.getId());
putDocument(idh);
DocumentList entries = _getActionMappingDefs();
actionmappingdef.setLastUpdateNow();
actionmappingdef.setCallContextAuthor();
entries.addDocument(actionmappingdef);
_updateActionMappingDefs(entries);
return actionmappingdef;
}
}