com.ibm.workplace.wcm.api
Interface LibraryStyleSheetComponent

All Superinterfaces:
Document, EditableLibraryComponent, LibraryComponent

public interface LibraryStyleSheetComponent
extends EditableLibraryComponent

Represents a Style Sheet component that exists in the Component Library.

A LibraryStyleSheetComponent can contain one style sheet. The contents of the style sheet file are dealt with as raw byte content. This class provides methods to manipulate the style sheet file and the attributes to use when rendering the component.

note: since v6.0.0, a LibraryComponent is referred to as a "Component" in the Authoring UI.

See Also:
LibraryComponent

Field Summary
static int MEDIA_TYPE_ALL
          Target style rules for any media-type device
static int MEDIA_TYPE_AURAL
          Target style rules for speech and sound synthesizers
static int MEDIA_TYPE_BRAILLE
          Target style rules for Braille trouch-feedback devices
static int MEDIA_TYPE_HANDHELD
          Target style rules for small or handheld devices
static int MEDIA_TYPE_PRINT
          Target style rules for page-by-page use, typically printed on paper
static int MEDIA_TYPE_PROJECTION
          Target style rules for projection using transparent media
static int MEDIA_TYPE_SCREEN
          Target style rules for continuous (non-paged) color computer screens
static int MEDIA_TYPE_TTY
          Target style rules for media that uses a fixed-pitch character grid
static int MEDIA_TYPE_TV
          Target style rules for television-link devices
static int MEDIA_TYPE_UNSPECIFIED
          No style rules have been specified
static int TYPE_ALTERNATE
          Alternate style sheets grouped under a single style name.
static int TYPE_PERSISTENT
          A style sheet that user agents must apply in addition to alternate style sheets.
static int TYPE_PREFERRED
          The authors preferred cascading style sheet, that should be applied unless the user selects an alternate style
 
Method Summary
 int getMediaType()
          The media type of this style-sheet.
 byte[] getStyleSheet()
          Returns the contents of the style sheet file contained within this component as a byte array.
 java.lang.String getStyleSheetFileName()
          Returns the filename of the style sheet file contained within this component.
 java.lang.String getStyleSheetTitle()
          Returns the title of the style sheet.
 int getType()
          The type this style sheet.
 void setMediaType(int mediaType)
          Sets the media type of the style sheet.
 void setStyleSheet(java.lang.String styleSheetFileName, byte[] styleSheet)
          Sets the style sheet file contained within this component.
 void setStyleSheetTitle(java.lang.String title)
          Sets the title of the style sheet.
 void setType(int type)
          Sets the type of the style sheet.
 
Methods inherited from interface com.ibm.workplace.wcm.api.EditableLibraryComponent
addAuthors, addDeleteAccessMembers, addEditAccessMembers, addLiveAccessMembers, addOwners, addReadAccessMembers, isChanged, removeAuthors, removeDeleteAccessMembers, removeEditAccessMembers, removeLiveAccessMembers, removeOwners, removeReadAccessMembers, setDescription, setName, setTitle
 
Methods inherited from interface com.ibm.workplace.wcm.api.Document
getAuthors, getDeleteAccessMembers, getDescription, getEditAccessMembers, getHistoryLog, getId, getLiveAccessMembers, getModifiedDate, getName, getOwnerLibrary, getOwners, getReadAccessMembers, getTitle, hasDeleteAccess, hasDeleteAccess, hasEditAccess, hasEditAccess, hasLiveAccess, hasLiveAccess, hasReadAccess, hasReadAccess
 

Field Detail

TYPE_PREFERRED

public static final int TYPE_PREFERRED
The authors preferred cascading style sheet, that should be applied unless the user selects an alternate style

See Also:
Constant Field Values

TYPE_ALTERNATE

public static final int TYPE_ALTERNATE
Alternate style sheets grouped under a single style name.

See Also:
Constant Field Values

TYPE_PERSISTENT

public static final int TYPE_PERSISTENT
A style sheet that user agents must apply in addition to alternate style sheets.

See Also:
Constant Field Values

MEDIA_TYPE_UNSPECIFIED

public static final int MEDIA_TYPE_UNSPECIFIED
No style rules have been specified

See Also:
Constant Field Values

MEDIA_TYPE_AURAL

public static final int MEDIA_TYPE_AURAL
Target style rules for speech and sound synthesizers

See Also:
Constant Field Values

MEDIA_TYPE_BRAILLE

public static final int MEDIA_TYPE_BRAILLE
Target style rules for Braille trouch-feedback devices

See Also:
Constant Field Values

MEDIA_TYPE_HANDHELD

public static final int MEDIA_TYPE_HANDHELD
Target style rules for small or handheld devices

See Also:
Constant Field Values

MEDIA_TYPE_PRINT

public static final int MEDIA_TYPE_PRINT
Target style rules for page-by-page use, typically printed on paper

See Also:
Constant Field Values

MEDIA_TYPE_PROJECTION

public static final int MEDIA_TYPE_PROJECTION
Target style rules for projection using transparent media

See Also:
Constant Field Values

MEDIA_TYPE_SCREEN

public static final int MEDIA_TYPE_SCREEN
Target style rules for continuous (non-paged) color computer screens

See Also:
Constant Field Values

MEDIA_TYPE_TTY

public static final int MEDIA_TYPE_TTY
Target style rules for media that uses a fixed-pitch character grid

See Also:
Constant Field Values

MEDIA_TYPE_TV

public static final int MEDIA_TYPE_TV
Target style rules for television-link devices

See Also:
Constant Field Values

MEDIA_TYPE_ALL

public static final int MEDIA_TYPE_ALL
Target style rules for any media-type device

See Also:
Constant Field Values
Method Detail

getStyleSheet

public byte[] getStyleSheet()
                     throws AuthorizationException,
                            PropertyRetrievalException
Returns the contents of the style sheet file contained within this component as a byte array.

Returns an empty byte array if a style sheet file has not been specified or the byte content could not be retrieved.

Returns:
the style sheet file content as a byte array
Throws:
AuthorizationException - if the user does not have access to the style sheet
PropertyRetrievalException - if the style sheet cannot be retrieved

getStyleSheetFileName

public java.lang.String getStyleSheetFileName()
                                       throws AuthorizationException,
                                              PropertyRetrievalException
Returns the filename of the style sheet file contained within this component.

Returns null if an style sheet file has not been set.

Returns:
the filename of the style sheet
Throws:
AuthorizationException - if the user does not have access to the style sheet
PropertyRetrievalException - if the style sheet cannot be retrieved

setStyleSheet

public void setStyleSheet(java.lang.String styleSheetFileName,
                          byte[] styleSheet)
                   throws OperationFailedException
Sets the style sheet file contained within this component.

This method does not accept null arguments. Passing a null argument into this method will result in a NullPointerException.

Parameters:
styleSheetFileName - the filename of the style sheet file
styleSheet - the content of the style sheet file as a byte array
Throws:
java.lang.NullPointerException - if either of the arguments style sheetFileName or style sheet are null
OperationFailedException - if the style sheet file could not be set

setType

public void setType(int type)
             throws OperationFailedException
Sets the type of the style sheet.
    Valid values are:
  • TYPE_PREFERRED - Preferred style sheet
  • TYPE_ALTERNATE - Alternate style sheet
  • TYPE_PERSISTENT - Persistent style sheet

Parameters:
type - an integer specifying the type of the style sheet
Throws:
OperationFailedException - if the int argument is not a valid style sheet type

getType

public int getType()
The type this style sheet.

If the method setMediaType() had never been called the medit type will default to MEDIA_TYPE_UNSPECIFIED

Returns:
the media type of the style sheet

setMediaType

public void setMediaType(int mediaType)
                  throws OperationFailedException
Sets the media type of the style sheet.
    Valid values are:
  • MEDIA_TYPE_UNSPECIFIED - Unspecified
  • MEDIA_TYPE_AURAL - Aural (speech synthesizers)
  • MEDIA_TYPE_BRAILLE - Braille (tactile Braille feedback devices)
  • MEDIA_TYPE_HANDHELD - Handheld (handheld devices)
  • MEDIA_TYPE_PRINT - Print (printed, paged, preview docs)
  • MEDIA_TYPE_PROJECTION - Projection (projectors)
  • MEDIA_TYPE_SCREEN - Screen (non-paged computer screens)
  • MEDIA_TYPE_TTY - TTY (teletypes, terminals)
  • MEDIA_TYPE_TV - TV (television type devices)
  • MEDIA_TYPE_ALL - All

Parameters:
mediaType - an integer specifying the media type of the style sheet
Throws:
OperationFailedException - if the int argument is not a valid media type

getMediaType

public int getMediaType()
The media type of this style-sheet.

If the method setMediaType() had never been called the media type will default to MEDIA_TYPE_UNSPECIFIED

Returns:
the media type of the style sheet

setStyleSheetTitle

public void setStyleSheetTitle(java.lang.String title)
Sets the title of the style sheet.

If a null argument is passed in to this method getStyleSheetTitle() will return null.

Parameters:
title - the title

getStyleSheetTitle

public java.lang.String getStyleSheetTitle()
Returns the title of the style sheet.

Returns null if a title has not been set.

Returns:
the title of the style sheet