org.ops4j.pax.wicket.samples.departmentstore.view.floor.internal
Class FloorAggregatedSource

java.lang.Object
  extended by org.ops4j.pax.wicket.util.AbstractAggregatedSource<org.ops4j.pax.wicket.samples.departmentstore.view.floor.internal.FloorPanel>
      extended by org.ops4j.pax.wicket.samples.departmentstore.view.floor.internal.FloorAggregatedSource
All Implemented Interfaces:
ContentAggregator, ContentSource<org.ops4j.pax.wicket.samples.departmentstore.view.floor.internal.FloorPanel>, ContentTrackingCallback, OverviewTabContent, org.osgi.service.cm.ManagedService

public class FloorAggregatedSource
extends AbstractAggregatedSource<org.ops4j.pax.wicket.samples.departmentstore.view.floor.internal.FloorPanel>
implements OverviewTabContent


Field Summary
protected  Logger LOGGER
           
 
Fields inherited from interface org.ops4j.pax.wicket.api.ContentSource
AGGREGATION_POINT, APPLICATION_NAME, BASIC_ROLES, DESTINATION_UNKNOWN, DESTINATIONS, HOMEPAGE_CLASSNAME, MOUNTPOINT, PAGE_ID, PAGE_NAME, REQUIRED_ROLES, SOURCE_ID
 
Constructor Summary
FloorAggregatedSource(Floor floor, java.lang.String aggregationPoint, java.lang.String destination, org.osgi.framework.BundleContext bundleContext, java.lang.String applicationname)
           
 
Method Summary
 void addContent(java.lang.String wicketId, ContentSource source)
          Add the specified source to this RootContentAggregator and mapped it as wicketId.
protected  org.ops4j.pax.wicket.samples.departmentstore.view.floor.internal.FloorPanel createComponent(java.lang.String wicketId)
          Create component represented by this AbstractContentAggregator with the specified wicketId.
 org.apache.wicket.extensions.markup.html.tabs.AbstractTab createTab(java.util.Locale locale)
          Create the tab given the specified locale as the locale of the displayed tab item label.
 org.apache.wicket.Component createWiredComponent(java.lang.String sourceId, java.lang.String wicketId)
           
 void dispose()
          Dispose this RootContentAggregator instance.
protected  void finalize()
           
 java.lang.String getAggregationPointName()
          Returns the aggregation point id of this AbstractContentAggregator instance.
 java.lang.String getApplicationName()
          Returns the application name of this ContentAggregator instance belongs to.
protected  PaxWicketAuthentication getAuthentication()
          Returns the Authentication of the current request.
protected  org.osgi.framework.BundleContext getBundleContext()
          Returns the BundleContext that this ContentAggregator belongs to.
 ContentSource<? extends org.apache.wicket.Component> getContentById(java.lang.String wicketId, java.lang.String sourceId)
           
<V extends ContentSource>
java.util.List<V>
getContents(java.lang.String wicketId)
          Returns list of ContentSource instnaces of the specified wicketId.
 java.lang.String getFloorId()
           
protected  java.lang.Object getObjectProperty(java.lang.String key)
           
protected  java.lang.String[] getStringArrayProperty(java.lang.String key)
           
protected  java.lang.String getStringProperty(java.lang.String key, java.lang.String defaultValue)
           
 java.lang.String getTabId()
          The tab identifier.
 java.util.List<java.lang.String> getWiredSourceIds(java.lang.String wicketId, java.util.Comparator<ContentSource> comparator)
           
protected  void onDispose()
          Override this method to handle additional dispose.
protected  void onUpdated(java.util.Dictionary config)
           
 org.osgi.framework.ServiceRegistration register()
           
 boolean removeContent(java.lang.String wicketId, ContentSource content)
          Remove the specified content to this RootContentAggregator and unmapped it as wicketId.
 void setAggregationPointName(java.lang.String aggregationPoint)
          Set the aggregation id of this AbstractContentAggregator.
 void setApplicationName(java.lang.String applicationName)
          Sets the application name of this AbstractContentAggregator instant belongs to.
protected  void setProperty(java.lang.String key, java.lang.Object value)
           
 void updated(java.util.Dictionary config)
           
protected  void updateRegistration()
           
 
Methods inherited from class org.ops4j.pax.wicket.util.AbstractAggregatedSource
createComponent, createComponents, createSourceComponent, createSourceComponent, getBasicRoles, getDestinations, getRequiredRoles, getServiceNames, getSourceId, setDestination, setRoles
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ops4j.pax.wicket.api.ContentAggregator
dispose, getAggregationPointName, getApplicationName
 
Methods inherited from interface org.ops4j.pax.wicket.internal.ContentTrackingCallback
addContent, removeContent
 
Methods inherited from interface org.osgi.service.cm.ManagedService
updated
 

Field Detail

LOGGER

protected final Logger LOGGER
Constructor Detail

FloorAggregatedSource

public FloorAggregatedSource(Floor floor,
                             java.lang.String aggregationPoint,
                             java.lang.String destination,
                             org.osgi.framework.BundleContext bundleContext,
                             java.lang.String applicationname)
Method Detail

createComponent

protected org.ops4j.pax.wicket.samples.departmentstore.view.floor.internal.FloorPanel createComponent(java.lang.String wicketId)
Description copied from class: AbstractAggregatedSource
Create component represented by this AbstractContentAggregator with the specified wicketId.

General convention:

Specified by:
createComponent in class AbstractAggregatedSource<org.ops4j.pax.wicket.samples.departmentstore.view.floor.internal.FloorPanel>
Parameters:
wicketId - The wicketId. This argument must not be null nor empty. It maps to the wicket:id of the rendering process in Wicket.
Returns:
A new instance of wicket component represented by this AbstractContentAggregator.

createTab

public org.apache.wicket.extensions.markup.html.tabs.AbstractTab createTab(java.util.Locale locale)
Description copied from interface: OverviewTabContent
Create the tab given the specified locale as the locale of the displayed tab item label. This method must not return null object.

Specified by:
createTab in interface OverviewTabContent
Parameters:
locale - The locale for the tab item label. This argument must not be null.
Returns:
A new abstract tab.

getFloorId

public final java.lang.String getFloorId()

getTabId

public final java.lang.String getTabId()
Description copied from interface: OverviewTabContent
The tab identifier.

Specified by:
getTabId in interface OverviewTabContent
Returns:
The tab identifier.

getAggregationPointName

public final java.lang.String getAggregationPointName()
Returns the aggregation point id of this AbstractContentAggregator instance. This method must not return null object.

Specified by:
getAggregationPointName in interface ContentAggregator
Returns:
The aggregation point name.
Since:
1.0.0

setAggregationPointName

public final void setAggregationPointName(java.lang.String aggregationPoint)
Set the aggregation id of this AbstractContentAggregator.

Note: aggregation id property must not be set after this AbstractContentAggregator instance is registered to OSGi framework.

Parameters:
aggregationPoint - The aggregation point name. This argument must not be null.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified aggregationId argument is null or empty.
Since:
1.0.0

getApplicationName

public final java.lang.String getApplicationName()
Returns the application name of this ContentAggregator instance belongs to.

Specified by:
getApplicationName in interface ContentAggregator
Returns:
The application name of this ContentAggregator instance belongs to.
Since:
1.0.0

setApplicationName

public final void setApplicationName(java.lang.String applicationName)
Sets the application name of this AbstractContentAggregator instant belongs to.

Note: Application name property must not be set after this AbstractContentAggregator instance is registered to OSGi framework.

Parameters:
applicationName - The application name. This argument must not be null.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified applicationName argument is null or empty.
Since:
1.0.0

dispose

public final void dispose()
                   throws java.lang.IllegalStateException
Dispose this RootContentAggregator instance.

Note: Dispose does not unregister this RootContentAggregator, and ensure that dispose is only called after this RootContentAggregator instance is unregistered from OSGi container.

Specified by:
dispose in interface ContentAggregator
Throws:
java.lang.IllegalStateException - Thrown if this content tracker has not been registered.
Since:
1.0.0
See Also:
ServiceRegistration.unregister()

getBundleContext

protected final org.osgi.framework.BundleContext getBundleContext()
Returns the BundleContext that this ContentAggregator belongs to.

Returns:
the BundleContext that this ContentAggregator belongs to.

updated

public final void updated(java.util.Dictionary config)
                   throws org.osgi.service.cm.ConfigurationException
Specified by:
updated in interface org.osgi.service.cm.ManagedService
Throws:
org.osgi.service.cm.ConfigurationException

onUpdated

protected void onUpdated(java.util.Dictionary config)

addContent

public final void addContent(java.lang.String wicketId,
                             ContentSource source)
                      throws java.lang.IllegalArgumentException
Add the specified source to this RootContentAggregator and mapped it as wicketId.

Specified by:
addContent in interface ContentTrackingCallback
Parameters:
wicketId - The wicket id. This argument must not be null or empty.
source - The source. This argument must not be null.
Throws:
java.lang.IllegalArgumentException - Thrown if one or both arguments are null.
Since:
1.0.0

removeContent

public final boolean removeContent(java.lang.String wicketId,
                                   ContentSource content)
                            throws java.lang.IllegalArgumentException
Remove the specified content to this RootContentAggregator and unmapped it as wicketId.

Specified by:
removeContent in interface ContentTrackingCallback
Parameters:
wicketId - The wicket id. This argument must not be null or empty.
content - The content. This argument must not be null.
Returns:
A boolean indicator whether removal is successfull.
Throws:
java.lang.IllegalArgumentException - Thrown if one or both arguments are null.
Since:
1.0.0

register

public final org.osgi.framework.ServiceRegistration register()
                                                      throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getStringArrayProperty

protected java.lang.String[] getStringArrayProperty(java.lang.String key)

getStringProperty

protected java.lang.String getStringProperty(java.lang.String key,
                                             java.lang.String defaultValue)

setProperty

protected void setProperty(java.lang.String key,
                           java.lang.Object value)

updateRegistration

protected void updateRegistration()

getObjectProperty

protected java.lang.Object getObjectProperty(java.lang.String key)

onDispose

protected void onDispose()
Override this method to handle additional dispose.

Since:
1.0.0

getWiredSourceIds

public final java.util.List<java.lang.String> getWiredSourceIds(java.lang.String wicketId,
                                                                java.util.Comparator<ContentSource> comparator)
                                                         throws java.lang.IllegalArgumentException
Parameters:
wicketId - The WicketID that we want to find the wiring for.
comparator - The sorting comparator.
Returns:
A List of SourceIDs, identifying the ContentSource that has been wired to this ContentAggregator.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified wicketId argument is null.
Since:
1.0.0
See Also:
createWiredComponent(String,String)

createWiredComponent

public final org.apache.wicket.Component createWiredComponent(java.lang.String sourceId,
                                                              java.lang.String wicketId)
                                                       throws java.lang.IllegalArgumentException
Parameters:
sourceId - The SourceID of the ContentSource that we want to create a component.
wicketId - The WicketID of the component to be created by the ContentSource. This responds to the wicket:id in the markup.
Returns:
The wicket component build for the specified sourceId and wicketId.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified sourceId (or/and) wicketId argument is null.
Since:
1.0.0
See Also:
getWiredSourceIds(String,java.util.Comparator)

getContents

public final <V extends ContentSource> java.util.List<V> getContents(java.lang.String wicketId)
                                                          throws java.lang.IllegalArgumentException
Returns list of ContentSource instnaces of the specified wicketId. Returns an empty list if there is no content for the specified wicketId.

Parameters:
wicketId - The wicket id. This argument must not be null or empty.
Returns:
List of ContentSource of the specified wicketId.
Throws:
java.lang.IllegalArgumentException - if the wicketId is null or empty.

getAuthentication

protected PaxWicketAuthentication getAuthentication()
Returns the Authentication of the current request. It is possible to obtain the Username of the logged in user as well as which roles that this user has assigned to it.

Returns:
the Authentication of the current request.

getContentById

public final ContentSource<? extends org.apache.wicket.Component> getContentById(java.lang.String wicketId,
                                                                                 java.lang.String sourceId)
                                                                          throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable


Copyright © 2008. All Rights Reserved.