Changeset 21694 in main


Ignore:
Timestamp:
10/02/20 09:12:10 (3 weeks ago)
Author:
GarthBraithwaite_STG
Message:

view, admin, java - added ability to remove IP elements when publishing ie IP/NOTE for nj. Cleaned out unused cookie and old js. fixed complete and summary viz view title. added path params for configurations_by_file_table.xslt report. QM XML service updated to remove invalid _ChartName params. Updated XMLLib to test delete node selection being null so it doesn't throw.

Location:
trunk
Files:
8 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ibisph-admin/src/main/webapp/WEB-INF/config/spring/publish.xml

    r17719 r21694  
    292292                        </bean>
    293293                </property>
     294                <property name="elementXPathToDeleteList">
     295                        <list>
     296                                <value>/INDICATOR/NOTE</value>
     297                        </list>
     298                </property>
    294299        </bean>
    295300        <bean id="publishIndicatorController"
  • trunk/ibisph-admin/src/main/webapp/WEB-INF/config/spring/security.xml

    r20837 r21694  
    318318        </bean>
    319319
    320 
     320<!-- bean to use if wanting to log user entries to the db table:
     321        <bean id="securityAuthenticationUserLogService" class="org.ibisph.user.service.DataBeanDAOUserLog">
     322                <property name="DAOFactory" ref="commonDAOFactory"/>
     323        </bean>
     324        Default is to use the regular file logger for consistency so all messages are
     325        in one file.
     326-->
    321327        <bean id="securityAuthenticationUserLogService" class="org.ibisph.user.service.SLF4JUserLog"/>
    322328
  • trunk/ibisph-admin/src/main/webapp/WEB-INF/jsp/_publish.jsp

    r17155 r21694  
    4545    function receivePublishResponse(ajaxRequest)
    4646    {
    47           if(ajaxRequest.status == 200)
     47          if(200 == ajaxRequest.status)
    4848          {
    4949                  global.modalDialog.setInnerHTMLContent(publishResultHTML);
  • trunk/ibisph-admin/src/main/webapp/WEB-INF/tags/mergeRecordData.tag

    r21380 r21694  
    117117<script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/merge.js"></script>
    118118
    119 <script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/Cookie.js"></script>
    120 <script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/NamedInputElement.js"></script>
    121 <script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/CookieBoundInputElement.js"></script>
    122119<script>
    123120        function showMergeDataDialog()
  • trunk/ibisph-admin/src/main/webapp/js/common.js

    r16500 r21694  
    778778
    779779
    780 //=============================================================== C O O K I E S
    781 
    782 // function for retrieving a cookie.  name is required.
    783 function getCookie(name)
    784 {
    785         var cname = name + "=";               
    786         var dc = document.cookie;             
    787         if (dc.length > 0)
    788         {
    789                 begin = dc.indexOf(cname);       
    790                 if (begin != -1)
    791                 {
    792                         begin += cname.length;       
    793                         end = dc.indexOf(";", begin);
    794                         if (end == -1) end = dc.length;
    795 //alert("get cookie: "+name+", value: "+ unescape(dc.substring(begin, end)) );
    796                         return( unescape(dc.substring(begin, end)) );
    797                 }
    798         }
    799         return(null);
    800 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    801 
    802 // Sets a cookie value.  Only name and value are required - all others are optional.
    803 // If expires is not set the cookie will only exist until the end of the session.
    804 function setCookie(name, value, expires, path, domain, secure)
    805 {
    806         var newCookie = name + "=" + escape(value)
    807           + ((!isDefined(expires)) ? "" : "; expires=" + expires.toGMTString())
    808           + ((!isDefined(path))    ? "" : "; path="    + path)
    809           + ((!isDefined(domain))  ? "" : "; domain="  + domain)
    810           + ((!isDefined(secure))  ? "" : "; secure");
    811 //alert("setting cookie: "+newCookie);   
    812         document.cookie = newCookie;
    813 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    814 
    815 // function for setting a cookie that will last for a year.  Only name and
    816 // value are required.
    817 function setPersistantCookie(name, value, path, domain, secure)
    818 {
    819         var date = new Date();
    820         date.setYear( date.getYear()+1 );
    821         expires = date;
    822 //alert("set persistant cookie, expires:" + expires);
    823         setCookie(name, value, expires, path, domain, secure);
    824 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    825 
    826 // delete a cookie.  Only name is required - all others are optional.
    827 function deleteCookie(name, path, domain)
    828 {
    829         if (getCookie(name) != null)
    830                 document.cookie = name + "="
    831                   + ((path   == null) ? "" : "; path="   + path)
    832                   + ((domain == null) ? "" : "; domain=" + domain)
    833                   + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    834 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    835 
    836 
    837 
    838 
    839 
    840780//=============================================== G E N E R A L   E L E M E N T
    841781
  • trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/complete_profile/Page.xslt

    r21462 r21694  
    7575                        <xsl:variable name="valueAttributeNames" select="distinct-values($indicatorViewDatasetRecords//VALUE_ATTRIBUTE_NAME)"/>
    7676
     77                        <xsl:variable name="completeIndicatorViewTitle" select="ibis:getCompleteIndicatorViewTitle($indicator, $indicatorView, $Indicator.dimensions)"/>
     78
    7779                        <xsl:variable name="showMap"
    7880                                select="ibis:DataViz.showMap(
     
    8890                                <xsl:call-template name="DataViz.mapContainer">
    8991                                        <xsl:with-param name="containerID" select="concat($dataVizContainerIDPrefix, '_map')"/>
    90                                         <xsl:with-param name="title" select="ibis:getIndicatorViewMapTitle($indicatorView, $Page.completeIndicatorViewTitle)"/>
     92                                        <xsl:with-param name="title" select="ibis:getIndicatorViewMapTitle($indicatorView, $completeIndicatorViewTitle)"/>
    9193                                        <xsl:with-param name="footerContent" select="$indicatorView/MAP_NARRATIVE"/>
    9294                                </xsl:call-template>
     
    130132                                        <xsl:with-param name="showChart"      select="$showChart"/>
    131133                                        <xsl:with-param name="chartName"      select="$indicatorView/CHART_NAME"/>
    132                                         <xsl:with-param name="chartTitle"     select="ibis:getIndicatorViewChartTitle($indicatorView, $Page.completeIndicatorViewTitle)"/>
     134                                        <xsl:with-param name="chartTitle"     select="ibis:getIndicatorViewChartTitle($indicatorView, $completeIndicatorViewTitle)"/>
    133135
    134136                                        <xsl:with-param name="showGrid"       select="$Indicator.showGrid"/>
     
    136138                                        <xsl:with-param name="showLabelColumn"          select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/>
    137139
    138                                         <xsl:with-param name="baseExportFilename" select="$Page.completeIndicatorViewTitle"/>
     140                                        <xsl:with-param name="baseExportFilename" select="$completeIndicatorViewTitle"/>
    139141                                </xsl:call-template>
    140142
  • trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/summary/Page.xslt

    r21640 r21694  
    8484                                </xsl:variable>
    8585
     86                                <xsl:variable name="completeIndicatorViewTitle" select="ibis:getCompleteIndicatorViewTitle($indicator, $indicatorView, $Indicator.dimensions)"/>
     87
    8688                                <xsl:variable name="showMap"
    8789                                        select="ibis:DataViz.showMap(
     
    9799                                        <xsl:call-template name="DataViz.mapContainer">
    98100                                                <xsl:with-param name="containerID" select="concat($dataVizContainerIDPrefix, '_map')"/>
    99                                                 <xsl:with-param name="title" select="ibis:getIndicatorViewMapTitle($indicatorView, $Page.completeIndicatorViewTitle)"/>
     101                                                <xsl:with-param name="title" select="ibis:getIndicatorViewMapTitle($indicatorView, $completeIndicatorViewTitle)"/>
    100102                                                <xsl:with-param name="footerContent" select="$indicatorView/MAP_NARRATIVE"/>
    101103                                        </xsl:call-template>
     
    134136                                                <xsl:with-param name="showChart"     select="$showChart"/>
    135137                                                <xsl:with-param name="chartName"     select="$indicatorView/CHART_NAME"/>
    136                                                 <xsl:with-param name="chartTitle"    select="ibis:getIndicatorViewChartTitle($indicatorView, $Page.completeIndicatorViewTitle)"/>
     138                                                <xsl:with-param name="chartTitle"    select="ibis:getIndicatorViewChartTitle($indicatorView, $completeIndicatorViewTitle)"/>
    137139
    138140                                                <xsl:with-param name="showGrid"      select="$Indicator.showGrid"/>
     
    140142                                                <xsl:with-param name="showLabelColumn"          select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/>
    141143
    142                                                 <xsl:with-param name="baseExportFilename" select="$Page.completeIndicatorViewTitle"/>
     144                                                <xsl:with-param name="baseExportFilename" select="$completeIndicatorViewTitle"/>
    143145                                        </xsl:call-template>
    144146
  • trunk/ibisph-view/src/main/webapp/xslt/html/query/module/report/configurations_by_file_table.xslt

    r21259 r21694  
    2525        <xsl:param name="xml"/>
    2626        <xsl:param name="Page.pageTitle" ibis:doc="Page's title text.">Query Module Configuration Report (<xsl:value-of select="/FILES/TITLE"/>)</xsl:param>
     27
     28        <xsl:param name="partialURLSearchFor"   select="'query/module/'"/>
     29        <xsl:param name="partialURLReplaceWith" select="'query/result/'"/>
    2730
    2831
     
    8689                <xsl:param name="file"        select="document(concat($ConfigurationsByFile.filePath, $filename), /)"/>
    8790                <xsl:param name="configCount" select="count($file/QUERY_MODULE/CONFIGURATIONS/CONFIGURATION)"/>
    88                 <xsl:param name="partialURL"  select="concat($ibis.baseRequestPath, replace( replace($filename, '.xml', ''), 'query/module/', 'query/result/'))"/>
     91                <xsl:param name="partialURL"  select="concat($ibis.baseRequestPath, replace( replace($filename, '.xml', ''), $partialURLSearchFor, $partialURLReplaceWith))"/>
    8992
    9093                <xsl:if test="$configCount &gt; 0">
  • trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/springmvc/databean/PublishIndicatorToXMLFileController.java

    r19725 r21694  
    1616import org.ibisph.indicatorprofile.service.PublishedIndicatorsXML;
    1717import org.ibisph.util.IOPath;
     18import org.ibisph.util.XMLLib;
    1819import org.ibisph.xml.service.DocumentDAO;
    1920
     
    3435
    3536  protected String filePath      = "";
    36   protected String lineDelimiter = "\n";
     37  protected String lineDelimiter = "\n";  // \n, \r\n - no diff from \n
     38  // textarea delimeter note: textareas don't process html.  so <br/>  and &#013;&#010; - do not work.
     39
     40
     41  protected List<String> elementXPathToDeleteList = null;
    3742
    3843
     
    7984  } //-------------------------- End of Method ------------------------------
    8085 
    81 
     86  public void setElementXPathToDeleteList(List<String> elementXPathToDeleteList ) {
     87    this.elementXPathToDeleteList = elementXPathToDeleteList;
     88  } //-------------------------- End of Method ------------------------------
     89 
     90 
    8291  /**
    8392   * Spring Controller handleRequest implementation that saves the specified
     
    189198    }
    190199
    191     // IF ACTIVE the process the publishing.  If new pub date then save the IP
     200    // IF ACTIVE then process the publishing.  If new pub date then save the IP
    192201    // to the db.  Then save the IP and IPV XML files. 
    193202    // IF NOT ACTIVE delete the files. 
     
    205214          returnMessage.append("Republished:  ");
    206215        }
     216
     217        // Delete nodes like the internal NOTE field before saving.  DAO Load/save
     218        // service is generic so can't put in there.  DataBeanToXMLService is
     219        // also generic so can't put in there either.  Code is put here...
     220        if(null != this.elementXPathToDeleteList) {
     221          for(String elementXPathToDelete : this.elementXPathToDeleteList) {
     222            XMLLib.deleteNode(indicatorDocument, elementXPathToDelete);
     223          }
     224        }
     225
    207226        this.documentDAOService.save(indicatorDocument, indicatorProfileFilePathAndName);
    208227        int i = processIndicatorViews(indicatorDocument, true);
  • trunk/ibisph/src/main/java/org/ibisph/querymodule/service/QueryModuleXML.java

    r21379 r21694  
    177177    String defaultDimensionName = XMLLib.getText(configuration, "DEFAULT_CATEGORY_DIMENSION_NAME");
    178178    if(!StrLib.isSomething(defaultDimensionName )) {
    179       defaultDimensionName = XMLLib.getText(document, "/QUERY_MODULE/CRITERIA//SELECTED_DIMENSIONS/SELECTED_DIMENSION[string-length(NAME) != 0]/NAME[1]");
     179      defaultDimensionName = XMLLib.getText(document, "/QUERY_MODULE/CRITERIA//SELECTED_DIMENSIONS/SELECTED_DIMENSION[0 != string-length(NAME)]/NAME[1]");
    180180    }
    181181    XMLLib.addNode(selectedGroupBy, XMLLib.newNode("CATEGORY_DIMENSION_NAME", defaultDimensionName));
     
    191191    }
    192192
    193     // first check the config's param for a chart name.  If nothing use the
    194     // default.  If still nothing then try the qm's param.
    195     String chartName = XMLLib.getText(configuration, "PARAMETERS/PARAMETER[NAME='_ChartName']/VALUE");
    196     if(!StrLib.isSomething(chartName)) {
    197       chartName = XMLLib.getText(configuration, "DEFAULT_CHART_NAME");
    198       if(!StrLib.isSomething(chartName))
    199         chartName = XMLLib.getText(document, "/QUERY_MODULE/PARAMETERS/PARAMETER[NAME='_ChartName']/VALUE");
    200     }
     193    // process the default map and chart names and set to the request.
     194    String chartName = XMLLib.getText(configuration, "DEFAULT_CHART_NAME");
    201195    setRequestChartName(document, chartName);
    202196
    203     // first check the config's param for a map name.  If nothing use the
    204     // default.  If still nothing then try the qm's param.
    205     String mapName = XMLLib.getText(configuration, "PARAMETERS/PARAMETER[NAME='_MapName']/VALUE");
    206     if(!StrLib.isSomething(mapName)) {
    207       mapName = XMLLib.getText(configuration, "DEFAULT_MAP_NAME");
    208       if(!StrLib.isSomething(mapName))
    209         mapName = XMLLib.getText(document, "/QUERY_MODULE/PARAMETERS/PARAMETER[NAME='_MapName']/VALUE");
    210     }
     197    String mapName = XMLLib.getText(configuration, "DEFAULT_MAP_NAME");
    211198    setRequestMapName(document, mapName);
    212199  } //-------------------------- End of Method ------------------------------
  • trunk/ibisph/src/main/java/org/ibisph/user/service/DataBeanDAOUserLog.java

    r3535 r21694  
    5252    userLogBean.setFieldValue("DESCRIPTION",     description);
    5353
    54      daoFactory.getDAO(userLogBean).save();
     54    daoFactory.getDAO(userLogBean).save();
    5555  } //-------------------------- End of Method ------------------------------
    5656
  • trunk/ibisph/src/main/java/org/ibisph/util/XMLLib.java

    r19906 r21694  
    426426  public static boolean deleteNode(Node containerNode, String childNodeNameToDelete) {
    427427    Node node = XMLLib.getNode(containerNode, childNodeNameToDelete);
    428     node.detach();
    429     node = null;
    430     return(true);
     428    if(null != node) {
     429      node.detach();
     430      node = null;
     431      return(true);
     432    }
     433    return(false);
    431434  } //-------------------------- End of Method ------------------------------
    432435
Note: See TracChangeset for help on using the changeset viewer.