Search in sources :

Example 16 with ApiResource

use of org.entando.entando.aps.system.services.api.model.ApiResource in project entando-core by entando.

the class ApiResourceAction method updateAllMethodStatus.

public String updateAllMethodStatus() {
    try {
        ApiResource resource = this.getApiResource();
        String requiredAuthority = this.getRequest().getParameter("methodAuthority");
        String active = this.getRequest().getParameter("active");
        String hidden = this.getRequest().getParameter("hidden");
        if (null == requiredAuthority) {
            // TODO MANAGE
            return SUCCESS;
        }
        this.updateMethodStatus(resource.getGetMethod(), requiredAuthority, active, hidden);
        this.updateMethodStatus(resource.getPostMethod(), requiredAuthority, active, hidden);
        this.updateMethodStatus(resource.getPutMethod(), requiredAuthority, active, hidden);
        this.updateMethodStatus(resource.getDeleteMethod(), requiredAuthority, active, hidden);
    } catch (Throwable t) {
        _logger.error("Error updating all method status", t);
        // ApsSystemUtils.logThrowable(t, this, "updateAllMethodStatus", "Error updating all method status");
        return FAILURE;
    }
    return SUCCESS;
}
Also used : ApiResource(org.entando.entando.aps.system.services.api.model.ApiResource)

Example 17 with ApiResource

use of org.entando.entando.aps.system.services.api.model.ApiResource in project entando-core by entando.

the class ApiResourceAction method checkMethod.

private String checkMethod() throws Throwable {
    if (null == this.extractMethod()) {
        ApiResource resource = this.getApiResource();
        this.addActionError(this.getText("error.resource.method.invalid", new String[] { resource.getCode(), this.getHttpMethod().toString() }));
    }
    return null;
}
Also used : ApiResource(org.entando.entando.aps.system.services.api.model.ApiResource)

Aggregations

ApiResource (org.entando.entando.aps.system.services.api.model.ApiResource)17 ApiMethod (org.entando.entando.aps.system.services.api.model.ApiMethod)8 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)4 Properties (java.util.Properties)4 InputStream (java.io.InputStream)3 HashMap (java.util.HashMap)3 ApsProperties (com.agiletec.aps.util.ApsProperties)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ArrayList (java.util.ArrayList)2 StringApiResponse (org.entando.entando.aps.system.services.api.model.StringApiResponse)2 JAXBI18nLabel (org.entando.entando.aps.system.services.i18n.model.JAXBI18nLabel)2 JAXBContent (org.entando.entando.plugins.jacms.aps.system.services.api.model.JAXBContent)2 EntitySearchFilter (com.agiletec.aps.system.common.entity.model.EntitySearchFilter)1 AttributeInterface (com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface)1 Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)1 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 Date (java.util.Date)1 List (java.util.List)1