net.anotheria.anosite.gen.ascustomdata.data.ModuleASCustomData Maven / Gradle / Ivy
/**
********************************************************************************
*** ModuleASCustomData.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.ascustomdata.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 ModuleASCustomData extends Module{
public static final String MODULE_ID = "ascustomdata";
public static final String LIST_CUSTOMBOXTYPE = "list_customboxtype";
public static final String ID_HOLDER_CUSTOMBOXTYPE = IDHolder.DOC_ID_HOLDER_PRE+"customboxtype";
public static final String LIST_CUSTOMBOXHANDLERDEF = "list_customboxhandlerdef";
public static final String ID_HOLDER_CUSTOMBOXHANDLERDEF = IDHolder.DOC_ID_HOLDER_PRE+"customboxhandlerdef";
public static final String LIST_CUSTOMGUARDDEF = "list_customguarddef";
public static final String ID_HOLDER_CUSTOMGUARDDEF = IDHolder.DOC_ID_HOLDER_PRE+"customguarddef";
public ModuleASCustomData(){
super(MODULE_ID);
}
@SuppressWarnings("unchecked")
private DocumentList _getCustomBoxTypes(){
try{
return getList(LIST_CUSTOMBOXTYPE);
}catch(NoSuchDocumentListException e){
return new DocumentList(LIST_CUSTOMBOXTYPE);
}
}
private void _updateCustomBoxTypes(DocumentList list){
putList(list);
}
public List getCustomBoxTypes(){
return _getCustomBoxTypes().getList();
}
public CustomBoxTypeDocument getCustomBoxType(String id){
return _getCustomBoxTypes().getDocumentById(id);
}
public void updateCustomBoxType(CustomBoxTypeDocument customboxtype){
DocumentList customboxtypes = _getCustomBoxTypes();
customboxtypes.removeDocumentById(customboxtype.getId());
customboxtype.setLastUpdateNow();
customboxtype.setCallContextAuthor();
customboxtypes.addDocument(customboxtype);
_updateCustomBoxTypes(customboxtypes);
}
public void deleteCustomBoxType(String id){
DocumentList entries = _getCustomBoxTypes();
entries.removeDocumentById(id);
_updateCustomBoxTypes(entries);
}
public CustomBoxTypeDocument createCustomBoxType(CustomBoxTypeDocument customboxtype ){
IDHolder idh = _getIdHolder(ID_HOLDER_CUSTOMBOXTYPE);
int id = idh.getNextIdInt();
customboxtype.renameTo(""+id);
putDocument(idh);
DocumentList entries = _getCustomBoxTypes();
customboxtype.setLastUpdateNow();
customboxtype.setCallContextAuthor();
entries.addDocument(customboxtype);
_updateCustomBoxTypes(entries);
return customboxtype;
}
public CustomBoxTypeDocument importCustomBoxType(CustomBoxTypeDocument customboxtype ){
IDHolder idh = _getIdHolder(ID_HOLDER_CUSTOMBOXTYPE);
idh.adjustTill(customboxtype.getId());
putDocument(idh);
DocumentList entries = _getCustomBoxTypes();
customboxtype.setLastUpdateNow();
customboxtype.setCallContextAuthor();
entries.addDocument(customboxtype);
_updateCustomBoxTypes(entries);
return customboxtype;
}
@SuppressWarnings("unchecked")
private DocumentList _getCustomBoxHandlerDefs(){
try{
return getList(LIST_CUSTOMBOXHANDLERDEF);
}catch(NoSuchDocumentListException e){
return new DocumentList(LIST_CUSTOMBOXHANDLERDEF);
}
}
private void _updateCustomBoxHandlerDefs(DocumentList list){
putList(list);
}
public List getCustomBoxHandlerDefs(){
return _getCustomBoxHandlerDefs().getList();
}
public CustomBoxHandlerDefDocument getCustomBoxHandlerDef(String id){
return _getCustomBoxHandlerDefs().getDocumentById(id);
}
public void updateCustomBoxHandlerDef(CustomBoxHandlerDefDocument customboxhandlerdef){
DocumentList customboxhandlerdefs = _getCustomBoxHandlerDefs();
customboxhandlerdefs.removeDocumentById(customboxhandlerdef.getId());
customboxhandlerdef.setLastUpdateNow();
customboxhandlerdef.setCallContextAuthor();
customboxhandlerdefs.addDocument(customboxhandlerdef);
_updateCustomBoxHandlerDefs(customboxhandlerdefs);
}
public void deleteCustomBoxHandlerDef(String id){
DocumentList entries = _getCustomBoxHandlerDefs();
entries.removeDocumentById(id);
_updateCustomBoxHandlerDefs(entries);
}
public CustomBoxHandlerDefDocument createCustomBoxHandlerDef(CustomBoxHandlerDefDocument customboxhandlerdef ){
IDHolder idh = _getIdHolder(ID_HOLDER_CUSTOMBOXHANDLERDEF);
int id = idh.getNextIdInt();
customboxhandlerdef.renameTo(""+id);
putDocument(idh);
DocumentList entries = _getCustomBoxHandlerDefs();
customboxhandlerdef.setLastUpdateNow();
customboxhandlerdef.setCallContextAuthor();
entries.addDocument(customboxhandlerdef);
_updateCustomBoxHandlerDefs(entries);
return customboxhandlerdef;
}
public CustomBoxHandlerDefDocument importCustomBoxHandlerDef(CustomBoxHandlerDefDocument customboxhandlerdef ){
IDHolder idh = _getIdHolder(ID_HOLDER_CUSTOMBOXHANDLERDEF);
idh.adjustTill(customboxhandlerdef.getId());
putDocument(idh);
DocumentList entries = _getCustomBoxHandlerDefs();
customboxhandlerdef.setLastUpdateNow();
customboxhandlerdef.setCallContextAuthor();
entries.addDocument(customboxhandlerdef);
_updateCustomBoxHandlerDefs(entries);
return customboxhandlerdef;
}
@SuppressWarnings("unchecked")
private DocumentList _getCustomGuardDefs(){
try{
return getList(LIST_CUSTOMGUARDDEF);
}catch(NoSuchDocumentListException e){
return new DocumentList(LIST_CUSTOMGUARDDEF);
}
}
private void _updateCustomGuardDefs(DocumentList list){
putList(list);
}
public List getCustomGuardDefs(){
return _getCustomGuardDefs().getList();
}
public CustomGuardDefDocument getCustomGuardDef(String id){
return _getCustomGuardDefs().getDocumentById(id);
}
public void updateCustomGuardDef(CustomGuardDefDocument customguarddef){
DocumentList customguarddefs = _getCustomGuardDefs();
customguarddefs.removeDocumentById(customguarddef.getId());
customguarddef.setLastUpdateNow();
customguarddef.setCallContextAuthor();
customguarddefs.addDocument(customguarddef);
_updateCustomGuardDefs(customguarddefs);
}
public void deleteCustomGuardDef(String id){
DocumentList entries = _getCustomGuardDefs();
entries.removeDocumentById(id);
_updateCustomGuardDefs(entries);
}
public CustomGuardDefDocument createCustomGuardDef(CustomGuardDefDocument customguarddef ){
IDHolder idh = _getIdHolder(ID_HOLDER_CUSTOMGUARDDEF);
int id = idh.getNextIdInt();
customguarddef.renameTo(""+id);
putDocument(idh);
DocumentList entries = _getCustomGuardDefs();
customguarddef.setLastUpdateNow();
customguarddef.setCallContextAuthor();
entries.addDocument(customguarddef);
_updateCustomGuardDefs(entries);
return customguarddef;
}
public CustomGuardDefDocument importCustomGuardDef(CustomGuardDefDocument customguarddef ){
IDHolder idh = _getIdHolder(ID_HOLDER_CUSTOMGUARDDEF);
idh.adjustTill(customguarddef.getId());
putDocument(idh);
DocumentList entries = _getCustomGuardDefs();
customguarddef.setLastUpdateNow();
customguarddef.setCallContextAuthor();
entries.addDocument(customguarddef);
_updateCustomGuardDefs(entries);
return customguarddef;
}
}