com.ptc.wvs.server.util
Class WVSContentHelper

java.lang.Object
  extended bycom.ptc.wvs.server.util.WVSContentHelper

public class WVSContentHelper
extends Object


Nested Class Summary
static class WVSContentHelper.RepServer
           
 
Field Summary
private static boolean ACCESS_CHECK
           
private static String COID
           
private static String CS
           
private static String DEFAULT_REP_METHOD
           
private static String DOWNLOAD_CLASS
           
private static String DOWNLOAD_METHOD
           
private static String LOCATION_TAG
           
private static String OID
           
private static String REP_SERVER
           
private static boolean SERVER
           
private static boolean USE_REPLICATION
           
private static boolean USE_WVS_SERVLET
           
private static boolean VERBOSE
           
 
Constructor Summary
WVSContentHelper()
           
 
Method Summary
static URL getDefaultRepURL(Persistable p, int configType, WTContainerRef containerRef)
          Get the redirect URL to servlet that will find the default representation and redirect to the view url of the ed file for that representation

Supported API: false
static URL getDownloadURL(ApplicationData appData, ContentHolder holder)
          Get the download URL to servlet that will lookup the replcia site at download time, as opposed to the look up at time when URL is generated as with getViewContentURL.
static String getDownloadURLForType(ContentHolder doc, ContentRoleType role)
          Get the download URL to servlet that will lookup the replcia site at download time, as opposed to the look up at time when URL is generated as with getViewContentURL.
static WTKeyedMap getDownloadURLForType(WTCollection collection, ContentRoleType role)
           
static URL getViewContentURL(ApplicationData appData, ContentHolder holder)
          Get the view URL.
static void main(String[] args)
           
static void redirectDefaultRep(HTTPRequest request, HTTPResponse response)
          The method redirects to the ed file of the default Representatino
static void redirectDownload(HTTPRequest request, HTTPResponse response)
          The method redirects downloading of content.
private static void replicateCH(String oid, String sitename, String vaultname)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOWNLOAD_CLASS

private static final String DOWNLOAD_CLASS
See Also:
Constant Field Values

DOWNLOAD_METHOD

private static final String DOWNLOAD_METHOD
See Also:
Constant Field Values

DEFAULT_REP_METHOD

private static final String DEFAULT_REP_METHOD
See Also:
Constant Field Values

LOCATION_TAG

private static final String LOCATION_TAG
See Also:
Constant Field Values

OID

private static final String OID
See Also:
Constant Field Values

CS

private static final String CS
See Also:
Constant Field Values

COID

private static final String COID
See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE

USE_REPLICATION

private static boolean USE_REPLICATION

USE_WVS_SERVLET

private static boolean USE_WVS_SERVLET

ACCESS_CHECK

private static boolean ACCESS_CHECK

REP_SERVER

private static final String REP_SERVER

SERVER

private static final boolean SERVER
Constructor Detail

WVSContentHelper

public WVSContentHelper()
Method Detail

getViewContentURL

public static URL getViewContentURL(ApplicationData appData,
                                    ContentHolder holder)
                             throws WTException
Get the view URL. This will return a URL to the master of the replic site If a replica URL is returned it will only be valid for a short time, so this should only be used when the URL will be used immediatly.

Supported API: false

Returns:
URL
Throws:
WTException

getDownloadURLForType

public static String getDownloadURLForType(ContentHolder doc,
                                           ContentRoleType role)
Get the download URL to servlet that will lookup the replcia site at download time, as opposed to the look up at time when URL is generated as with getViewContentURL.

Supported API: false

Returns:
String
Throws:
WTException

getDownloadURLForType

public static WTKeyedMap getDownloadURLForType(WTCollection collection,
                                               ContentRoleType role)

getDownloadURL

public static URL getDownloadURL(ApplicationData appData,
                                 ContentHolder holder)
                          throws WTException
Get the download URL to servlet that will lookup the replcia site at download time, as opposed to the look up at time when URL is generated as with getViewContentURL.

Supported API: false

Returns:
URL
Throws:
WTException

redirectDownload

public static void redirectDownload(HTTPRequest request,
                                    HTTPResponse response)
                             throws WTException,
                                    IOException,
                                    PropertyVetoException
The method redirects downloading of content. The method checks if there are alternative places to download content from. If there are it does a HTTP 302 redirect to the first of the alternatives If there are no alternative locations for the content it calls to ContentHttp.viewContent method that downloads from the master site. this differes from wt.fv.master.RedirectDownload.redirectDownload, in that this does a real redirect when that does a custom redirect by generating a special html page which the client must process. As the client here is ProductView which uses the web browser to fetch URLs them client processing is inappropriate. Other than the actaul redirect mechanism, this method is a clone of the above.

Supported API: false

Parameters:
request -
response -
Throws:
WTException
IOException
PropertyVetoException

getDefaultRepURL

public static URL getDefaultRepURL(Persistable p,
                                   int configType,
                                   WTContainerRef containerRef)
                            throws WTException
Get the redirect URL to servlet that will find the default representation and redirect to the view url of the ed file for that representation

Supported API: false

Parameters:
p -
configType -
containerRef -
Returns:
URL
Throws:
WTException

redirectDefaultRep

public static void redirectDefaultRep(HTTPRequest request,
                                      HTTPResponse response)
                               throws WTException,
                                      IOException,
                                      PropertyVetoException
The method redirects to the ed file of the default Representatino

Parameters:
request -
response -
Throws:
WTException
IOException
PropertyVetoException

main

public static void main(String[] args)

replicateCH

private static void replicateCH(String oid,
                                String sitename,
                                String vaultname)
                         throws WTException
Throws:
WTException