Changeset 7014 in main


Ignore:
Timestamp:
09/29/14 23:23:37 (6 years ago)
Author:
Garth Braithwaite
Message:

view and java - another round of data frame work. Changed result_group_by to ACTUAL_GROUP_BY

Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/ibisph-view/src/main/webapp/xslt/html/Graphic.xslt

    r6992 r7014  
    9090                                        exists(/QUERY_MODULE/REQUEST/SELECTED_GROUP_BY[starts-with(COLUMN_DIMENSION_NAME, $Graphic.datasetMappablePrefix)])
    9191                                        or
    92                                         exists(/QUERY_MODULE/REQUEST/SELECTED_GROUP_BY[starts-with(SELECTED_GROUP_BY, $Graphic.datasetMappablePrefix)])
     92                                        exists(/QUERY_MODULE/REQUEST/SELECTED_GROUP_BY[starts-with(OTHER_GROUP_BY, $Graphic.datasetMappablePrefix)])
    9393                                )
    9494                )
  • trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/Page.xslt

    r7005 r7014  
    9191        >
    9292                <!-- really vars but implemented as params - just in case... -->
    93                 <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/ROW_DIMENSION_NAME"/>
    94                 <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/COLUMN_DIMENSION_NAME"/>
    95                 <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/OTHER_DIMENSION_NAME"/>
     93                <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/ROW_DIMENSION_NAME"/>
     94                <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/COLUMN_DIMENSION_NAME"/>
     95                <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME"/>
    9696                <xsl:param name="rowDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$rowDimensionName]/TITLE"/>
    9797                <xsl:param name="colDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$colDimensionName]/TITLE"/>
  • trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/SiteSpecific.xslt

    r6826 r7014  
    169169        <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    170170        <xsl:template name="Page.specificScript" ibis:doc="Provides the the wiki javascript">
    171 <xsl:variable name="geoGroupByDimensionName"     select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/*[starts-with(text(), $Graphic.datasetMappablePrefix)]/text()"/>
    172 <xsl:variable name="nonGeoGroupByDimensionNames" select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/*[not(starts-with(text(), $Graphic.datasetMappablePrefix))]/text()"/>
     171<xsl:variable name="geoGroupByDimensionName"     select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/*[starts-with(text(), $Graphic.datasetMappablePrefix)]/text()"/>
     172<xsl:variable name="nonGeoGroupByDimensionNames" select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/*[not(starts-with(text(), $Graphic.datasetMappablePrefix))]/text()"/>
    173173
    174174<xsl:message select="concat('geoGroupByDimensionName: ', $geoGroupByDimensionName)"/>
  • trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/interactive/Page.xslt

    r7012 r7014  
    6161        >
    6262                <!-- really vars but implemented as params - just in case... -->
    63                 <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/ROW_DIMENSION_NAME"/>
    64                 <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/COLUMN_DIMENSION_NAME"/>
    65                 <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/OTHER_DIMENSION_NAME"/>
     63                <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/ROW_DIMENSION_NAME"/>
     64                <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/COLUMN_DIMENSION_NAME"/>
     65                <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME"/>
    6666                <xsl:param name="rowDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$rowDimensionName]/TITLE"/>
    6767                <xsl:param name="colDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$colDimensionName]/TITLE"/>
     
    259259
    260260        <xsl:template name="Page.leafletKendoScript" ibis:doc="Provides the kendo and leaflet javascript">
    261                 <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/ROW_DIMENSION_NAME"/>
    262                 <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/COLUMN_DIMENSION_NAME"/>
    263                 <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/OTHER_DIMENSION_NAME"/>
     261                <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/ROW_DIMENSION_NAME"/>
     262                <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/COLUMN_DIMENSION_NAME"/>
     263                <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME"/>
    264264                <xsl:param name="rowDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$rowDimensionName]/TITLE"/>
    265265                <xsl:param name="colDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$colDimensionName]/TITLE"/>
     
    273273                <xsl:variable name="hasLimit"         select="$hasLowerLimit or $hasUpperLimit"/>
    274274
    275 <xsl:variable name="geoGroupByDimensionName"     select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/*[starts-with(text(), $Graphic.datasetMappablePrefix)]/text()"/>
     275<xsl:variable name="geoGroupByDimensionName"     select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/*[starts-with(text(), $Graphic.datasetMappablePrefix)]/text()"/>
    276276
    277277                <xsl:variable name="dimensions">
  • trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/simple/Page.xslt

    r6992 r7014  
    8080                        section, the optional graphic, optional 2-d table, data list table."
    8181        >
    82                 <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/ROW_DIMENSION_NAME"/>
    83                 <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/COLUMN_DIMENSION_NAME"/>
    84                 <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/RESULT_GROUP_BY/OTHER_DIMENSION_NAME"/>
     82                <xsl:param name="rowDimensionName"    select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/ROW_DIMENSION_NAME"/>
     83                <xsl:param name="colDimensionName"    select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/COLUMN_DIMENSION_NAME"/>
     84                <xsl:param name="otherDimensionName"  select="$Result.queryModule/REQUEST/ACTUAL_GROUP_BY/OTHER_DIMENSION_NAME"/>
    8585                <xsl:param name="rowDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$rowDimensionName]/TITLE"/>
    8686                <xsl:param name="colDimensionTitle"   select="$Result.queryModule/DIMENSIONS/DIMENSION[NAME=$colDimensionName]/TITLE"/>
  • trunk/ibisph-view/src/main/webapp/xslt/svg/query/Map.xslt

    r5462 r7014  
    7171        <xsl:param name="queryResult"  select="/QUERY_MODULE/IBISQ_QUERY_RESULT" ibis:doc="Convenience variable that contains the query result element."/>
    7272
    73         <xsl:param name="recordAreaDimensionName" select="/QUERY_MODULE/REQUEST/RESULT_GROUP_BY/ROW_DIMENSION_NAME"
     73        <xsl:param name="recordAreaDimensionName" select="/QUERY_MODULE/REQUEST/ACTUAL_GROUP_BY/ROW_DIMENSION_NAME"
    7474                ibis:doc="Type of area being displayed (county, small area, LHD)
    7575                        which is the dimension associated with the '_RowGroupByDimensionName' value."
  • trunk/ibisph/src/main/java/org/ibisph/querymodule/modelmap/AddHTTPRequestParametersToQueryModule.java

    r7013 r7014  
    3131  implements ProcessModelMapFromHTTPRequest
    3232{
    33   // HTTP Request group by parameter names.
     33  // HTTP Request/query module PARAM to group by names.
    3434  protected Map<String, String> groupByHTTPRequestParameterNameByGroupByElementName = new HashMap<String, String>();
    3535
     
    8484    setSelectedDimensions   (queryModule, request);
    8585    setSelectedControls     (queryModule, request);
    86     setActualGroupBys(queryModule);
    8786  } //-------------------------- End of Method ------------------------------
    8887
     
    357356      }
    358357    }
    359  // not sure needed???    checkRowGroupBySetAndSetToFirstNonProxyIfNot(document);
    360358
    361359    // Set specified measure name.  If not specified then leave as is - default.
     
    364362      measureName = request.getParameter("MeasureName");
    365363      if(!StrLib.isSomething(measureName)) measureName = request.getParameter("_MeasureName");
    366       if(StrLib.isSomething(measureName)) this.queryModuleService.setMeasureName(document, measureName);
     364      if(StrLib.isSomething(measureName)) this.queryModuleService.setRequestMeasureName(document, measureName);
    367365    }
    368366
     
    375373        if(!StrLib.isSomething(graphicName)) graphicName = request.getParameter("graphicName");
    376374      }
    377       if(StrLib.isSomething(graphicName)) this.queryModuleService.setGraphicName(document, graphicName);
     375      if(StrLib.isSomething(graphicName)) this.queryModuleService.setRequestGraphicName(document, graphicName);
    378376    }
    379377  } //-------------------------- End of Method ------------------------------
     
    398396  } //-------------------------- End of Method ------------------------------
    399397
    400   /**
    401    * Checks to make sure that a row group by is set and if not sets to the first
    402    * none proxy name.
    403    * @param queryModule
    404    * @param groupByElementName
    405    * @param groupByDimensionNameValue
    406    */
    407   public void checkRowGroupBySetAndSetToFirstNonProxyIfNot(Node queryModule) {
    408     // check to make sure that a row group by is set.  If not then set to the
    409     // first available non proxy dimension - if exists.
    410     if( !StrLib.isSomething(XMLLib.getText(queryModule, "/QUERY_MODULE/REQUEST/SELECTED_GROUP_BY/ROW_DIMENSION_NAME")) ) {
    411       String firstNonProxyDimensionName = XMLLib.getText(queryModule, "/QUERY_MODULE/DIMENSIONS/DIMENSION[ not(PROXY_DIMENSION_NAME) ]/NAME");
    412       XMLLib.setText(queryModule, "/QUERY_MODULE/REQUEST/SELECTED_GROUP_BY", "ROW_DIMENSION_NAME", firstNonProxyDimensionName);
    413     }
    414   } //-------------------------- End of Method ------------------------------
    415 
    416 
    417   /**
    418    * Sets the request actual groupby dim names.  This code reads the selected
    419    * group bys and resolves the proxy via selected dimensions to determine and
    420    * set the actual group by values to be passed to the query app.
    421    * @param document query module XML document to be manipulated.
    422    */
    423   protected void setActualGroupBys(Node document) throws Exception {
    424     Node requestContainer = XMLLib.getNode(document, "/QUERY_MODULE/REQUEST");
    425     Node actualGroupByContainer = XMLLib.newNode("ACTUAL_GROUP_BY");
    426     XMLLib.replaceNode(requestContainer, "ACTUAL_GROUP_BY", actualGroupByContainer);
    427 
    428     // loop for all selected group bys.  If not proxy then add.  Else lookup
    429     // the selected dimension and use that.  If not found then throw...
    430     String groupByName;
    431     for(Map.Entry<String, String> entry: this.groupByHTTPRequestParameterNameByGroupByElementName.entrySet()) {
    432       String groupByElementName = entry.getKey();
    433       groupByName = XMLLib.getText(requestContainer, "SELECTED_GROUP_BY", groupByElementName);
    434 
    435       List<Node> proxiedDimensions = XMLLib.getNodes(document, "/QUERY_MODULE/DIMENSIONS/DIMENSION[PROXY_DIMENSION_NAME = '" + groupByName + "']");
    436       if(0 < proxiedDimensions.size()) {
    437         groupByName = XMLLib.getText(document, "/QUERY_MODULE/CRITERIA//SELECTED_DIMENSION[NAME = '" + groupByName + "']/VALUES/VALUE");
    438       }
    439 
    440       // verify that it's a dimension.  If not throw.
    441       String verifiedDimensionName = XMLLib.getText(document, "/QUERY_MODULE/DIMENSIONS/DIMENSION[NAME = '" + groupByName + "']/NAME");
    442       if(!StrLib.isSomething(verifiedDimensionName)) {
    443         throw new Exception("Problem setting QUERY_MODULES/REQUEST/ACTUAL_GROUP_BY/" + groupByElementName + ", no matching dimensions for: " + groupByName);
    444       }
    445 
    446       // if here then valid dimension - add it...
    447       XMLLib.addNode(actualGroupByContainer, XMLLib.newNode(groupByElementName, groupByName));
    448     }
    449   } //-------------------------- End of Method ------------------------------
    450  
    451398} //============================ END OF CLASS =================================
    452399
  • trunk/ibisph/src/main/java/org/ibisph/querymodule/modelmap/AddIBISQResultToQueryModule.java

    r7013 r7014  
    9898        (null != XMLLib.getNode(queryModule, "/QUERY_MODULE/IBISQ_QUERY_RESULT"))
    9999    ) return;
    100    
     100
    101101    this.queryModuleService.setRequestStartedDateTimeStamp(queryModule);
    102102    String baseURL = this.queryModuleService.getBaseQueryApplicationURL(queryModule);
    103103    if(!StrLib.isSomething(baseURL)) baseURL = this.queryApplicationRequestPath;
     104
     105    // before building the name value pairs for the URL and running set the
     106    // request's actual group by dims - the name value pairs depend on these
     107    // to be set.  This is almost a better fit for the AddHTTPRRquestParametersToQueryModule
     108    // model map processing but that code only executes when the user submits a
     109    // query.  Putting that code here ensures that it is set prior to running
     110    // a saved query, a default query, or a normal builder page query.
     111    setActualGroupBys(queryModule);
    104112
    105113    UserDetails userDetails = null;
     
    177185
    178186  /**
     187   * Sets the request's actual groupby dim names.  This code reads the selected
     188   * group bys (resolves any proxy via selected dimensions ) and creates the
     189   * actual group by values (passed to the query app via name/value pairs).
     190   * @param document query module XML document to be manipulated.
     191   */
     192  public void setActualGroupBys(Node document) throws Exception {
     193    Node requestContainer = XMLLib.getNode(document, "/QUERY_MODULE/REQUEST");
     194    Node actualGroupByContainer = XMLLib.newNode("ACTUAL_GROUP_BY");
     195    XMLLib.replaceNode(requestContainer, "ACTUAL_GROUP_BY", actualGroupByContainer);
     196 
     197    // loop for all selected group bys.  If not proxy then add.  Else lookup
     198    // the selected dimension and use that.  If not found then throw...
     199    String groupByName;
     200    List<Node> selectedGroupBys = XMLLib.getNodes(requestContainer, "SELECTED_GROUP_BY/*");
     201    for(Node selectedGroupBy: selectedGroupBys) {
     202      groupByName = XMLLib.getText(selectedGroupBy);
     203 
     204      List<Node> proxiedDimensions = XMLLib.getNodes(document, "/QUERY_MODULE/DIMENSIONS/DIMENSION[PROXY_DIMENSION_NAME = '" + groupByName + "']");
     205      if(0 < proxiedDimensions.size()) {
     206        groupByName = XMLLib.getText(document, "/QUERY_MODULE/CRITERIA//SELECTED_DIMENSION[NAME = '" + groupByName + "']/VALUES/VALUE");
     207      }
     208 
     209      // verify that it's a dimension.  If not throw.
     210      String groupByElementName = XMLLib.getNodeName(selectedGroupBy);
     211      String verifiedDimensionName = XMLLib.getText(document, "/QUERY_MODULE/DIMENSIONS/DIMENSION[NAME = '" + groupByName + "']/NAME");
     212      if(!StrLib.isSomething(verifiedDimensionName)) {
     213        throw new Exception("Problem setting QUERY_MODULE/REQUEST/ACTUAL_GROUP_BY/" + groupByElementName + ", no matching dimensions for: " + groupByName);
     214      }
     215 
     216      // if here then valid dimension - add it...
     217      XMLLib.addNode(actualGroupByContainer, XMLLib.newNode(groupByElementName, groupByName));
     218    }
     219  } //-------------------------- End of Method ------------------------------
     220
     221
     222  /**
    179223   * Parses the query result string and puts into the query module XML document
    180224   * object.
     
    216260      if(!uniqueDimensionNames.contains(dimensionName)) {
    217261        uniqueDimensionNames.add(dimensionName);
    218         String actualDimensionName = XMLLib.getText(actualGroupBy, "*[text() = \'" + dimensionName + "'\"]");
     262        String actualDimensionName = XMLLib.getText(actualGroupBy, "*[text() = \'" + dimensionName + "\']");
    219263        if(!StrLib.isSomething(actualDimensionName)) {
    220264          throw new Exception("Checking result group by vs actual selected group bys.  Dimension (" + dimensionName + ") not found in the requested group bys.");
     
    254298
    255299} //============================ END OF CLASS =================================
    256 
  • trunk/ibisph/src/main/java/org/ibisph/querymodule/modelmap/AddMissingQueryResultRecordsToQueryModule.java

    r6283 r7014  
    238238
    239239    // finally, replace the existing RECORDS element with the newly created version. 
    240     XMLLib.replaceNode(queryModuleConfigurationNode, "/QUERY_MODULE/IBISQ_QUERY_RESULT/RECORDS", newRecordsElement);
     240    Node ibisQResultContainer = XMLLib.getNode(queryModuleConfigurationNode, "/QUERY_MODULE/IBISQ_QUERY_RESULT");
     241    XMLLib.replaceNode(ibisQResultContainer, "RECORDS", newRecordsElement);
    241242  } //-------------------------- End of Method ------------------------------
    242243
  • trunk/ibisph/src/main/java/org/ibisph/querymodule/modelmap/UpdateDisplayOptionsFromHTTPRequest.java

    r6283 r7014  
    5454    // Set specified measure name.  If not specified then leave as is - default.
    5555    String measureName = request.getParameter(this.measureHTTPParameterName);
    56     this.queryModuleService.setMeasureName(queryModule, measureName);
     56    this.queryModuleService.setRequestMeasureName(queryModule, measureName);
    5757
    5858    // Do a similar thing for the graphic name.
    5959    String graphicName = request.getParameter(this.graphicHTTPParameterName);
    6060    if(!StrLib.isSomething(graphicName)) graphicName = request.getParameter("graphicName");
    61     this.queryModuleService.setGraphicName(queryModule, graphicName);
     61    this.queryModuleService.setRequestGraphicName(queryModule, graphicName);
    6262  } //-------------------------- End of Method ------------------------------
    6363
  • trunk/ibisph/src/main/java/org/ibisph/querymodule/service/QueryModuleRequestNameValuePairs.java

    r7013 r7014  
    4949  protected String urlCharacterEncoding    = null;   // "UTF-8";
    5050
    51 
     51  protected boolean excludeNotAssociatedDimensionValues = false;
     52
     53 
    5254  /**
    5355   * Sets the character prefix for PARAMETER elements and submitted request
     
    210212    // else nothing selected - add them all.
    211213    else {
    212       List<Node> dimensionValues = XMLLib.getNodes(queryModule, "/QUERY_MODULE/DIMENSIONS/DIMENSION[NAME = '" + groupByDimensionName + "']/VALUES/VALUE[not(NOT_ASSOCIATED_FLAG)]");
     214      String xpath = "/QUERY_MODULE/DIMENSIONS/DIMENSION[NAME = '" + groupByDimensionName + "']/VALUES/VALUE";
     215      if(this.excludeNotAssociatedDimensionValues) xpath = xpath + "[not(NOT_ASSOCIATED_FLAG)]";
     216      List<Node> dimensionValues = XMLLib.getNodes(queryModule, xpath);
    213217      if(0 == dimensionValues.size()) {
    214218        throw new Exception("Problem buidling query request name value pairs for group by dimension (" + groupByDimensionName + ") - could not find any associated dimension values.");
  • trunk/ibisph/src/main/java/org/ibisph/querymodule/service/QueryModuleXML.java

    r7013 r7014  
    4040
    4141
    42   public QueryModuleXML() {}
    43 
    44 
    4542  //------------------------------------------- P R O P E R T Y   S E T T E R S
    4643
     
    152149    }
    153150
     151    // set a default row selected group by to the first criteria SELECTED_DIMENSION
     152    // this is needed when running a query module without going to the builder
     153    // or a saved query first.
     154    String firstCriteriaSelectedDimensionName = XMLLib.getText(document, "/QUERY_MODULE/CRITERIA//SELECTED_DIMENSIONS/SELECTED_DIMENSION[string-length(NAME) != 0]/NAME[1]");
     155    Node selectedGroupBy = XMLLib.newNode("SELECTED_GROUP_BY");
     156    XMLLib.addNode(selectedGroupBy, XMLLib.newNode("ROW_DIMENSION_NAME", firstCriteriaSelectedDimensionName));
     157    XMLLib.addNode(request, selectedGroupBy);
     158
    154159    // set the default measure and graphic names...
    155160    String measureName = XMLLib.getText(configuration, "DEFAULT_MEASURE_NAME");
    156161    if(!StrLib.isSomething(measureName)) measureName = XMLLib.getText(configuration, "MEASURES/MEASURE[not(NO_DISPLAY_FLAG)][1]/NAME");
    157     setMeasureName(document, measureName);
     162    setRequestMeasureName(document, measureName);
    158163
    159164    String graphicName = XMLLib.getText(configuration, "PARAMETERS/PARAMETER[NAME='_GraphicName']/VALUE");
     
    163168        graphicName = XMLLib.getText(document, "/QUERY_MODULE/PARAMETERS/PARAMETER[NAME='_GraphicName']/VALUE");
    164169    }
    165     setGraphicName(document, graphicName);
    166   } //-------------------------- End of Method ------------------------------
    167 
     170    setRequestGraphicName(document, graphicName);
     171
     172  } //-------------------------- End of Method ------------------------------
    168173
    169174
    170175  // -------------------------------------------- G E N E R I C   H E L P E R S
    171 
    172176  /**
    173177   * Simple static getter to access the number of modules loaded.  This is used
     
    192196
    193197  /**
     198   * Simple access to the CONFIGURATION/BASE_QUERY_APPLICATION_URL element.
     199   * @return value of the selected configuration's BASE_QUERY_APPLICATION_URL
     200   *   element.
     201   */
     202  public String getBaseQueryApplicationURL(Node document) {
     203    return( XMLLib.getText(document, "/QUERY_MODULE/CONFIGURATIONS/CONFIGURATION[NAME=/QUERY_MODULE/REQUEST/CONFIGURATION_NAME]/BASE_QUERY_APPLICATION_URL"));
     204  } //-------------------------- End of Method ------------------------------
     205
     206  public String getFormattedDate(long time) {
     207    String formattedDateString = this.dateFormat.format(time);
     208    return(formattedDateString);
     209  } //-------------------------- End of Method ------------------------------
     210
     211
     212
     213  // ---------------------------- R E Q U E S T   E L E M E N T   H E L P E R S
     214  /**
    194215   * Simple access to the REQUEST/CONFIGURATION_PATH element.
    195216   * @return value of the /QUERY_MODULE/REQUEST/CONFIGURATION_PATH element.
     
    204225   * @param measureName value to set.
    205226   */
    206   public void setMeasureName(Node queryModule, String measureName) {
     227  public void setRequestMeasureName(Node queryModule, String measureName) {
    207228    if(StrLib.isSomething(measureName)) XMLLib.setText(queryModule, "/QUERY_MODULE/REQUEST", "MEASURE_NAME", measureName);
    208229  } //-------------------------- End of Method ------------------------------
     
    213234   * @param graphicName value to set.
    214235   */
    215   public void setGraphicName(Node queryModule, String graphicName) {
     236  public void setRequestGraphicName(Node queryModule, String graphicName) {
    216237    if(StrLib.isSomething(graphicName)) XMLLib.setText(queryModule, "/QUERY_MODULE/REQUEST", "GRAPHIC_NAME", graphicName);
    217238  } //-------------------------- End of Method ------------------------------
     
    221242   * @param queryModule query module document to get text value from.
    222243   */
    223   public String getGraphicName(Node queryModule) {
     244  public String getRequestGraphicName(Node queryModule) {
    224245    return(XMLLib.getText(queryModule, "/QUERY_MODULE/REQUEST/GRAPHIC_NAME"));
    225   } //-------------------------- End of Method ------------------------------
    226 
    227 
    228   /**
    229    * Simple access to the CONFIGURATION/BASE_QUERY_APPLICATION_URL element.
    230    * @return value of the selected configuration's BASE_QUERY_APPLICATION_URL
    231    *   element.
    232    */
    233   public String getBaseQueryApplicationURL(Node document) {
    234     return( XMLLib.getText(document, "/QUERY_MODULE/CONFIGURATIONS/CONFIGURATION[NAME=/QUERY_MODULE/REQUEST/CONFIGURATION_NAME]/BASE_QUERY_APPLICATION_URL"));
    235246  } //-------------------------- End of Method ------------------------------
    236247
     
    271282  } //-------------------------- End of Method ------------------------------
    272283
    273   public String getFormattedDate(long time) {
    274     String formattedDateString = this.dateFormat.format(time);
    275     return(formattedDateString);
    276   } //-------------------------- End of Method ------------------------------
    277 
    278284} //============================ END OF CLASS =================================
  • trunk/ibisph/src/main/java/org/ibisph/util/XMLLib.java

    r6908 r7014  
    219219  } //-------------------------- End of Method ------------------------------
    220220   */
     221
     222
     223  /**
     224   * Get's the node's name.
     225   * @param node Document/element/node to retrieve node from.
     226   * @return node's name.
     227   */
     228  @SuppressWarnings("unchecked")
     229  public static String getNodeName(Node node) {
     230    return(node.getName());
     231  } //-------------------------- End of Method ------------------------------
    221232
    222233
     
    509520  public static void replaceNode(Node node, String nodeToBeReplacedXPath, Node newNode) {
    510521    Node nodeToBeReplaced = XMLLib.getNode(node, nodeToBeReplacedXPath);
    511     Node containerNode = nodeToBeReplaced.getParent();
    512     XMLLib.deleteNode(nodeToBeReplaced);
    513     if(null != newNode) XMLLib.addNode(containerNode, newNode);
     522    if(null != nodeToBeReplaced) XMLLib.deleteNode(nodeToBeReplaced);
     523    if(null != newNode) XMLLib.addNode(node, newNode);
    514524  } //-------------------------- End of Method ------------------------------
    515525
Note: See TracChangeset for help on using the changeset viewer.