Skip navigation links


com.fatwire.cs.core.uri
Class QueryAsPathInfoAssembler

java.lang.Object
  extended by com.fatwire.cs.core.uri.AbstractAssembler
      extended by com.fatwire.cs.core.uri.QueryAssembler
          extended by com.fatwire.cs.core.uri.QueryAsPathInfoAssembler

All Implemented Interfaces:
Assembler

public class QueryAsPathInfoAssembler
extends QueryAssembler

This assembler creates a URL without a query string. This is done by appending the query string and appending it to the servlet context path as path-info. This does not produce particulary nice-looking URLs, but because the URL appears to have no dynamic parameters, web bots like the googlebot are more likely to index these pages. No guarantees as to search engine indexability are made here, but reasonable logic indicates that URLs created with this appender will be indexable.

Since:
20-Oct-2004 3:04:26 PM

Nested Class Summary
protected static class QueryAsPathInfoAssembler.PathInfo
          Simple class containing information embedded in the pathinfo.
protected static class QueryAsPathInfoAssembler.QAPIDisassemblyContext
           

 

Nested classes/interfaces inherited from class com.fatwire.cs.core.uri.AbstractAssembler
AbstractAssembler.AssemblyContext, AbstractAssembler.DisassemblyContext

 

Field Summary

 

Fields inherited from class com.fatwire.cs.core.uri.AbstractAssembler
PAGENAME

 

Fields inherited from interface com.fatwire.cs.core.uri.Assembler
LOG_NAME, PROP_PATH_PREFIX, PROP_URIBASE_BLOB_SERVER, PROP_URIBASE_CACHE_SERVER, PROP_URIBASE_CATALOG_MANAGER, PROP_URIBASE_CONTENT_SERVER, PROP_URIBASE_COOKIE_SERVER, PROP_URIBASE_DISPATCH_MANAGER, PROP_URIBASE_PAGE_DISPATCH_SERVER, PROP_URIBASE_SATELLITE_SERVER, PROP_URIBASE_SEED_DISPATCH_SERVER, PROP_URIBASE_SYNC_SEED_DISPATCH_SERVER, PROP_URIBASE_TREE_MANAGER

 

Constructor Summary
QueryAsPathInfoAssembler()
           

 

Method Summary
 java.net.URI assemble(Definition def)
          Constructs a URI from the Definition provided.
protected  Definition.AppType getAppType(AbstractAssembler.DisassemblyContext ctx)
          This method uses the PathInfo object to get the AppType found on the URI.
protected  AbstractAssembler.DisassemblyContext getDisassemblyContext(java.net.URI uri)
          This method tries to create a QueryAsPathInfoAssembler.PathInfo object by calling QueryAsPathInfoAssembler.parsePath(java.lang.String).
 java.lang.String getPath(AbstractAssembler.AssemblyContext def)
          This method calls super.getPath() and encode(super.getQuery()) and appends them together.
protected  java.lang.String getQuery(AbstractAssembler.AssemblyContext def)
          Returns the query string.
protected  java.util.Map getQuery(AbstractAssembler.DisassemblyContext ctx)
          This method uses the PathInfo object to get the query parameters
protected  Definition.SatelliteContext getSatelliteContext(AbstractAssembler.DisassemblyContext ctx)
          This method uses the PathInfo object to get the Satellitecontext
protected  QueryAsPathInfoAssembler.PathInfo parsePath(java.lang.String path)
          Parse the path from the uriDefinition and get back a PathInfo data object containing all the useful info that was encoded in the path.

 

Methods inherited from class com.fatwire.cs.core.uri.QueryAssembler
getAuthority, getAuthority, getFragment, getFragment, getPathForApp, getPathForSatelliteServer, getScheme, getScheme, getSessionEncode

 

Methods inherited from class com.fatwire.cs.core.uri.AbstractAssembler
decode, decode, disassemble, encode, getAssemblyContext, getLog, getProperty, parseQueryString, setProperties

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

QueryAsPathInfoAssembler

public QueryAsPathInfoAssembler()

Method Detail

getPath

public java.lang.String getPath(AbstractAssembler.AssemblyContext def)
This method calls super.getPath() and encode(super.getQuery()) and appends them together.
Overrides:
getPath in class QueryAssembler
Parameters:
def -
Returns:
the path

getQuery

protected java.lang.String getQuery(AbstractAssembler.AssemblyContext def)
Returns the query string. This assembler encodes the query string in the path. As a result, this method will always return null.
Overrides:
getQuery in class QueryAssembler
Parameters:
def - Definition
Returns:
null always
See Also:
Encode provides a helpful method for quoting illegal characters in the query string.

getDisassemblyContext

protected AbstractAssembler.DisassemblyContext getDisassemblyContext(java.net.URI uri)
This method tries to create a QueryAsPathInfoAssembler.PathInfo object by calling QueryAsPathInfoAssembler.parsePath(java.lang.String). If it gets one, it creates a QAPIDisassemblyContext object using the {@link PathInfo} returned. If it fails to get back a {@link PathInfo} then it sets the foreign flag in the superclass' implementation of {@link DisassemblyContext}.
Overrides:
getDisassemblyContext in class AbstractAssembler
Parameters:
uri -
Returns:

parsePath

protected QueryAsPathInfoAssembler.PathInfo parsePath(java.lang.String path)
Parse the path from the uriDefinition and get back a PathInfo data object containing all the useful info that was encoded in the path.
Parameters:
path - the uri path
Returns:
pathinfo or null if ownership not ours.

getAppType

protected Definition.AppType getAppType(AbstractAssembler.DisassemblyContext ctx)
This method uses the PathInfo object to get the AppType found on the URI.
Overrides:
getAppType in class QueryAssembler
Parameters:
ctx - DisassemblyContext object containing the URI, context parameters, and a flag inidicating whether or not this assembler is capable of disassembling this URI.
Returns:
See Also:
QueryAsPathInfoAssembler.parsePath(String)

getSatelliteContext

protected Definition.SatelliteContext getSatelliteContext(AbstractAssembler.DisassemblyContext ctx)
This method uses the PathInfo object to get the Satellitecontext
Overrides:
getSatelliteContext in class QueryAssembler
Parameters:
ctx - DisassemblyContext object containing the URI, context parameters, and a flag inidicating whether or not this assembler is capable of disassembling this URI.
Returns:
See Also:
QueryAsPathInfoAssembler.parsePath(String)

getQuery

protected java.util.Map getQuery(AbstractAssembler.DisassemblyContext ctx)
This method uses the PathInfo object to get the query parameters
Overrides:
getQuery in class QueryAssembler
Parameters:
ctx - DisassemblyContext object containing the URI, context parameters, and a flag inidicating whether or not this assembler is capable of disassembling this URI.
Returns:
See Also:
QueryAsPathInfoAssembler.parsePath(String)

assemble

public java.net.URI assemble(Definition def)
                      throws java.net.URISyntaxException
Description copied from class: AbstractAssembler
Constructs a URI from the Definition provided. Individual arguments are determined by invoking the corresponding getter methods in this class. Overriding classes may either override this method or one or more of the corresponding getter methods.

The components do not need to be encoded as this method will encode all values that require encoding.

The corresponding methods are called in the following order:

  1. AbstractAssembler.getAssemblyContext(Definition)
  2. AbstractAssembler.getScheme(AssemblyContext)
  3. AbstractAssembler.getAuthority(AssemblyContext)
  4. AbstractAssembler.getPath(AssemblyContext)
  5. AbstractAssembler.getQuery(AssemblyContext)
  6. AbstractAssembler.getFragment(AssemblyContext)
and the AssemblyContext object is not modified by this method. It is the same object in all of these methods. Most subclasses will not need to override this method, and should instead override the getter methods specified above instead.
Specified by:
assemble in interface Assembler
Overrides:
assemble in class AbstractAssembler
Parameters:
def - The definition to convert to a URI
Returns:
assembled URI
Throws:
java.net.URISyntaxException - if the definition contains illegal data
See Also:
http://www.ietf.org/rfc/rfc2396.txt, AbstractAssembler.encode(String), AbstractAssembler.decode(String)

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.