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/util PSMLManager.java
Date Wed, 25 Apr 2001 00:06:45 GMT
taylor      01/04/24 17:06:45

  Modified:    src/java/org/apache/jetspeed/util PSMLManager.java
  Log:
  ProfileException must be caught
  
  Revision  Changes    Path
  1.5       +30 -25    jakarta-jetspeed/src/java/org/apache/jetspeed/util/PSMLManager.java
  
  Index: PSMLManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/PSMLManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PSMLManager.java	2001/03/07 06:49:57	1.4
  +++ PSMLManager.java	2001/04/25 00:06:44	1.5
  @@ -116,17 +116,17 @@
           }
           
           // Get the URL to the appopriate PSML file
  -        String url;
  -        if (JetspeedResources.getBoolean("services.ProfileManager.enable", false))
  -        {
  -            Profile profile = ProfileManager.getProfile( data, mimetype );
  -            url = profile.getURL();
  -        }
  -        else
  -            url = profiler.getUserURL(username, mimetype);
  -
  +        String url = null;
           try
           {
  +            if (JetspeedResources.getBoolean("services.ProfileManager.enable", false))
  +            {
  +                Profile profile = ProfileManager.getProfile( data, mimetype );
  +                url = profile.getURL();
  +            }
  +            else
  +                url = profiler.getUserURL(username, mimetype);
  +
               // Test if the PSML file exists
               DiskCacheEntry pde = JetspeedDiskCache.getInstance().getEntry( url );
       
  @@ -140,8 +140,13 @@
               Log.note("Profiled URL doesn't exist, using default");
               if (JetspeedResources.getBoolean("services.ProfileManager.enable", false))
               {
  -                Profile profile = ProfileManager.getProfile( null, mimetype );
  -                url = profile.getURL();
  +                try
  +                {
  +                    Profile profile = ProfileManager.getProfile( null, mimetype );
  +                    url = profile.getURL();
  +                }
  +                catch (ProfileException ex)
  +                {} // url will be null
               }
               else
                   url = profiler.getUserURL(null, mimetype);
  @@ -209,24 +214,24 @@
           }
   
           String url ;
  -         if (JetspeedResources.getBoolean("services.ProfileManager.enable", false))
  -         {
  -            Profile profile = ProfileManager.getProfile( data, mimetype );
  -            url = profile.getURL();
  -         }
  -         else
  -            url = profiler.getUserURL(username, mimetype);
  -        if (url == null)
  +        try
           {
  -            Log.error("PSMLManager: Could not resolve URL of user's PSML file!");
  -            return false;
  -        }
  +             if (JetspeedResources.getBoolean("services.ProfileManager.enable", false))
  +             {
  +                Profile profile = ProfileManager.getProfile( data, mimetype );
  +                url = profile.getURL();
  +             }
  +             else
  +                url = profiler.getUserURL(username, mimetype);
  +            if (url == null)
  +            {
  +                Log.error("PSMLManager: Could not resolve URL of user's PSML file!");
  +                return false;
  +            }
       
  -        Log.note("PSMLManager: Writing "+username+"'s PSML for '"+mimetype.toString()+"'
to '"+url+"'");
  +            Log.note("PSMLManager: Writing "+username+"'s PSML for '"+mimetype.toString()+"'
to '"+url+"'");
       
       
  -        try
  -        {
               DiskCacheEntry pde = JetspeedDiskCache.getInstance().getEntry( url );
               java.io.Writer out = pde.getWriter();
               portlets.marshal(out);
  
  
  

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


Mime
View raw message