[ 
https://issues.apache.org/jira/browse/WODEN-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478780
 ] 

John Kaputin commented on WODEN-148:
------------------------------------

HTTPLocation will become a lot bigger if I simply add variations of the 
existing methods to differentiate between Path and Query templates. Also, 
something else is needed to distinguish raw templates at encoding time and to 
identify their position in the formatted location string so that they won't be 
percent-encoded. 

So instead, I propose changing HTTPLocation so that the individual templates 
are encapsulated in a new type, HTTPLocationTemplate, which knows about 
substitution, whether the template is raw/encoded and in Path/Query, and the 
start position of the template within the location string. The existing methods 
in HTTPLocation for getting local names, substituting template values and 
getting template values will be replaced with various getter methods for 
HTTPLocationTemplates.

A message builder (e.g. Axis2) will be able to:
1. retrieve HTTPLocationTemplates from HTTPLocation
2. Specify element values for HTTPLocationTemplates
3. get the formatted HTTP location string from HTTPLocation
4. using the appropriate HTTPLocationTemplate objects, locate the substituted 
element values in the formatted string and identify them as raw/encoded and 
path/query.

My proposed class interfaces are:

HTTPLocation class:
public HTTPLocation(String templatedLocation)
public String getTemplatedLocation() 
public String getFormattedLocation() 
public String toString()       ...same as getFormattedLocation()
public int countTemplates()
public int countTemplates(String localName)
public HTTPLocationTemplate[] getTemplates()
public HTTPLocationTemplate[] getTemplatesInPath()
public HTTPLocationTemplate{} getTemplatesInQuery()
public HTTPLocationTemplate getTemplate(String localName)
public HTTPLocationTemplate[] getTemplates(String localName)

HTTPLocationTemplate class:
public HTTPLocation(String template)
public String getName()
public String getValue()
public String setValue()
public boolean isEncoded()   ...otherwise, 'raw'
public boolean isInQuery()    ...otherwise, in Path
public int getTemplatedPosition()
public int getFormattedPosition()

I'm going to start work on this and will post when there's code available to 
try out. Comments are welcome.

> HTTPLocation not parsed correctly
> ---------------------------------
>
>                 Key: WODEN-148
>                 URL: https://issues.apache.org/jira/browse/WODEN-148
>             Project: Woden
>          Issue Type: Bug
>            Reporter: Keith Godwin Chapman
>         Assigned To: John Kaputin
>
> This occurn in RawParameterEndpoint of LocationTemplate-2G. I instantiated 
> the HTTPLocation class with 
> axis2/services/ProbeDataService.RawParameterEndpoint/RawParameter{!fragment} 
> as the input parameter. But the httpLocation.getLocalNames(); returns an 
> empty array. When the same argument is given with the ! mark removed it gives 
> the expected result.
> Also it would be nice if HTTPLocation class can implement CR 117 too.
> Thanks,
> Keith.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to