Package it.eng.spagobi.engines.qbe.crosstable

Examples of it.eng.spagobi.engines.qbe.crosstable.CrosstabDefinition$Measure


    Mdiv mdiv = new Mdiv();
    Score score = new Score();
    ScoreDef scoreDef = createScoreDef(stavesCount);
    score.getGapsAndSbsAndCorrs().add(scoreDef);
    Section section = new Section();
    Measure measureFirst = new Measure();
    Staff staffFirst = new Staff();
    Layer layerFirst = new Layer();
    staffFirst.getSbsAndSymbolsAndOrigs().add(layerFirst);
    measureFirst.getAnnotsAndSlursAndTupletSpen().add(staffFirst);
    for (int stavesIter = 1; stavesIter < stavesCount; stavesIter++) {
      Staff staff = new Staff();
      Layer layer = new Layer();
      staff.getSbsAndSymbolsAndOrigs().add(layer);
      measureFirst.getAnnotsAndSlursAndTupletSpen().add(staff);
    }
    section.getUnclearsAndSbsAndApps().add(measureFirst);

    for (int measureIter = 1; measureIter < measureCount; measureIter++) {
      Measure measure = new Measure();
      for (int stavesIter = 0; stavesIter < stavesCount; stavesIter++) {
        Staff staff = new Staff();
        Layer layer = new Layer();
        staff.getSbsAndSymbolsAndOrigs().add(layer);
        measure.getAnnotsAndSlursAndTupletSpen().add(staff);
      }
      section.getUnclearsAndSbsAndApps().add(measure);
    }
    score.getGapsAndSbsAndCorrs().add(section);
    mdiv.setScore(score);
View Full Code Here


  /**
   * create default measure
   */
  private void createDefaultMeasure() {
    setMeiNode(new Measure());
  }
View Full Code Here

            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof MeasureForm) {
      MeasureForm measureForm = (MeasureForm) childForm;
      Measure measureNode = (Measure) measureForm.getMeiNode();
      measureNode.getAnnotsAndSlursAndTupletSpen().clear();
      for (BasicElement measureChildForm : measureForm.getChildren()) {
        measureNode.getAnnotsAndSlursAndTupletSpen().add(
            handleScoreChild(measureChildForm, saveAllVariants));
      }
      return measureNode;
    } else if (childForm instanceof StaffForm) {
      StaffForm contentForm = (StaffForm) childForm;
View Full Code Here

       
    JSONObject jsonFormState=null;
   
    Integer maxSize = null;
    Integer resultNumber = null;
    CrosstabDefinition crosstabDefinition = null;
   
    Monitor totalTimeMonitor = null;
    Monitor errorHitsMonitor = null;
         
    logger.debug("IN");
   
    try {
   
      super.service(request, response)
     
      totalTimeMonitor = MonitorFactory.start("QbeEngine.executeCrosstabQueryAction.totalTime");
     
      JSONObject crosstabDefinitionJSON = getAttributeAsJSONObject( QbeEngineStaticVariables.CROSSTAB_DEFINITION );
      jsonFormState = loadSmartFilterFormValues();
      logger.debug("Form state retrieved as a string: " + jsonFormState);
     
      Assert.assertNotNull(crosstabDefinitionJSON, "Parameter [" + QbeEngineStaticVariables.CROSSTAB_DEFINITION + "] cannot be null in oder to execute " + this.getActionName() + " service");
      logger.debug("Parameter [" + crosstabDefinitionJSON + "] is equals to [" + crosstabDefinitionJSON.toString() + "]");
      //crosstabDefinition = SerializerFactory.getDeserializer("application/json").deserializeCrosstabDefinition(crosstabDefinitionJSON);;
      crosstabDefinition = (CrosstabDefinition)SerializationManager.deserialize(crosstabDefinitionJSON, "application/json", CrosstabDefinition.class);
      crosstabDefinition.setCellLimit( new Integer((String)ConfigSingleton.getInstance().getAttribute("QBE.QBE-CROSSTAB-CELLS-LIMIT.value")) );
      maxSize = QbeEngineConfig.getInstance().getResultLimit();     
      logger.debug("Configuration setting  [" + "QBE.QBE-SQL-RESULT-LIMIT.value" + "] is equals to [" + (maxSize != null? maxSize: "none") + "]");
     
      Assert.assertNotNull(getEngineInstance(), "It's not possible to execute " + this.getActionName() + " service before having properly created an instance of EngineInstance class");
     
View Full Code Here

    public static transient Logger logger = Logger.getLogger(CrosstabJSONSerializer.class);
   
   
  public Object serialize(Object o) throws SerializationException {
    JSONObject toReturn = null;
    CrosstabDefinition crosstabDefinition;
       
    Assert.assertNotNull(o, "Input parameter cannot be null");
    Assert.assertTrue(o instanceof CrosstabDefinition, "Unable to serialize objects of type [" + o.getClass().getName() + "]");
   
    try {
      toReturn = new JSONObject();
     
      crosstabDefinition = (CrosstabDefinition)o;
     
      // config (measures on rows/columns, totals/subototals on rows/columns)
      JSONObject config = crosstabDefinition.getConfig();
      toReturn.put(CrosstabSerializationConstants.CONFIG, config);
     
      // calculated fields definition
      JSONArray calculatedFields = crosstabDefinition.getCalculatedFields();
      toReturn.put(CrosstabSerializationConstants.CALCULATED_FIELDS, calculatedFields);
     
      // rows
      JSONArray rows = this.serializeRows(crosstabDefinition);
      toReturn.put(CrosstabSerializationConstants.ROWS, rows);
View Full Code Here

public class CrosstabJSONDeserializer implements IDeserializer {

    public static transient Logger logger = Logger.getLogger(CrosstabJSONDeserializer.class);
   
  public CrosstabDefinition deserialize(Object o) throws SerializationException {
    CrosstabDefinition crosstabDefinition = null;
    JSONObject crosstabDefinitionJSON = 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 {
          crosstabDefinitionJSON = 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) {
        crosstabDefinitionJSON = (JSONObject)o;
      } else {
        Assert.assertUnreachable("Object to be deserialized must be of type string or of type JSONObject, not of type [" + o.getClass().getName() + "]");
      }
     
      crosstabDefinition  = new CrosstabDefinition();
     
      try {
        deserializeRows(crosstabDefinitionJSON, crosstabDefinition);
        deserializeColumns(crosstabDefinitionJSON, crosstabDefinition);
        deserializeMeasures(crosstabDefinitionJSON, crosstabDefinition);
       
        // config (measures on rows/columns, totals/subototals on rows/columns) remains a JSONObject
        JSONObject config = crosstabDefinitionJSON.optJSONObject(CrosstabSerializationConstants.CONFIG);
        crosstabDefinition.setConfig(config);
       
        JSONArray calculatedFields = crosstabDefinitionJSON.optJSONArray(CrosstabSerializationConstants.CALCULATED_FIELDS);
        crosstabDefinition.setCalculatedFields(calculatedFields);
       
      } catch (Exception e) {
        throw new SerializationException("An error occurred while deserializing query: " + crosstabDefinitionJSON.toString(), e);
      }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.engines.qbe.crosstable.CrosstabDefinition$Measure

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.