Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.workplace.wcm.api.extensions.digitalasset
Interface DigitalAssetChooserRenderingContext

    public interface DigitalAssetChooserRenderingContext

DigitalAssetChooserRenderingContext interface to allow a plugin to provide/render the necessary markup/javascript to render the DAM workspace and allow one to select a DigitalAsset.

Since:
  8.5.cf3

Nested Class Summary
`static class` | `DigitalAssetChooserRenderingContext.FormMode` Current form mode
`static class` | `DigitalAssetChooserRenderingContext.ResourceType` Resource type

Field Summary
`static java.lang.String` | `ATTRIBUTE_DIGITALASSET_RENDERING_CONTEXT` digital asset rendering context request attribute name

Method Summary
`java.lang.String` | `encodeName(java.lang.String name)` Encodes the name as necessary for use in environments that require unique names for namespace resolution.
`java.lang.String` | `encodeURL(java.lang.String url)` Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
`java.lang.Object` | `getAttribute(java.lang.String attributeName)` Returns the value of the named attribute as an Object or null if no attribute of the given name exists.
`java.util.Iterator<java.lang.String>` | `getAttributeNames()` Returns an Enumeration containing the names of the attributes available to this request.
`Identity<TemplatedDocument>` | `getContentTemplateID()` Get the Content Template ID of the currently opened content item.
`Cookie[]` | `getCookies()` Returns an array containing all of the `Cookie` objects the client sent with the request.
`DigitalAssetChooserRenderingContext.FormMode` | `getFormMode()` How/where this rendering of the DigitalAssetChooser will be show.
`java.lang.String` | `getID()` ID of the DigitalAssetChooser widget
`java.util.Locale` | `getLocale()` Returns the locale to be used during the rendering.
`PageContext` | `getPageContext()` Get the pageContext
`DigitalAssetChooserRenderingContext.ResourceType` | `getResourceType()` Type of Component (file or Image) that the DigitalAssetChooser will be picking/selecting.
`HttpSession` | `getSession()` Returns the current HttpSession associated with the request or, if there is no current session returns null;
`java.io.Writer` | `getWriter()` Retrieves the writer for this render request.
`void` | `include(java.lang.String path)` Includes the content of a resource (servlet, JSP page, HTML file) in the response.
`void` | `include(java.lang.String context, java.lang.String path)` Includes the content of a resource (servlet, JSP page, HTML file) in the response.
`void` | `include(java.lang.String context, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> additionalRequestAttributes)` Includes the content of a resource (servlet, JSP page, HTML file) in the response.
`boolean` | `isEditable()` Indicates if the DigitalAssetChooser is enabled/editable

Field Detail

### ATTRIBUTE_DIGITALASSET_RENDERING_CONTEXT

    static final java.lang.String ATTRIBUTE_DIGITALASSET_RENDERING_CONTEXT

  digital asset rendering context request attribute name

  See Also:
    Constant Field Values

Method Detail

### getLocale

    java.util.Locale getLocale()

  Returns the locale to be used during the rendering. If no locale is set explicitly, this method returns the request locale. If the request locale is unavailable, the default server locale is returned.

  Returns:
    locale used during rendering

### encodeName

    java.lang.String encodeName(java.lang.String name)

  Encodes the name as necessary for use in environments that require unique names for namespace resolution. Renderers should use this method when outputting strings that might need encoding, such as form names, input component names, script function names, and script variable names.

  The the name will be encode via getID() + "_" + name, @see `getID()`

  Parameters:
    `name` - the name to encode
  Returns:
    the encoded name

### encodeURL

    java.lang.String encodeURL(java.lang.String url)

  Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.

  For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.

  The default behavior of this method is to return encodeURL(String url) on the wrapped response.

  Parameters:
    `url` - the url to be encoded
  Returns:
    encoded URL

### getAttribute

    java.lang.Object getAttribute(java.lang.String attributeName)

  Returns the value of the named attribute as an Object or null if no attribute of the given name exists. The default behavior of this method is to call getAttribute(String name) on the wrapped request object.

  Parameters:
    `attributeName` - - name of the attribute to retieve
  Returns:
    the attribute value, or `null` if no attribute with the given name exists.

### getAttributeNames

    java.util.Iterator<java.lang.String> getAttributeNames()

  Returns an Enumeration containing the names of the attributes available to this request. The default behavior of this method is to return getAttributeNames() on the wrapped request object.

  Returns:
    an Enumeration containing the names of the attributes available to this request

### getCookies

    Cookie[] getCookies()

  Returns an array containing all of the `Cookie` objects the client sent with the request. This method returns `null` if no cookies were sent.

  Returns:
    an array of all the `Cookies` included with the request, or `null` if the request has no cookies

### getSession

    HttpSession getSession()

  Returns the current HttpSession associated with the request or, if there is no current session returns null;

  Returns:
    the current HttpSession associated with the request or `null` if no session exists.

### getPageContext

    PageContext getPageContext()

  Get the pageContext

  Returns:
    the pageContext

### include

    void include(java.lang.String path)
                 throws java.io.IOException,
                        ServletException

  Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes.

  The ServletResponse object has its path elements and parameters remain unchanged from the caller's. The included servlet cannot change the response status code or set headers; any attempt to make a change is ignored.

  The url parameter may need to be encoded to work properly.

  Parameters:
    `path` - a `String` specifying the pathname to the resource
  Throws:
    `ServletException` - if the included resource throws this exception
    `java.io.IOException` - if the included resource throws this exception
  See Also:
    `encodeURL(java.lang.String)`

### include

    void include(java.lang.String context,
                 java.lang.String path)
                 throws java.io.IOException,
                        ServletException

  Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes.

  The ServletResponse object has its path elements and parameters remain unchanged from the caller's. The included servlet cannot change the response status code or set headers; any attempt to make a change is ignored.

  The url parameter may need to be encoded to work properly.

  Parameters:
    `context` - a `String` specifying the context root to the application to which the resource belongs, may be `null` if path is in the current applicaiton
    `path` - a `String` specifying the pathname to the resource
  Throws:
    `ServletException` - if the included resource throws this exception
    `java.io.IOException` - if the included resource throws this exception
  See Also:
    `encodeURL(java.lang.String)`

### include

    void include(java.lang.String context,
                 java.lang.String path,
                 java.util.Map<java.lang.String,java.lang.Object> additionalRequestAttributes)
                 throws java.io.IOException,
                        ServletException

  Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes.

  The ServletResponse object has its path elements and parameters remain unchanged from the caller's. The included servlet cannot change the response status code or set headers; any attempt to make a change is ignored.

  The url parameter may need to be encoded to work properly.

  Parameters:
    `context` - a `String` specifying the context root to the application to which the resource belongs, may be `null` if path is in the current applicaiton
    `path` - a `String` specifying the pathname to the resource
    `additionalRequestAttributes` - additional parameters to be added to the included request
  Throws:
    `ServletException` - if the included resource throws this exception
    `java.io.IOException` - if the included resource throws this exception
  See Also:
    `encodeURL(java.lang.String)`

### getResourceType

    DigitalAssetChooserRenderingContext.ResourceType getResourceType()

  Type of Component (file or Image) that the DigitalAssetChooser will be picking/selecting.

  The DigitalAssetChooser may wish to limit the type of asset shown based on this. Or change the Display/rendition of the assets.

  Returns:
    a DigitalAssetChooserType - to indicate the type of component being created/edited

### getFormMode

    DigitalAssetChooserRenderingContext.FormMode getFormMode()

  How/where this rendering of the DigitalAssetChooser will be show. Image/Files may be selected in mutiple places within WCM Authoring. A chooser/picker may want to alter its UI based upon the mode in which an asset is being selected.

  For instance in a Dialog a chooser should initially limit its UI, while in a Form it may wish to show asset selection inline, rather then forcing an additional launch/dialog button.

  Returns:
    FormMode - mode in which this choose is being rendered

### getID

    java.lang.String getID()

  ID of the DigitalAssetChooser widget

  Returns:
    the ID the widget

### isEditable

    boolean isEditable()

  Indicates if the DigitalAssetChooser is enabled/editable

  Returns:
    true if the widget is enabled.

### getWriter

    java.io.Writer getWriter()
                             throws java.io.IOException

  Retrieves the writer for this render request. A Chooser should either write all markup directly to this Writer, unless it includes a JSP, via one of the @see `include(String)` methods.

  Returns:
    Writer for this context.
  Throws:
    `java.io.IOException` - is any error occurs getting the underlying Writer

### getContentTemplateID

    Identity<TemplatedDocument> getContentTemplateID()

  Get the Content Template ID of the currently opened content item.

  Returns:
    the identity of the Content Template of the current content item.

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD