All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.anosite.gen.aslayoutdata.data.ModuleASLayoutData Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
/**
 ********************************************************************************
 *** ModuleASLayoutData.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.aslayoutdata.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 ModuleASLayoutData extends Module{


	public static final String MODULE_ID = "aslayoutdata";

	public static final String LIST_PAGESTYLE = "list_pagestyle";
	public static final String ID_HOLDER_PAGESTYLE = IDHolder.DOC_ID_HOLDER_PRE+"pagestyle";
	public static final String LIST_PAGELAYOUT = "list_pagelayout";
	public static final String ID_HOLDER_PAGELAYOUT = IDHolder.DOC_ID_HOLDER_PRE+"pagelayout";

	public ModuleASLayoutData(){
		super(MODULE_ID);
	}

	@SuppressWarnings("unchecked")
	private DocumentList _getPageStyles(){
		try{
			return getList(LIST_PAGESTYLE);
		}catch(NoSuchDocumentListException e){
			return new DocumentList(LIST_PAGESTYLE);
		}
	}

	private void _updatePageStyles(DocumentList list){
		putList(list);
	}

	public List getPageStyles(){
		return _getPageStyles().getList();
	}

	public PageStyleDocument getPageStyle(String id){
		return _getPageStyles().getDocumentById(id);
	}

	public void updatePageStyle(PageStyleDocument pagestyle){
		DocumentList pagestyles = _getPageStyles();
		pagestyles.removeDocumentById(pagestyle.getId());
		pagestyle.setLastUpdateNow();
		pagestyle.setCallContextAuthor();
		pagestyles.addDocument(pagestyle);
		_updatePageStyles(pagestyles);
	}

	public void deletePageStyle(String id){
		DocumentList entries = _getPageStyles();
		entries.removeDocumentById(id);
		_updatePageStyles(entries);
	}

	public PageStyleDocument createPageStyle(PageStyleDocument pagestyle ){
		IDHolder idh = _getIdHolder(ID_HOLDER_PAGESTYLE);
		int id = idh.getNextIdInt();
		pagestyle.renameTo(""+id);
		putDocument(idh);

		DocumentList entries = _getPageStyles();
		pagestyle.setLastUpdateNow();
		pagestyle.setCallContextAuthor();
		entries.addDocument(pagestyle);
		_updatePageStyles(entries);
		return pagestyle;
	}

	public PageStyleDocument importPageStyle(PageStyleDocument pagestyle ){
		IDHolder idh = _getIdHolder(ID_HOLDER_PAGESTYLE);
		idh.adjustTill(pagestyle.getId());
		putDocument(idh);

		DocumentList entries = _getPageStyles();
		pagestyle.setLastUpdateNow();
		pagestyle.setCallContextAuthor();
		entries.addDocument(pagestyle);
		_updatePageStyles(entries);
		return pagestyle;
	}


	@SuppressWarnings("unchecked")
	private DocumentList _getPageLayouts(){
		try{
			return getList(LIST_PAGELAYOUT);
		}catch(NoSuchDocumentListException e){
			return new DocumentList(LIST_PAGELAYOUT);
		}
	}

	private void _updatePageLayouts(DocumentList list){
		putList(list);
	}

	public List getPageLayouts(){
		return _getPageLayouts().getList();
	}

	public PageLayoutDocument getPageLayout(String id){
		return _getPageLayouts().getDocumentById(id);
	}

	public void updatePageLayout(PageLayoutDocument pagelayout){
		DocumentList pagelayouts = _getPageLayouts();
		pagelayouts.removeDocumentById(pagelayout.getId());
		pagelayout.setLastUpdateNow();
		pagelayout.setCallContextAuthor();
		pagelayouts.addDocument(pagelayout);
		_updatePageLayouts(pagelayouts);
	}

	public void deletePageLayout(String id){
		DocumentList entries = _getPageLayouts();
		entries.removeDocumentById(id);
		_updatePageLayouts(entries);
	}

	public PageLayoutDocument createPageLayout(PageLayoutDocument pagelayout ){
		IDHolder idh = _getIdHolder(ID_HOLDER_PAGELAYOUT);
		int id = idh.getNextIdInt();
		pagelayout.renameTo(""+id);
		putDocument(idh);

		DocumentList entries = _getPageLayouts();
		pagelayout.setLastUpdateNow();
		pagelayout.setCallContextAuthor();
		entries.addDocument(pagelayout);
		_updatePageLayouts(entries);
		return pagelayout;
	}

	public PageLayoutDocument importPageLayout(PageLayoutDocument pagelayout ){
		IDHolder idh = _getIdHolder(ID_HOLDER_PAGELAYOUT);
		idh.adjustTill(pagelayout.getId());
		putDocument(idh);

		DocumentList entries = _getPageLayouts();
		pagelayout.setLastUpdateNow();
		pagelayout.setCallContextAuthor();
		entries.addDocument(pagelayout);
		_updatePageLayouts(entries);
		return pagelayout;
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy