Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2005 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.content
Class ContentHelper

    java.lang.Object
      com.bea.p13n.content.ContentHelper

public class ContentHelper
extends Object

Helper class for dealing with Content, ContentManagers, and the possible subclasses.

Field Summary
`static String` | `DEF_CONTENT_HOME` Deprecated. Use DEF_CONTENT_MANAGER_HOME instead.
`static String` | `DEF_CONTENT_MANAGER_HOME` Deprecated. The default ContentManagerHome name.
`static boolean` | `DEF_CONTENT_READONLY` Deprecated. No longer needed.
`static String` | `DEF_CONTENT_SCHEMA_HOME` Deprecated. Use PropertySetManager and ejb-refs instead.
`static String` | `DEF_DOCUMENT_HOME` Deprecated. Use DEF_DOCUMENT_MANAGER_HOME instead.
`static String` | `DEF_DOCUMENT_MANAGER_HOME` Deprecated. The default DocumentManagerHome name.
`static String` | `DEF_DOCUMENT_SCHEMA_HOME` Deprecated. Use PropertySetManager and ejb-refs instead.
`static boolean` | `USE_SOFT_HASH_MAP` Deprecated. No longer needed.

Constructor Summary
`ContentHelper()` Deprecated.

Method Summary
`static Content[]` | `getContent(String homeName, Search s)` Deprecated. Return an array of Content from the ContentManager at the given name.
`static Content[]` | `getContent(String homeName, Search s)` Deprecated. Use new Search instead
`static Content[]` | `getContent(String homeName, Search s, boolean readOnly)` Deprecated. Use getContent(String, Search) instead.
`static Content[]` | `getContent(String homeName, Search s, boolean readOnly)` Deprecated. Use new content expressions and getContent(String, Search) instead.
`static Enumeration` | `getContentFromManager(String homeName, EJBHome home, Search s)` Deprecated. use getContentManager(homeName, home).getContent(s) instead.
`static Enumeration` | `getContentFromManager(String homeName, EJBHome home, Search s)` Deprecated. use new content search and getContentManager(homeName, home).getContent(s) instead.
`static Enumeration` | `getContentFromManager(String homeName, EJBHome home, Search s, boolean readOnly)` Deprecated. Use getContentManager(homeName, home).getContent(s);
`static Enumeration` | `getContentFromManager(String homeName, EJBHome home, Search s, boolean readOnly)` Deprecated. Use new content expressions and getContentManager(homeName, home).getContent(s);
`static Collection` | `getContentIds(String homeName, Search s)` Deprecated. Return an rray of Content from the ContentManager or ContentHome at the given name.
`static int` | `getContentLength(long docSize, int bytesLen)` Deprecated. Return the correct content length.
`static ContentManager` | `getContentManager(String homeName)` Deprecated. Get a ContentManager from a JNDI home name.
`static ContentManager` | `getContentManager(String homeName, EJBHome home)` Deprecated. Get a ContentManager from an EJBHome.
`static String` | `pathInfoEncode(String pathInfo)` Deprecated. Correctly URLEncode a path-info string.
`static Content[]` | `toArray(Enumeration e)` Deprecated. Turn an Enumeration of Content into an array.
`static String` | `toHTML(String in)` Deprecated. Convert an arbitrary string to HTML which will display as the original string intended.

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

Field Detail

### DEF_CONTENT_HOME

    public static final String DEF_CONTENT_HOME

  Deprecated. Use DEF_CONTENT_MANAGER_HOME instead.

  The default ContentHome name (always null).

### DEF_CONTENT_MANAGER_HOME

    public static final String DEF_CONTENT_MANAGER_HOME

  Deprecated.
  The default ContentManagerHome name.

  This points to "java:comp/env/ejb/ContentManager", which is the closest <ejb-ref>'ed ContentManager home. The <ejb-ref> should be configured either in your EJB ejb-jar.xml deployment descriptor or in your webapp's web.xml deployment descriptor.

  See Also:
    Constant Field Values

### DEF_CONTENT_READONLY

    public static final boolean DEF_CONTENT_READONLY

  Deprecated. No longer needed.

  The default readonly flag for getting Content.

  See Also:
    Constant Field Values

### DEF_CONTENT_SCHEMA_HOME

    public static final String DEF_CONTENT_SCHEMA_HOME

  Deprecated. Use PropertySetManager and ejb-refs instead.

  The default Content SchemaHome name.

  See Also:
    Constant Field Values

### DEF_DOCUMENT_HOME

    public static final String DEF_DOCUMENT_HOME

  Deprecated. Use DEF_DOCUMENT_MANAGER_HOME instead.

  The default DocumentHome name (always null).

### DEF_DOCUMENT_MANAGER_HOME

    public static final String DEF_DOCUMENT_MANAGER_HOME

  Deprecated.
  The default DocumentManagerHome name.

  This points to "java:comp/env/ejb/DocumentManager", which is the closest <ejb-ref>'ed DocumentManager home. The <ejb-ref> should be configured either in your EJB ejb-jar.xml deployment descriptor or in your webapp's web.xml deployment descriptor.

  See Also:
    Constant Field Values

### DEF_DOCUMENT_SCHEMA_HOME

    public static final String DEF_DOCUMENT_SCHEMA_HOME

  Deprecated. Use PropertySetManager and ejb-refs instead.

  The default Document SchemaHome name.

  See Also:
    Constant Field Values

### USE_SOFT_HASH_MAP

    public static boolean USE_SOFT_HASH_MAP

  Deprecated. No longer needed.

  Should caches use a SoftHashMap or not (always false).

Constructor Detail

### ContentHelper

    public ContentHelper()

  Deprecated.

Method Detail

### getContent

    public static Content[] getContent(String homeName,
                                       Search s)
                                throws NamingException,
                                       RemoteException,
                                       FinderException,
                                       IllegalArgumentException

  Deprecated.
  Return an array of Content from the ContentManager at the given name.

  If homeName points to a home for a ContentManager (or subclass), then the home's create() method will be invoked and the ContentManager's getContent() method will be used. The resulting enumeration will be put into an array.

  Throws:
    `NamingException` - thrown if home cannot be found.
    `RemoteException` - thrown on communications error.
    `FinderException` - thrown on error in findBySearchParams (never thrown)
    `IllegalArgumentException` - thrown on any other error.
  See Also:
    `getContentManager(java.lang.String)`

### getContent

    public static Content[] getContent(String homeName,
                                       Search s)
                                throws NamingException,
                                       RemoteException,
                                       FinderException,
                                       IllegalArgumentException

  Deprecated. Use new Search instead

  Return an array of Content from the ContentManager at the given name.

  If homeName points to a home for a ContentManager (or subclass), then the home's create() method will be invoked and the ContentManager's getContent() method will be used. The resulting enumeration will be put into an array.

  Throws:
    `NamingException` - thrown if home cannot be found.
    `RemoteException` - thrown on communications error.
    `FinderException` - thrown on error in findBySearchParams (never thrown)
    `IllegalArgumentException` - thrown on any other error.
  See Also:
    `getContentManager(java.lang.String)`, `Search`

### getContent

    public static Content[] getContent(String homeName,
                                       Search s,
                                       boolean readOnly)
                                throws NamingException,
                                       RemoteException,
                                       FinderException,
                                       IllegalArgumentException

  Deprecated. Use getContent(String, Search) instead.

  Return an array of Content from the ContentManager or ContentHome at the given name.

  If homeName points to a home for a ContentManager (or subclass), then the home's create() method will be invoked and the ContentManager's getContent() method will be used. If homeName points to a home for Content (or subclasses), then it's findBySearchParams() method will used. The resulting enumeration will be put into an array.

  Throws:
    `NamingException` - thrown if home cannot be found.
    `RemoteException` - thrown on communications error.
    `FinderException` - thrown on error in findBySearchParams
    `IllegalArgumentException` - thrown on any other error.
  See Also:
    `getContent(java.lang.String, com.bea.p13n.content.expression.Search)`

### getContent

    public static Content[] getContent(String homeName,
                                       Search s,
                                       boolean readOnly)
                                throws NamingException,
                                       RemoteException,
                                       FinderException,
                                       IllegalArgumentException

  Deprecated. Use new content expressions and getContent(String, Search) instead.

  Return an array of Content from the ContentManager or ContentHome at the given name.

  If homeName points to a home for a ContentManager (or subclass), then the home's create() method will be invoked and the ContentManager's getContent() method will be used. If homeName points to a home for Content (or subclasses), then it's findBySearchParams() method will used. The resulting enumeration will be put into an array.

  Throws:
    `NamingException` - thrown if home cannot be found.
    `RemoteException` - thrown on communications error.
    `FinderException` - thrown on error in findBySearchParams
    `IllegalArgumentException` - thrown on any other error.
  See Also:
    `getContent(java.lang.String, com.bea.p13n.content.expression.Search)`

### getContentFromManager

    public static Enumeration getContentFromManager(String homeName,
                                                    EJBHome home,
                                                    Search s)
                                             throws RemoteException,
                                                    IllegalArgumentException

  Deprecated. use getContentManager(homeName, home).getContent(s) instead.

  Search for content from a ContentManager.

  Parameters:
    `homeName` - the JNDI home name (used for errors).
    `home` - the EJBHome of the ContentManager.
    `s` - the search parameters.
  Returns:
    the Enumeration of Content which match the search.
  Throws:
    `RemoteException`
    `IllegalArgumentException`
  See Also:
    `getContentManager(java.lang.String, javax.ejb.EJBHome)`

### getContentFromManager

    public static Enumeration getContentFromManager(String homeName,
                                                    EJBHome home,
                                                    Search s)
                                             throws RemoteException,
                                                    IllegalArgumentException

  Deprecated. use new content search and getContentManager(homeName, home).getContent(s) instead.

  Search for content from a ContentManager.

  Parameters:
    `homeName` - the JNDI home name (used for errors).
    `home` - the EJBHome of the ContentManager.
    `s` - the search parameters.
  Returns:
    the Enumeration of Content which match the search.
  Throws:
    `RemoteException`
    `IllegalArgumentException`
  See Also:
    `getContentManager(java.lang.String, javax.ejb.EJBHome)`

### getContentFromManager

    public static Enumeration getContentFromManager(String homeName,
                                                    EJBHome home,
                                                    Search s,
                                                    boolean readOnly)
                                             throws RemoteException,
                                                    IllegalArgumentException

  Deprecated. Use getContentManager(homeName, home).getContent(s);

  Search for content from a ContentManager.

  Parameters:
    `homeName` - the JNDI home name (used for errors).
    `home` - the EJBHome of the ContentManager.
    `s` - the search parameters.
    `readOnly` - the read-only flag (ignored).
  Returns:
    the Enumeration of Content which match the search.
  Throws:
    `RemoteException`
    `IllegalArgumentException`
  See Also:
    `getContentManager(java.lang.String, javax.ejb.EJBHome)`

### getContentFromManager

    public static Enumeration getContentFromManager(String homeName,
                                                    EJBHome home,
                                                    Search s,
                                                    boolean readOnly)
                                             throws RemoteException,
                                                    IllegalArgumentException

  Deprecated. Use new content expressions and getContentManager(homeName, home).getContent(s);

  Search for content from a ContentManager.

  Parameters:
    `homeName` - the JNDI home name (used for errors).
    `home` - the EJBHome of the ContentManager.
    `s` - the search parameters.
    `readOnly` - the read-only flag (ignored).
  Returns:
    the Enumeration of Content which match the search.
  Throws:
    `RemoteException`
    `IllegalArgumentException`
  See Also:
    `getContentManager(java.lang.String, javax.ejb.EJBHome)`

### getContentIds

    public static Collection getContentIds(String homeName,
                                           Search s)
                                    throws NamingException,
                                           RemoteException,
                                           FinderException,
                                           IllegalArgumentException

  Deprecated.
  Return an rray of Content from the ContentManager or ContentHome at the given name.

  If homeName points to a home for a ContentManager (or subclass), then the home's create() method will be invoked and the ContentManager's getContentIds() method will be used.

  Throws:
    `NamingException` - thrown if home cannot be found.
    `RemoteException` - thrown on communications error.
    `FinderException` - thrown on error in findBySearchParams (never thrown)
    `IllegalArgumentException` - thrown on any other error.
  See Also:
    `getContentManager(java.lang.String)`

### getContentLength

    public static int getContentLength(long docSize,
                                       int bytesLen)

  Deprecated.
  Return the correct content length. Since the getContent() method of Document does not guarentee that the resulting array will be the correct size (it might be larger), this method will tell what the actual number of bytes to use from that array is.

  Parameters:
    `docSize` - the value doc.getSize().
    `bytesLen` - the length of the doc.getContent() array.
  Returns:
    the number of bytes in the content array which are valid.
  See Also:
    `Document.getContent()`

### getContentManager

    public static ContentManager getContentManager(String homeName)
                                            throws NamingException,
                                                   CreateException,
                                                   RemoteException,
                                                   IllegalArgumentException

  Deprecated.
  Get a ContentManager from a JNDI home name.

  Parameters:
    `homeName` - the original home name.
  Returns:
    a ContentManager instance.
  Throws:
    `NamingException` - thrown on a lookup error.
    `CreateException` - thrown on a creation error.
    `RemoteException` - thrown on an error.
    `IllegalArgumentException` - thrown on an invalid ejb home.
  See Also:
    `getContentManager(java.lang.String, javax.ejb.EJBHome)`

### getContentManager

    public static ContentManager getContentManager(String homeName,
                                                   EJBHome home)
                                            throws CreateException,
                                                   RemoteException,
                                                   IllegalArgumentException

  Deprecated.
  Get a ContentManager from an EJBHome.

  Parameters:
    `homeName` - the original home name.
    `home` - the EJBHome.
  Returns:
    a ContentManager instance.
  Throws:
    `CreateException` - thrown on a creation error.
    `RemoteException` - thrown on an error.
    `IllegalArgumentException` - thrown on an invalid ejb home.

### pathInfoEncode

    public static String pathInfoEncode(String pathInfo)

  Deprecated.
  Correctly URLEncode a path-info string.

  This can be used to pass a contentId as Path-Info to the ShowDocServlet.

  This will url encode the pathInfo, but will leave "/"'s alone.

### toArray

    public static Content[] toArray(Enumeration e)

  Deprecated.
  Turn an Enumeration of Content into an array.

  Parameters:
    `e` - the Enumeration.
  Returns:
    an array of the Content objects.
  Throws:
    `ClassCastException` - thrown if the objects in the Enumeration aren't Content objects.

### toHTML

    public static String toHTML(String in)

  Deprecated.
  Convert an arbitrary string to HTML which will display as the original string intended.

  This will replace the characters '&', '"', '<', and '>' with '&amp;', &quot;', '&lt;', and '&gt;', respectively.

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2005 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 BEA Systems, Inc. All Rights Reserved