org.xwiki.url.internal.standard
Class StandardXWikiURLFactory

java.lang.Object
  extended by org.xwiki.url.internal.standard.StandardXWikiURLFactory
All Implemented Interfaces:
XWikiURLFactory<java.net.URL>

@Component(value="standard")
public class StandardXWikiURLFactory
extends java.lang.Object
implements XWikiURLFactory<java.net.URL>

There are 2 possibilities:

Since:
2.3M1
Version:
$Id$

Constructor Summary
StandardXWikiURLFactory()
           
 
Method Summary
 XWikiURL createURL(java.net.URL url, java.util.Map<java.lang.String,java.lang.Object> parameters)
          

Supported parameters: "ignorePrefix": the starting part of the URL Path (i.e.

protected  java.util.List<java.lang.String> extractPathSegments(java.lang.String rawPath)
          Extract segments between "/" characters in the passed path.
protected  WikiReference extractWikiReference(java.net.URI uri, org.xwiki.url.internal.standard.StandardXWikiURLFactory.URLParsingState state)
          Extract the name of the wiki the URL is pointing to.
protected  XWikiURLType getXWikiURLType(java.lang.String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardXWikiURLFactory

public StandardXWikiURLFactory()
Method Detail

createURL

public XWikiURL createURL(java.net.URL url,
                          java.util.Map<java.lang.String,java.lang.Object> parameters)
                   throws InvalidURLException

Supported parameters:

Specified by:
createURL in interface XWikiURLFactory<java.net.URL>
Throws:
InvalidURLException
See Also:
XWikiURLFactory.createURL(Object, java.util.Map)

extractPathSegments

protected java.util.List<java.lang.String> extractPathSegments(java.lang.String rawPath)
Extract segments between "/" characters in the passed path. Also remove any path parameters (i.e. content after ";" in a path segment; for ex ";jsessionid=...") since we don't want to have these params in the segments we return and act on (otherwise we would get them in document names for example). Note that we only remove ";" characters when they are not URL-encoded. We want to allow the ";" character to be in document names for example.


extractWikiReference

protected WikiReference extractWikiReference(java.net.URI uri,
                                             org.xwiki.url.internal.standard.StandardXWikiURLFactory.URLParsingState state)
Extract the name of the wiki the URL is pointing to. For domain-based multiwiki setups we ask a resolver to resolve the URL's host name. For path-based multiwiki setup we get the path segment after the first segment, if this first segment has the predefined StandardURLConfiguration.getWikiPathPrefix() value. If not then we fall-back to domain-based multiwiki setups and resolve with the URL's host name.

Returns:
the wiki the URL is pointing to, returned as a WikiReference.

getXWikiURLType

protected XWikiURLType getXWikiURLType(java.lang.String type)
                                throws InvalidURLException
Throws:
InvalidURLException


Copyright © 2004-2011 XWiki. All Rights Reserved.