com.ptc.netmarkets.rule
Class NmRuleCommands

java.lang.Object
  extended bycom.ptc.netmarkets.rule.NmRuleCommands

public class NmRuleCommands
extends Object



Supported API: false

Extendable: false


Field Summary
private static String CLASSNAME
           
private static String CONTENT_DISPOSITION
           
private static String CONTENT_LENGTH
           
private static String DEFAULT_DOWNLOAD_COMPOSITE_ACTION
           
private static String DEFAULT_DOWNLOAD_FILENAME
           
private static int DEFAULT_DOWNLOAD_TIMEOUT
           
private static String DOWNLOAD_COMPOSITE_ACTION
           
private static int DOWNLOAD_TIMEOUT
           
private static String DTD_FILE_EXT
           
private static String RESOURCE
           
private static String SERVER_CODEBASE
           
private static String WT_HOME
           
private static String XML_FILE_EXT
           
private static String XML_MIME_TYPE
           
 
Constructor Summary
NmRuleCommands()
           
 
Method Summary
private static String addQueryParam(String url, String name, Hashtable values, EncodingConverter encoder, boolean first)
          Adds the parameter named name to the specified url.
static NmChangeModel[] create(NmCommandBean cb)
          Create a new rule using the data provided in the request.
static NmChangeModel[] disable(NmCommandBean cb)
          Disable the specified rule (if it is not already disabled).
static void download(NmCommandBean cb)
          Download the XML contents of the rule to the client.
private static void download(NmRule rule, javax.servlet.http.HttpServletResponse response)
           
static void downloadComposite(NmCommandBean cb)
          Download the XML for the composite rule for the specified type to the client.
static void downloadDTD(NmCommandBean cb)
          Download the INIT rule DTD to the client.
static NmChangeModel[] enable(NmCommandBean cb)
          Enable the specified rule (if it is not already enabled).
private static String getDownloadCompositeURL(Hashtable params)
          Create the URL that can be used to generate the composite rule XML.
static NmRule getRuleProperties(NmCommandBean cb)
          Get a NmRule object for the rule specified in the request.
static NmRule getRuleProperties(NmCommandBean cb, boolean includeContents)
          Get a NmRule object for the rule specified in the request.
static NmHTMLTable list(NmCommandBean cb)
          Produce a table listing of the rules that exist in a particular container.
static ArrayList listRulesForType(String className, NmOid projectOid)
          

Supported API: false
static void requestDownloadComposite(NmCommandBean cb)
          Request that the XML for a composite rule be downloaded to the client.
static NmChangeModel[] update(NmCommandBean cb)
          Update the rule using the data contained in the equest.
static NmModel view(NmCommandBean cb)
          

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

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

CONTENT_DISPOSITION

private static final String CONTENT_DISPOSITION
See Also:
Constant Field Values

CONTENT_LENGTH

private static final String CONTENT_LENGTH
See Also:
Constant Field Values

XML_MIME_TYPE

private static final String XML_MIME_TYPE
See Also:
Constant Field Values

XML_FILE_EXT

private static final String XML_FILE_EXT
See Also:
Constant Field Values

DTD_FILE_EXT

private static final String DTD_FILE_EXT
See Also:
Constant Field Values

DEFAULT_DOWNLOAD_FILENAME

private static final String DEFAULT_DOWNLOAD_FILENAME
See Also:
Constant Field Values

DOWNLOAD_TIMEOUT

private static final int DOWNLOAD_TIMEOUT

DEFAULT_DOWNLOAD_TIMEOUT

private static final int DEFAULT_DOWNLOAD_TIMEOUT
See Also:
Constant Field Values

DOWNLOAD_COMPOSITE_ACTION

private static final String DOWNLOAD_COMPOSITE_ACTION

DEFAULT_DOWNLOAD_COMPOSITE_ACTION

private static final String DEFAULT_DOWNLOAD_COMPOSITE_ACTION
See Also:
Constant Field Values

SERVER_CODEBASE

private static final String SERVER_CODEBASE

WT_HOME

private static final String WT_HOME
Constructor Detail

NmRuleCommands

public NmRuleCommands()
Method Detail

create

public static NmChangeModel[] create(NmCommandBean cb)
                              throws WTException
Create a new rule using the data provided in the request.

Supported API: false

Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

download

public static void download(NmCommandBean cb)
                     throws WTException,
                            IOException
Download the XML contents of the rule to the client.

Supported API: false

Parameters:
cb -
Throws:
WTException
IOException

enable

public static NmChangeModel[] enable(NmCommandBean cb)
                              throws WTException
Enable the specified rule (if it is not already enabled).

Supported API: false

Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

disable

public static NmChangeModel[] disable(NmCommandBean cb)
                               throws WTException
Disable the specified rule (if it is not already disabled).

Supported API: false

Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

list

public static NmHTMLTable list(NmCommandBean cb)
                        throws WTException
Produce a table listing of the rules that exist in a particular container.

Supported API: false

Parameters:
cb -
Returns:
NmHTMLTable
Throws:
WTException

update

public static NmChangeModel[] update(NmCommandBean cb)
                              throws WTException
Update the rule using the data contained in the equest.

Supported API: false

Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

getRuleProperties

public static NmRule getRuleProperties(NmCommandBean cb)
                                throws WTException
Get a NmRule object for the rule specified in the request. Don't include the XML contents in the returned NmRule.

Supported API: false

Parameters:
cb -
Returns:
NmRule
Throws:
WTException

getRuleProperties

public static NmRule getRuleProperties(NmCommandBean cb,
                                       boolean includeContents)
                                throws WTException
Get a NmRule object for the rule specified in the request. Include the XML contents in the returned NmRule if includeContents is true. Otherwise, omit the XML contents.

Supported API: false

Parameters:
cb -
includeContents - if true, include rule's the XML contents in the returned NmRule
Returns:
NmRule
Throws:
WTException

listRulesForType

public static ArrayList listRulesForType(String className,
                                         NmOid projectOid)
                                  throws WTException


Supported API: false

Parameters:
className -
projectOid -
Returns:
ArrayList
Throws:
WTException

downloadDTD

public static void downloadDTD(NmCommandBean cb)
                        throws WTException
Download the INIT rule DTD to the client.

Supported API: false

Parameters:
cb - the command bean
Throws:
WTException

requestDownloadComposite

public static void requestDownloadComposite(NmCommandBean cb)
                                     throws WTException,
                                            IOException
Request that the XML for a composite rule be downloaded to the client.

Supported API: false

Parameters:
cb - the command bean
Throws:
WTException
IOException

downloadComposite

public static void downloadComposite(NmCommandBean cb)
                              throws WTException,
                                     IOException
Download the XML for the composite rule for the specified type to the client.

Supported API: false

Parameters:
cb - the command bean
Throws:
WTException
IOException

getDownloadCompositeURL

private static final String getDownloadCompositeURL(Hashtable params)
Create the URL that can be used to generate the composite rule XML.

Parameters:
params - the request parameters
Returns:
the URL to generate the import request XML

addQueryParam

private static final String addQueryParam(String url,
                                          String name,
                                          Hashtable values,
                                          EncodingConverter encoder,
                                          boolean first)
Adds the parameter named name to the specified url. The new url is returned.


download

private static final void download(NmRule rule,
                                   javax.servlet.http.HttpServletResponse response)
                            throws IOException
Throws:
IOException

view

public static NmModel view(NmCommandBean cb)
                    throws WTException


Supported API: false

Parameters:
cb -
Returns:
NmModel
Throws:
WTException