Example usage for org.jfree.util Log info

List of usage examples for org.jfree.util Log info

Introduction

In this page you can find the example usage for org.jfree.util Log info.

Prototype

public static void info(final Object message) 

Source Link

Document

A convenience method for logging an 'info' message.

Usage

From source file:org.pentaho.di.core.refinery.publish.agilebi.ModelServerPublish.java

/**
 * Jersey call to use the put service to load a mondrain file into the Jcr repsoitory
 *
 * @param mondrianFile//from   w  ww. ja va  2  s  . c  om
 * @param catalogName
 * @param datasourceInfo
 * @param overwriteInRepos
 * @throws Exception
 */
public int publishMondrianSchema(InputStream mondrianFile, String catalogName, String datasourceInfo,
        boolean overwriteInRepos) throws Exception {
    String storeDomainUrl = biServerConnection.getUrl() + MONDRIAN_POST_ANALYSIS_URL;
    WebResource resource = getClient().resource(storeDomainUrl);
    String parms = "Datasource=" + datasourceInfo + ";retainInlineAnnotations=true";
    int response = PUBLISH_FAILED;
    FormDataMultiPart part = new FormDataMultiPart();
    part.field("parameters", parms, MediaType.MULTIPART_FORM_DATA_TYPE)
            .field("uploadAnalysis", mondrianFile, MediaType.MULTIPART_FORM_DATA_TYPE)
            .field("catalogName", catalogName, MediaType.MULTIPART_FORM_DATA_TYPE)
            .field("overwrite", overwriteInRepos ? "true" : "false", MediaType.MULTIPART_FORM_DATA_TYPE)
            .field("xmlaEnabledFlag", "true", MediaType.MULTIPART_FORM_DATA_TYPE);

    addAclToRequest(part);

    // If the import service needs the file name do the following.
    part.getField("uploadAnalysis").setContentDisposition(
            FormDataContentDisposition.name("uploadAnalysis").fileName(catalogName).build());
    try {
        Builder builder = resourceBuilder(resource, part);
        ClientResponse resp = httpPost(builder);
        String entity = null;
        if (resp != null && resp.getStatus() == 200) {
            entity = resp.getEntity(String.class);
            if (entity.equals(String.valueOf(PUBLISH_CATALOG_EXISTS))) {
                response = PUBLISH_CATALOG_EXISTS;
            } else {
                response = Integer.parseInt(entity);
            }
        } else {
            Log.info(resp);
        }
    } catch (Exception ex) {
        Log.error(ex.getMessage());
    }
    return response;
}