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

com.agiletec.apsadmin.system.entity.AbstractApsEntityAction Maven / Gradle / Ivy

Go to download

Entando Administration Console: an agile, modern and user-centric open source Portal platform.

There is a newer version: 6.2.38
Show newest version
/*
 * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
package com.agiletec.apsadmin.system.entity;

import com.agiletec.aps.system.common.entity.model.IApsEntity;
import com.agiletec.aps.system.services.baseconfig.ConfigInterface;
import com.agiletec.aps.system.services.lang.Lang;
import com.agiletec.apsadmin.system.BaseAction;

/**
 * Abstract action for ApsEntity management.
 * @author E.Santoboni
 */
public abstract class AbstractApsEntityAction extends BaseAction implements IApsEntityAction {
	
	@Override
	public void validate() {
		super.validate();
		this.getEntityActionHelper().updateEntity(this.getApsEntity(), this.getRequest());
		this.getEntityActionHelper().scanEntity(this.getApsEntity(), this);
	}
	
	/**
	 * Return the entity on edit.
	 * @return The current entity on edit.
	 */
	public abstract IApsEntity getApsEntity();
	
	/**
	 * Return the default system lang.
	 * @return The default lang.
	 */
	public Lang getDefaultLang() {
		return this.getLangManager().getDefaultLang();
	}
	
	/**
	 * Return the code of current html editor, set on system config user interface.
	 * @return The code of current html editor.
	 */
	public String getHtmlEditorCode() {
		return this.getConfigManager().getParam("hypertextEditor");
	}
	
	protected IEntityActionHelper getEntityActionHelper() {
		return _entityActionHelper;
	}
	public void setEntityActionHelper(IEntityActionHelper entityActionHelper) {
		this._entityActionHelper = entityActionHelper;
	}
	
	protected ConfigInterface getConfigManager() {
		return _configManager;
	}
	public void setConfigManager(ConfigInterface configManager) {
		this._configManager = configManager;
	}
	
	public String getEntityId() {
		return _entityId;
	}
	public void setEntityId(String entityId) {
		this._entityId = entityId;
	}
	
	private IEntityActionHelper _entityActionHelper;
	
	private ConfigInterface _configManager;
	
	private String _entityId;
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy