com.sapportals.wcm.protocol.ice.protocol

Class ICEAccess

java.lang.Object
  extended by com.sapportals.wcm.protocol.ice.protocol.ICEAccess
All Implemented Interfaces:
IICEElementHandler, IICEElement, IDOMStorable

public class ICEAccess
extends Object
implements IICEElement, IICEElementHandler, IDOMStorable

ICEAccess represents an ice-access element inside an ice-item-ref. An ICEAccess defines an access rule when and how an item referenced by ice-item-ref could be accessed by the subscriber.

Detailed information about the ICE package structur could be found in the ICE 1.1 specification section 5.2 , the ice-item-ref element is described in section 5.2.2.3 . ice-access format

 <!ENTITY % cm.access            "( ice-access-window?,
                                    ice-access-control?
                                  )" >
 <!ELEMENT ice-access %cm.access; >
 <!ATTLIST ice-access
           name                  CDATA           #IMPLIED
           description           CDATA           #IMPLIED
           id                    ID              #IMPLIED
 >

See Also:

Copyright 2004 SAP AG


Field Summary
static String CID_ACCESS
           
static String TAGNAME
           
 
Constructor Summary
ICEAccess(Attributes attributes)
          Create a new ICEAccess.
ICEAccess(Element element)
          Create an ICEAccess object from a DOM-element.
ICEAccess(ICEAccessWindow accessWindow, ICEAccessControl accessControl)
          Create a new ICEAccess object.
ICEAccess(String configId)
           
 
Method Summary
 void deleteConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
           
 boolean endElement(String name)
          Receive notification of the end of an element.
 ICEAccessControl getAccessControl()
          Get the access control of this access rule.
 String getConfigId()
          Gets the identifier of the configurable which stores the configuration of this access.
 boolean match()
          Check if the access rule matches the current time.
 void saveConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
           
 IICECharacterHandler startElement(String name, Attributes attributes, PreparsedXML input)
          Receive notification of the beginning of an element.
 Node store(Document document)
          Store the informations into a DOM.
 String toString()
          Returns a string representation of this access element.
 void write(ContentHandler handler)
          Write the XML representation of the ICE element to a SAX ContentHandler.
 boolean writeChunk(ContentHandler handler)
          Write a chunk of XML to a SAX ContentHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAGNAME

public static final String TAGNAME
See Also:
Constant Field Values

CID_ACCESS

public static final String CID_ACCESS
See Also:
Constant Field Values
Constructor Detail

ICEAccess

public ICEAccess(Attributes attributes)
Create a new ICEAccess. This constructor is used by ICEInput to decode an ICEAccess from an ICE payload.

Parameters:
attributes - The attributes of the ice-access tag

ICEAccess

public ICEAccess(Element element)
Create an ICEAccess object from a DOM-element.

Parameters:
element - A DOM-element containing the data of the access

ICEAccess

public ICEAccess(String configId)
          throws com.sapportals.config.fwk.InitialConfigException,
                 com.sapportals.config.fwk.CannotAccessConfigException
Throws:
com.sapportals.config.fwk.InitialConfigException
com.sapportals.config.fwk.CannotAccessConfigException

ICEAccess

public ICEAccess(ICEAccessWindow accessWindow,
                 ICEAccessControl accessControl)
Create a new ICEAccess object.

Parameters:
accessWindow - The access window
accessControl - The access control
Method Detail

getAccessControl

public ICEAccessControl getAccessControl()
Get the access control of this access rule.

Returns:
The access control of this access rule or null is there is none

match

public boolean match()
Check if the access rule matches the current time. If the access rule does not have an access window it always maches, otherwise the current time has to match the access window.

Returns:
true if the access rule matches the current time.

startElement

public IICECharacterHandler startElement(String name,
                                         Attributes attributes,
                                         PreparsedXML input)
                                  throws SAXException
Receive notification of the beginning of an element. ICEInput invokes this method upon a start element event from the underlying SAX parser.

Specified by:
startElement in interface IICEElementHandler
Parameters:
name - The local name of the XML element (we don't need namespaces at this point)
input - The preparsed XML stream to get the element content
attributes -
Returns:
An IICECharacterHandler to receive the character events from the SAX parser or null if the character events could be ignored
Throws:
SAXException - on error (might wrap another exception)

endElement

public boolean endElement(String name)
                   throws SAXException
Receive notification of the end of an element. ICEInput invokes this method upon an end element event from the underlying SAX parser.

Specified by:
endElement in interface IICEElementHandler
Parameters:
name - The local name of the XML element (we don't need namespaces at this point)
Returns:
true if this handler should still receive SAX element events, false if this handler isn't interested in the following SAX element events
Throws:
SAXException - on error (might wrap another exception)

write

public void write(ContentHandler handler)
           throws SAXException
Write the XML representation of the ICE element to a SAX ContentHandler. This method is used by ICEOutput to create an ICE payload.

Specified by:
write in interface IICEElement
Parameters:
handler - The SAX ContentHandler (usually a XMLSerializer)
Throws:
SAXException - on error (might wrap another exception)

writeChunk

public boolean writeChunk(ContentHandler handler)
                   throws SAXException
Write a chunk of XML to a SAX ContentHandler. This method is used by ICEOutput to write an ICE payload in chunked mode.

Specified by:
writeChunk in interface IICEElement
Parameters:
handler - The SAX ContentHandler (usually a XMLSerializer)
Returns:
true if there are more chunks in the queue
Throws:
SAXException - on error (might wrap another exception)

store

public Node store(Document document)
Store the informations into a DOM.

Specified by:
store in interface IDOMStorable
Parameters:
document - The DOM document that should be used as factory for the DOM elements
Returns:
A Node containing the informations of the configuration object (this might be the document element of the XML that is eventually written to the repository)

saveConfig

public void saveConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
                throws com.sapportals.config.fwk.ConfigException
Throws:
com.sapportals.config.fwk.ConfigException

deleteConfig

public void deleteConfig(com.sapportals.config.fwk.IConfigPlugin icePlugin)
                  throws com.sapportals.config.fwk.ConfigException
Throws:
com.sapportals.config.fwk.ConfigException

getConfigId

public String getConfigId()
Gets the identifier of the configurable which stores the configuration of this access.

Returns:
the identifier of the configurable

toString

public String toString()
Returns a string representation of this access element.

Overrides:
toString in class Object
Returns:
a string representation of this access element
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM


Copyright 2011 SAP AG Complete Copyright Notice