Search in sources :

Example 21 with GuiFragment

use of org.entando.entando.aps.system.services.guifragment.GuiFragment in project entando-core by entando.

the class GuiFragmentAction method save.

public String save() {
    try {
        int strutsAction = this.getStrutsAction();
        GuiFragment guiFragment = this.createGuiFragment();
        if (ApsAdminSystemConstants.ADD == strutsAction) {
            this.getGuiFragmentManager().addGuiFragment(guiFragment);
        } else if (ApsAdminSystemConstants.EDIT == strutsAction) {
            this.getGuiFragmentManager().updateGuiFragment(guiFragment);
        }
    } catch (Throwable t) {
        _logger.error("error in save", t);
        return FAILURE;
    }
    return SUCCESS;
}
Also used : GuiFragment(org.entando.entando.aps.system.services.guifragment.GuiFragment)

Example 22 with GuiFragment

use of org.entando.entando.aps.system.services.guifragment.GuiFragment in project entando-core by entando.

the class GuiFragmentAction method edit.

public String edit() {
    try {
        GuiFragment guiFragment = this.getGuiFragmentManager().getGuiFragment(this.getCode());
        if (null == guiFragment) {
            this.addActionError(this.getText("error.guiFragment.null"));
            return INPUT;
        }
        this.populateForm(guiFragment);
        this.setStrutsAction(ApsAdminSystemConstants.EDIT);
    } catch (Throwable t) {
        _logger.error("error in edit", t);
        return FAILURE;
    }
    return SUCCESS;
}
Also used : GuiFragment(org.entando.entando.aps.system.services.guifragment.GuiFragment)

Example 23 with GuiFragment

use of org.entando.entando.aps.system.services.guifragment.GuiFragment in project entando-core by entando.

the class GuiFragmentAction method showDetail.

public String showDetail() {
    try {
        if (null == this.getCode()) {
            this.addActionError(this.getText("error.guiFragment.null"));
            return "guiFragmentsList";
        }
        GuiFragment guiFragment = this.getGuiFragmentManager().getGuiFragment(this.getCode());
        if (null == guiFragment) {
            this.addActionError(this.getText("error.guiFragment.null"));
            return "guiFragmentsList";
        }
        this.populateForm(guiFragment);
        this.extractReferencingObjects(this.getCode());
    } catch (Throwable t) {
        _logger.error("error in showDetail", t);
        return FAILURE;
    }
    return SUCCESS;
}
Also used : GuiFragment(org.entando.entando.aps.system.services.guifragment.GuiFragment)

Example 24 with GuiFragment

use of org.entando.entando.aps.system.services.guifragment.GuiFragment in project entando-core by entando.

the class GuiFragmentAction method createGuiFragment.

private GuiFragment createGuiFragment() throws Throwable {
    GuiFragment guiFragment = null;
    int strutsAction = this.getStrutsAction();
    if (ApsAdminSystemConstants.ADD == strutsAction) {
        guiFragment = new GuiFragment();
        guiFragment.setCode(this.getCode());
    } else {
        guiFragment = this.getGuiFragmentManager().getGuiFragment(this.getCode());
    }
    // GuiFragment guiFragment = new GuiFragment();
    // guiFragment.setWidgetTypeCode(this.getWidgetTypeCode());
    // guiFragment.setPluginCode(this.getPluginCode());
    guiFragment.setGui(this.getGui());
    return guiFragment;
}
Also used : GuiFragment(org.entando.entando.aps.system.services.guifragment.GuiFragment)

Example 25 with GuiFragment

use of org.entando.entando.aps.system.services.guifragment.GuiFragment in project entando-core by entando.

the class JAXBGuiFragment method getGuiFragment.

@XmlTransient
public GuiFragment getGuiFragment() {
    GuiFragment guiFragment = new GuiFragment();
    guiFragment.setCode(this.getCode());
    guiFragment.setWidgetTypeCode(this.getWidgetTypeCode());
    guiFragment.setPluginCode(this.getPluginCode());
    guiFragment.setGui(this.getGui());
    guiFragment.setDefaultGui(this.getDefaultGui());
    guiFragment.setLocked(this.isLocked());
    return guiFragment;
}
Also used : GuiFragment(org.entando.entando.aps.system.services.guifragment.GuiFragment) XmlTransient(javax.xml.bind.annotation.XmlTransient)

Aggregations

GuiFragment (org.entando.entando.aps.system.services.guifragment.GuiFragment)41 WidgetType (org.entando.entando.aps.system.services.widgettype.WidgetType)10 ArrayList (java.util.ArrayList)9 ApiException (org.entando.entando.aps.system.services.api.model.ApiException)9 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)6 JAXBGuiFragment (org.entando.entando.aps.system.services.guifragment.api.JAXBGuiFragment)5 ApsProperties (com.agiletec.aps.util.ApsProperties)4 IGuiFragmentManager (org.entando.entando.aps.system.services.guifragment.IGuiFragmentManager)4 List (java.util.List)3 Test (org.junit.Test)3 FieldSearchFilter (com.agiletec.aps.system.common.FieldSearchFilter)2 Template (freemarker.template.Template)2 StringReader (java.io.StringReader)2 Writer (java.io.Writer)2 ExecutorBeanContainer (org.entando.entando.aps.system.services.controller.executor.ExecutorBeanContainer)2 GuiFragmentUtilizer (org.entando.entando.aps.system.services.guifragment.GuiFragmentUtilizer)2 GuiFragmentRequestBody (org.entando.entando.web.guifragment.model.GuiFragmentRequestBody)2 ListableBeanFactory (org.springframework.beans.factory.ListableBeanFactory)2 MapBindingResult (org.springframework.validation.MapBindingResult)2 RequestContext (com.agiletec.aps.system.RequestContext)1