
com.flowcentraltech.flowcentral.studio.web.controllers.StudioAppTableAppletController Maven / Gradle / Ivy
/*
* Copyright 2021-2023 FlowCentral Technologies Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.flowcentraltech.flowcentral.studio.web.controllers;
import com.flowcentraltech.flowcentral.application.data.EntityFormEventHandlers;
import com.flowcentraltech.flowcentral.application.web.controllers.AbstractEntityFormAppletController;
import com.flowcentraltech.flowcentral.application.web.controllers.AppletWidgetReferences;
import com.flowcentraltech.flowcentral.studio.business.StudioModuleService;
import com.flowcentraltech.flowcentral.studio.constants.StudioSessionAttributeConstants;
import com.flowcentraltech.flowcentral.studio.web.panels.applet.StudioAppTableApplet;
import com.tcdng.unify.core.UnifyException;
import com.tcdng.unify.core.annotation.Component;
import com.tcdng.unify.core.annotation.Configurable;
import com.tcdng.unify.core.annotation.UplBinding;
import com.tcdng.unify.web.annotation.Action;
import com.tcdng.unify.web.constant.ReadOnly;
import com.tcdng.unify.web.constant.ResetOnWrite;
import com.tcdng.unify.web.constant.Secured;
/**
* Studio application table applet controller.
*
* @author FlowCentral Technologies Limited
* @since 1.0
*/
@Component("/studioapptableapplet")
@UplBinding("web/studio/upl/studioapptableappletpage.upl")
public class StudioAppTableAppletController
extends AbstractEntityFormAppletController {
@Configurable
private StudioModuleService studioModuleService;
public StudioAppTableAppletController() {
super(StudioAppTableAppletPageBean.class, Secured.TRUE, ReadOnly.FALSE, ResetOnWrite.FALSE);
}
public void setStudioModuleService(StudioModuleService studioModuleService) {
this.studioModuleService = studioModuleService;
}
@Action
public String designChildItem() throws UnifyException {
StudioAppTableAppletPageBean pageBean = getPageBean();
StudioAppTableApplet applet = pageBean.getApplet();
int childTabIndex = getRequestTarget(int.class);
applet.designChildItem(childTabIndex);
return "refreshapplet";
}
@Override
protected void onOpenPage() throws UnifyException {
super.onOpenPage();
StudioAppTableAppletPageBean pageBean = getPageBean();
if (pageBean.getApplet() == null) {
AppletWidgetReferences appletWidgetReferences = getAppletWidgetReferences();
EntityFormEventHandlers formEventHandlers = getEntityFormEventHandlers();
StudioAppTableApplet applet = new StudioAppTableApplet(studioModuleService, au(), getPathVariable(),
(String) getSessionAttribute(StudioSessionAttributeConstants.CURRENT_APPLICATION_NAME),
appletWidgetReferences, formEventHandlers);
pageBean.setApplet(applet);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy