Search in sources :

Example 1 with VersionInfo

use of org.locationtech.geogig.api.porcelain.VersionInfo in project GeoGig by boundlessgeo.

the class VersionWebOp method run.

/**
     * Runs the command and builds the appropriate response.
     * 
     * @param context - the context to use for this command
     */
@Override
public void run(CommandContext context) {
    final Context geogig = this.getCommandLocator(context);
    final VersionInfo info = geogig.command(VersionOp.class).call();
    context.setResponseContent(new CommandResponse() {

        @Override
        public void write(ResponseWriter out) throws Exception {
            out.start();
            out.writeElement("ProjectVersion", info.getProjectVersion());
            out.writeElement("BuildTime", info.getBuildTime());
            out.writeElement("BuildUserName", info.getBuildUserName());
            out.writeElement("BuildUserEmail", info.getBuildUserEmail());
            out.writeElement("GitBranch", info.getBranch());
            out.writeElement("GitCommitID", info.getCommitId());
            out.writeElement("GitCommitTime", info.getCommitTime());
            out.writeElement("GitCommitAuthorName", info.getCommitUserName());
            out.writeElement("GitCommitAuthorEmail", info.getCommitUserEmail());
            out.writeElement("GitCommitMessage", info.getCommitMessageFull());
            out.finish();
        }
    });
}
Also used : Context(org.locationtech.geogig.api.Context) CommandContext(org.locationtech.geogig.web.api.CommandContext) VersionInfo(org.locationtech.geogig.api.porcelain.VersionInfo) ResponseWriter(org.locationtech.geogig.web.api.ResponseWriter) VersionOp(org.locationtech.geogig.api.porcelain.VersionOp) CommandResponse(org.locationtech.geogig.web.api.CommandResponse)

Example 2 with VersionInfo

use of org.locationtech.geogig.api.porcelain.VersionInfo in project GeoGig by boundlessgeo.

the class Version method run.

/**
     * Executes the version command.
     * 
     * @param cli
     * @see org.locationtech.geogig.cli.CLICommand#run(org.locationtech.geogig.cli.GeogigCLI)
     */
public void run(GeogigCLI cli) {
    GeoGIG geogig = cli.getGeogig();
    if (geogig == null) {
        geogig = new GeoGIG();
    }
    this.console = cli.getConsole();
    VersionInfo info = geogig.command(VersionOp.class).call();
    try {
        printVersionProperty("Project Version", info.getProjectVersion());
        printVersionProperty("Build Time", info.getBuildTime());
        printVersionProperty("Build User Name", info.getBuildUserName());
        printVersionProperty("Build User Email", info.getBuildUserEmail());
        printVersionProperty("Git Branch", info.getBranch());
        printVersionProperty("Git Commit ID", info.getCommitId());
        printVersionProperty("Git Commit Time", info.getCommitTime());
        printVersionProperty("Git Commit Author Name", info.getCommitUserName());
        printVersionProperty("Git Commit Author Email", info.getCommitUserEmail());
        printVersionProperty("Git Commit Message", info.getCommitMessageFull());
    } catch (IOException e) {
        Throwables.propagate(e);
    }
}
Also used : VersionInfo(org.locationtech.geogig.api.porcelain.VersionInfo) VersionOp(org.locationtech.geogig.api.porcelain.VersionOp) IOException(java.io.IOException) GeoGIG(org.locationtech.geogig.api.GeoGIG)

Aggregations

VersionInfo (org.locationtech.geogig.api.porcelain.VersionInfo)2 VersionOp (org.locationtech.geogig.api.porcelain.VersionOp)2 IOException (java.io.IOException)1 Context (org.locationtech.geogig.api.Context)1 GeoGIG (org.locationtech.geogig.api.GeoGIG)1 CommandContext (org.locationtech.geogig.web.api.CommandContext)1 CommandResponse (org.locationtech.geogig.web.api.CommandResponse)1 ResponseWriter (org.locationtech.geogig.web.api.ResponseWriter)1