portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/template JetspeedTemplateLocatorService.java
Date Sat, 17 Aug 2002 00:42:19 GMT
taylor      2002/08/16 17:42:19

  Modified:    src/java/org/apache/jetspeed/services/template
                        JetspeedTemplateLocatorService.java
  Log:
  - Added ability for template locator service to locate templates using media type parameters
    (This could be extended similiarly for language parameters)
  
  Revision  Changes    Path
  1.11      +8 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/services/template/JetspeedTemplateLocatorService.java
  
  Index: JetspeedTemplateLocatorService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/template/JetspeedTemplateLocatorService.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JetspeedTemplateLocatorService.java	28 Jun 2002 05:37:36 -0000	1.10
  +++ JetspeedTemplateLocatorService.java	17 Aug 2002 00:42:19 -0000	1.11
  @@ -93,6 +93,7 @@
   // jetspeed.services
   import org.apache.jetspeed.services.resources.JetspeedResources;
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
  +import org.apache.jetspeed.services.Profiler;
   
   /**
    * <p>Implements all template location related operations.
  @@ -572,10 +573,14 @@
           data.getUser().setTemp("locale", tmplocale);
   
           StringBuffer templatePath = new StringBuffer();
  -
  +                                                   
           // set the content type (including charset)
  +        String type = data.getParameters().getString(Profiler.PARAM_MEDIA_TYPE, null);
           CapabilityMap cm = CapabilityMapFactory.getCapabilityMap( data );
  -        String type = cm.getPreferredType().getCode();
  +        if (null == type)
  +        {
  +            type = cm.getPreferredType().getCode();
  +        }
           //data.setContentType( cm.getPreferredType().toString() );  
           if ((type != null) && (type.length() > 0)) 
               templatePath.append(PATH_SEPARATOR).append(type);
  
  
  

--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message