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

org.labkey.remoteapi.domain.AbstractDomainUpdateCommand Maven / Gradle / Ivy

Go to download

The client-side library for Java developers is a separate JAR from the LabKey Server code base. It can be used by any Java program, including another Java web application.

There is a newer version: 6.2.0
Show newest version
package org.labkey.remoteapi.domain;

import org.json.JSONObject;
import org.labkey.remoteapi.PostCommand;

/**
 * Base class for shared functionality of {@link SaveDomainCommand} and {@link CreateDomainCommand}
 */
abstract class AbstractDomainUpdateCommand extends PostCommand
{
    private Domain _design = new Domain();

    AbstractDomainUpdateCommand(String controllerName, String actionName)
    {
        super(controllerName, actionName);
    }

    @Override
    protected DomainResponse createResponse(String text, int status, String contentType, JSONObject json)
    {
        return new DomainResponse(text, status, contentType, json);
    }

    @Override
    public JSONObject getJsonObject()
    {
        JSONObject result = new JSONObject();
        result.put("domainDesign", _design.toJSONObject());

        return result;
    }

    /**
     * Get the domain design that will be POSTed by this command. The design is mutable.
     * @return reference to the domain design
     */
    public Domain getDomainDesign()
    {
        return _design;
    }

    /**
     * Set the domain design that will be POSTed by this command.
     * @param design domain design to be used by this command.
     */
    public void setDomainDesign(Domain design)
    {
        _design = design;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy