Changeset 316:06b089ac1509

Show
Ignore:
Timestamp:
09/09/09 10:16:11 (4 years ago)
Author:
tgambet
Branch:
default
convert_revision:
svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@317
Message:

added some comments

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/org/w3c/unicorn/action/ObserveAction.java

    r313 r316  
    1 // $Id: ObserveAction.java,v 1.23 2009-09-08 15:46:44 tgambet Exp $ 
     1// $Id: ObserveAction.java,v 1.24 2009-09-09 10:16:11 tgambet Exp $ 
    22// Author: Jean-Guilhem Rouel 
    33// (c) COPYRIGHT MIT, ERCIM and Keio, 2006. 
     
    7373                        throws ServletException, IOException { 
    7474                 
     75                // Protects the action in case that Framework is not initialized 
    7576                super.doGet(req, resp); 
    7677                 
     78                // Objects initialization 
    7779                FileItem aFileItemUploaded = null; 
    7880                Map<String, Object> mapOfStringObject = new LinkedHashMap<String, Object>(); 
     
    8284                UnicornCall aUnicornCall = new UnicornCall(); 
    8385                 
     86                // Default output parameters 
    8487                mapOfOutputParameter.put("output", "simple"); 
    8588                mapOfOutputParameter.put("format", "xhtml10"); 
     
    8790                mapOfOutputParameter.put("mimetype", "text/html"); 
    8891                 
     92                // Retrieve parameter prefixes from unicorn.properties 
    8993                String paramPrefix = Property.get("UNICORN_PARAMETER_PREFIX"); 
    9094                String outParamPrefix = Property.get("UNICORN_PARAMETER_OUTPUT_PREFIX"); 
     95                 
     96                // queryString is the requested queryString without the ucn_lang parameter (used for language links) 
    9197                String queryString = getQueryStringWithout(paramPrefix + "lang", req); 
    92                  
    9398                mapOfStringObject.put("queryString", queryString); 
     99                // messages is the ArrayList containing the messages to display 
    94100                mapOfStringObject.put("messages", messages); 
    95101                 
     102                // Retrieve the parameters from the request 
    96103                Map<String, Object> reqParams; 
    97104                try { 
     
    102109                } 
    103110                 
     111                // Process the parameters 
    104112                for (String key : reqParams.keySet()) { 
    105113                        if (!key.startsWith(paramPrefix) && !key.startsWith(outParamPrefix)) { 
     
    182190                } 
    183191                 
     192                // Check that all mandatory parameters are set 
    184193                if (!reqParams.containsKey(paramPrefix + "lang")) { 
    185194                        String lang = getLanguage(null, req, null); 
     
    193202                                aUnicornCall.setLang(lang + "," + aLocale); 
    194203                } 
    195                  
    196204                if (!reqParams.containsKey(paramPrefix + "task")) { 
    197205                        String task = getTask(null, messages); 
     
    201209                        aUnicornCall.setTask(task); 
    202210                } 
    203                  
    204211                if (reqParams.containsKey(paramPrefix + "uri")) { 
    205212                        if (reqParams.get(paramPrefix + "uri").equals("")) { 
     
    230237                } 
    231238                 
     239                // Launch the observation 
    232240                try { 
    233241                        aUnicornCall.doTask(); 
     
    252260                doGet(req, resp); 
    253261        } 
    254  
     262         
    255263        private Map<String, Object> getRequestParameters(HttpServletRequest req) throws FileUploadException { 
    256264