Changeset 19891 in main


Ignore:
Timestamp:
02/21/20 23:19:02 (20 months ago)
Author:
GarthBraithwaite_STG
Message:

view, java - Updated the user/modelmap/ProcessUserRegistration.java to use the modelmap's webapp base request path. Change ibis:getcompleteurl to getRequestURL.

Location:
trunk
Files:
2 added
1 deleted
10 edited

Legend:

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

    r18692 r19891  
    2828
    2929        <bean id="userEmailVerificationRequestPath" class="org.ibisph.model.StringHolder">
    30                 <constructor-arg type="java.lang.String" value="#{commonWebAppRemoteRequestPath}user/registration/verify"/>
     30                <description>
     31                        Specifies the specific URL for the user self registration
     32                        verification code.  This is either a complete URL base request
     33                        path or a sub request path which is then concated with the
     34                        webapp base request path.
     35                </description>
     36                <constructor-arg type="java.lang.String" value="user/registration/verify"/>
    3137        </bean>
    3238
     
    260266
    261267        <bean id="userProcessUserRegistrationModelMap" class="org.ibisph.user.modelmap.ProcessUserRegistration">
    262                 <property name="userProfileModelMapKey"       value="#{userProfileModelMapKey.string}"/>
    263                 <property name="userProfileService"           ref="userProfileXMLService"/>
    264                 <property name="emailVerificationService"     ref="userEmailVerificationService"/>
     268                <property name="userProfileModelMapKey"        value="#{userProfileModelMapKey.string}"/>
     269                <property name="userProfileService"            ref="userProfileXMLService"/>
     270                <property name="emailVerificationService"      ref="userEmailVerificationService"/>
     271                <property name="webAppBaseRequestPathModelMapKey" value="WebAppBaseRequestPath"/>
    265272                <property name="emailVerificationRequestPath" value="#{userEmailVerificationRequestPath.string}"/>
    266273        </bean>
  • trunk/ibisph-view/src/main/webapp/xslt/_ibis-path.xslt

    r19890 r19891  
    103103
    104104
    105         <xsl:function name="ibis:getCompleteURL" as="xs:string"
     105        <xsl:function name="ibis:getRequestURL" as="xs:string"
    106106                ibis:doc="tests the supplied path/URL and if no http prefix then the
    107107                        webapp context is added as a prefix to the path."
  • trunk/ibisph-view/src/main/webapp/xslt/html/Page.xslt

    r19890 r19891  
    505505                <script>
    506506                        $.ajax({
    507                                 url: "<xsl:value-of select="ibis:getCompleteURL($sourceContentURL)"/>"
     507                                url: "<xsl:value-of select="ibis:getRequestURL($sourceContentURL)"/>"
    508508                                ,type: "GET"
    509509                                ,success: function(data)
  • trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/Indicator.xslt

    r19890 r19891  
    956956                                        <xsl:for-each select="$indicator/TOPICS/TOPIC">
    957957                                                <xsl:sort select="SORT_ORDER" order="ascending" data-type="number"/>
    958                                                 <li><a href="{ibis:getCompleteURL(URL)}" title="Topic {TITLE}"
     958                                                <li><a href="{ibis:getRequestURL(URL)}" title="Topic {TITLE}"
    959959                                                        ><xsl:value-of select="TITLE"/>
    960960                                                </a></li>
     
    981981                                        <xsl:for-each select="$indicator//DATASET/QUERY">
    982982                                                <xsl:sort select="SORT_ORDER" order="ascending" data-type="number"/>
    983                                                 <li><a href="{ibis:getCompleteURL(URL)}" title="Dataset Query {TITLE}"
     983                                                <li><a href="{ibis:getRequestURL(URL)}" title="Dataset Query {TITLE}"
    984984                                                        ><xsl:value-of select="TITLE"/>
    985985                                                </a></li>
  • trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/Page.xslt

    r19890 r19891  
    147147                                                <xsl:for-each select="$indicator/TOPICS/TOPIC">
    148148                                                        <xsl:sort select="SORT_ORDER" order="ascending" data-type="number"/>
    149                                                         <option value="{ibis:getCompleteURL(URL)}"><xsl:value-of select="TITLE"/></option>
     149                                                        <option value="{ibis:getRequestURL(URL)}"><xsl:value-of select="TITLE"/></option>
    150150                                                </xsl:for-each>
    151151                                        </select>
  • trunk/ibisph/src/main/java/org/ibisph/communityprofile/modelmap/ModelFromHTTPRequestPath.java

    r19071 r19891  
    2222  implements GetModelMapFromHTTPRequest
    2323{
    24   protected String communityNameModelMapKey  = "DimensionName";
    25   protected String communityValueModelMapKey = "DimensionValue";
    26   protected String indicatorNameModelMapKey  = "IndicatorName";
    27   protected String indicatorSetNameModelMapKey = "IndicatorSetName";
     24  protected String communityNameModelMapKey       = "DimensionName";
     25  protected String communityValueModelMapKey      = "DimensionValue";
     26  protected String indicatorNameModelMapKey       = "IndicatorName";
     27  protected String indicatorSetNameModelMapKey    = "IndicatorSetName";
    2828  protected String communityReportTypeModelMapKey = "CommunityReportType";
    2929
    30   protected String indicatorsCommunityReportType = "indicators";
    31   protected String indicatorCommunityReportType  = "indicator";
    32   protected String factsCommunityReportType      = "facts";
     30  protected String indicatorsCommunityReportType  = "indicators";
     31  protected String indicatorCommunityReportType   = "indicator";
     32  protected String factsCommunityReportType       = "facts";
    3333
    3434
  • trunk/ibisph/src/main/java/org/ibisph/user/modelmap/ProcessUserRegistration.java

    r18246 r19891  
    88
    99import org.dom4j.Node;
    10 
    1110import org.ibisph.modelmap.ProcessModelMapFromHTTPRequest;
    1211import org.ibisph.user.service.EmailAccountAccess;
    1312import org.ibisph.util.IOPath;
     13import org.ibisph.util.NetLib;
    1414import org.ibisph.util.StrLib;
    1515import org.ibisph.util.XMLLib;
     
    2424 */
    2525public class ProcessUserRegistration extends AbstractUserStatus implements ProcessModelMapFromHTTPRequest {
    26   protected String emailVerificationRequestPath = null;
     26  protected String webAppBaseRequestPathModelMapKey = "WebAppBaseRequestPath";
     27  protected String emailVerificationRequestPath     = null;
     28  protected String baseEmailVerificationRequestPath = null;
    2729  protected EmailAccountAccess emailVerificationService = null;
    28 
    2930
    3031  /**
     
    4647  }
    4748
     49  public void setWebAppBaseRequestPathModelMapKey(String webAppBaseRequestPathModelMapKey) {
     50    this.webAppBaseRequestPathModelMapKey = webAppBaseRequestPathModelMapKey;
     51  } //-------------------------- End of Method ------------------------------
     52
     53/* TODO: remove at some point...
     54  protected WebAppBaseRequestPathFromHTTPRequest webAppBaseRequestPathModelMap = null;
     55  public void setWebAppBaseRequestPathFromHTTPRequest(WebAppBaseRequestPathFromHTTPRequest webAppBaseRequestPathModelMap) {
     56    this.webAppBaseRequestPathModelMap = webAppBaseRequestPathModelMap;
     57  }
     58*/
    4859
    4960  //------------------------ M A I N   R E Q U E S T   M O D E L   M E T H O D
     
    98109    }
    99110
    100     // If here then so far so good - send the verification email message and
    101     // set status accordingly.
     111    // If here then so far so good - set the base verification email request path
     112    // if needed and send the verification email message then set status accordingly.
     113    if(!StrLib.isSomething(this.baseEmailVerificationRequestPath)) {
     114      if(NetLib.isURL(this.emailVerificationRequestPath))
     115        this.baseEmailVerificationRequestPath = this.emailVerificationRequestPath;
     116      else {
     117        String webAppBaseRequestPath = (String)modelMap.get(this.webAppBaseRequestPathModelMapKey);
     118        this.baseEmailVerificationRequestPath = IOPath.concat(webAppBaseRequestPath, this.emailVerificationRequestPath, "/");
     119      }
     120    }
     121
    102122    String verificationValue = request.getSession().getId();
    103123    if(sendVerificationEmail(userProfileDocument, id, emailAddress, verificationValue)) {
     
    128148    try {
    129149      String urlSuffix       = IOPath.concat(userID, verificationValue, "/");
    130       String verificationURL = IOPath.concat(this.emailVerificationRequestPath, urlSuffix, "/");
     150      String verificationURL = IOPath.concat(this.baseEmailVerificationRequestPath, urlSuffix, "/");
    131151      emailVerificationService.sendMergedEmailMessage(
    132152        userEmailAddress,
  • trunk/ibisph/src/main/java/org/ibisph/web/ContextAndPathService.java

    r18692 r19891  
    5959  /**
    6060   * Core getter that provides access to the Spring Framework Web Application
    61    * Context.
     61   * Context.  Allows access to bean defs etc.
    6262   * @return Spring Framework Web Application Context.
    6363   */
     
    7575  /**
    7676   * Core getter that provides access to the standard servlet context.
     77   * Example "/ibisph-view"
    7778   * @return Standard Java Servlet Context.
    7879   */
     
    8283      throw new NullPointerException("ContextAndPathService.getServletContext - null servletContext.");
    8384    }
     85    logger.debug(".getServletContext -servletContext.getContextPath: {} ", servletContext.getContextPath());
    8486    return(servletContext);
    8587  } //-------------------------- End of Method ------------------------------
Note: See TracChangeset for help on using the changeset viewer.