Package it.eng.spagobi.engines.qbe.worksheet

Examples of it.eng.spagobi.engines.qbe.worksheet.WorkSheetDefinition


      JSONObject workSheetDefinitionJSON = getAttributeAsJSONObject(QbeEngineStaticVariables.WORKSHEET_DEFINITION_LOWER );
      Assert.assertNotNull(workSheetDefinitionJSON, "Parameter [" + QbeEngineStaticVariables.WORKSHEET_DEFINITION_LOWER + "] cannot be null in oder to execute " + this.getActionName() + " service");
      logger.debug("Parameter [" + workSheetDefinitionJSON + "] is equals to [" + workSheetDefinitionJSON.toString() + "]");

      //set the worksheet into the qbe instance
      WorkSheetDefinition workSheetDefinition = (WorkSheetDefinition)SerializationManager.deserialize(workSheetDefinitionJSON, "application/json", WorkSheetDefinition.class);
      List<WorkSheet> ws = workSheetDefinition.getWorkSheet();
      for(int i=0; i<ws.size();i++){
        WorksheetEngineStartAction.setImageWidth((ws.get(i)).getHeader());
        WorksheetEngineStartAction.setImageWidth((ws.get(i)).getFooter());
      }
     
View Full Code Here


public class WorkSheetJSONDeserializer implements IDeserializer {

    public static transient Logger logger = Logger.getLogger(WorkSheetJSONDeserializer.class);
   
  public WorkSheetDefinition deserialize(Object o) throws SerializationException {
    WorkSheetDefinition workSheetDefinition = null;
    JSONObject workSheetDefinitionJSON = null;
   
    logger.debug("IN");
   
    try {
      Assert.assertNotNull(o, "Object to be deserialized cannot be null");
     
      if(o instanceof String) {
        logger.debug("Deserializing string [" + (String)o + "]");
        try {
          workSheetDefinitionJSON = new JSONObject( (String)o );
        } catch(Throwable t) {
          logger.debug("Object to be deserialized must be string encoding a JSON object");
          throw new SerializationException("An error occurred while deserializing query: " + (String)o, t);
        }
      } else if(o instanceof JSONObject) {
        workSheetDefinitionJSON = (JSONObject)o;
      } else {
        Assert.assertUnreachable("Object to be deserialized must be of type string or of type JSONObject, not of type [" + o.getClass().getName() + "]");
      }
     
      workSheetDefinition  = new WorkSheetDefinition();
     
      try {
        deserializeSheets(workSheetDefinitionJSON, workSheetDefinition);
      } catch (Exception e) {
        throw new SerializationException("An error occurred while deserializing worksheet: " + workSheetDefinitionJSON.toString(), e);
View Full Code Here

   
    logger.debug("IN");
    logger.debug("Serializing the worksheet");
   
    JSONObject toReturn = null;
    WorkSheetDefinition workSheetDefinition;
       
    Assert.assertNotNull(o, "Input parameter cannot be null");
    Assert.assertTrue(o instanceof WorkSheetDefinition, "Unable to serialize objects of type [" + o.getClass().getName() + "]");
   
    try {
      toReturn = new JSONObject();
     
      workSheetDefinition = (WorkSheetDefinition)o;
     
      JSONArray sheets = serializeSheets(workSheetDefinition.getWorkSheet());
      toReturn.put(WorkSheetSerializationCostants.SHEETS, sheets);
    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + o, t);
    } finally {
      logger.debug("OUT");
View Full Code Here

    logger.debug("OUT");
  }
 
  private void loadWorksheetDefinition(JSONObject worksheetDefinition) {
    try {
      WorkSheetDefinition workSheetDefinition = new WorkSheetDefinition();
      // TODO set the encoding
      workSheetDefinition.load( worksheetDefinition.toString().getBytes() );
      setWorkSheetDefinition(workSheetDefinition);
    } catch(Throwable t) {
      SpagoBIRuntimeException serviceException;
      String msg = "Impossible load worksheet definition [" + worksheetDefinition + "].";
      Throwable rootException = t;
View Full Code Here

    setProperty( QbeEngineStaticVariables.WORKSHEET_DEFINITION, workSheetDefinitionJSON );
  }
 

  public WorkSheetDefinition getWorkSheetDefinition() {
    WorkSheetDefinition workSheetDefinition;
    JSONObject workSheetDefinitionJSON;
   
    workSheetDefinitionJSON = (JSONObject)getProperty( QbeEngineStaticVariables.WORKSHEET_DEFINITION );
   
    if(workSheetDefinitionJSON==null){
View Full Code Here

TOP

Related Classes of it.eng.spagobi.engines.qbe.worksheet.WorkSheetDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.