com.day.cq.widget.impl
Class WidgetExtensionProviderImpl

java.lang.Object
  extended by com.day.cq.widget.impl.WidgetExtensionProviderImpl
All Implemented Interfaces:
WidgetExtensionProvider

public class WidgetExtensionProviderImpl
extends Object
implements WidgetExtensionProvider


Field Summary
protected static String CONFIG_PROPERTY_WORKSPACE
           
static Locale DATE_FORMAT_LOCALE
          Used to format date values
static String ECMA_DATE_FORMAT
          Used to format date values
protected static String EXTENDABLE_WIDGETS
           
protected  org.slf4j.Logger log
          Default log.
protected  org.apache.sling.jcr.resource.JcrResourceResolverFactory resourceManagerFactory
           
 
Constructor Summary
WidgetExtensionProviderImpl()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext context)
          Activate this component.
 void dump(org.apache.sling.api.resource.Resource resource, org.apache.sling.commons.json.JSONObject obj, int maxRecursionLevels)
           
protected  void dump(org.apache.sling.api.resource.Resource resource, org.apache.sling.commons.json.JSONObject obj, int currentRecursionLevel, int maxRecursionLevels)
          Dump given resource in JSON, optionally recursing into its objects
protected  void dumpSingleResource(org.apache.sling.api.resource.Resource n, org.apache.sling.commons.json.JSONObject obj, int currentRecursionLevel, int maxRecursionLevels)
          Dump a single node
protected  void dumpValue(org.apache.sling.commons.json.JSONArray a, Object value)
           
protected  void dumpValue(org.apache.sling.commons.json.JSONObject obj, Object value, String key)
           
static String format(Calendar date)
           
 List<org.apache.sling.api.resource.Resource> getExtensions(String xtype, Session session)
          Returns all extensions paths of the desired widget as list.
 org.apache.sling.commons.json.JSONObject getJson(String key, Session session)
          Returns the extension "list" as json object
 String getJsonString(String key, Session session)
          Returns the extension "list" as string ready for inclusion
protected  boolean recursionLevelActive(int currentRecursionLevel, int maxRecursionLevels)
          true if the current recursion level is active
protected  void writeProperty(org.apache.sling.commons.json.JSONObject obj, org.apache.sling.api.resource.ValueMap valueMap, String key, Object value)
          Write a single property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.slf4j.Logger log
Default log.


resourceManagerFactory

protected org.apache.sling.jcr.resource.JcrResourceResolverFactory resourceManagerFactory

CONFIG_PROPERTY_WORKSPACE

protected static final String CONFIG_PROPERTY_WORKSPACE
See Also:
Constant Field Values

EXTENDABLE_WIDGETS

protected static final String EXTENDABLE_WIDGETS
See Also:
Constant Field Values

ECMA_DATE_FORMAT

public static final String ECMA_DATE_FORMAT
Used to format date values

See Also:
Constant Field Values

DATE_FORMAT_LOCALE

public static final Locale DATE_FORMAT_LOCALE
Used to format date values

Constructor Detail

WidgetExtensionProviderImpl

public WidgetExtensionProviderImpl()
Method Detail

getExtensions

public List<org.apache.sling.api.resource.Resource> getExtensions(String xtype,
                                                                  Session session)
Description copied from interface: WidgetExtensionProvider
Returns all extensions paths of the desired widget as list.

Specified by:
getExtensions in interface WidgetExtensionProvider
Parameters:
xtype - extension key
session - session

getJson

public org.apache.sling.commons.json.JSONObject getJson(String key,
                                                        Session session)
Description copied from interface: WidgetExtensionProvider
Returns the extension "list" as json object

Specified by:
getJson in interface WidgetExtensionProvider
Returns:

getJsonString

public String getJsonString(String key,
                            Session session)
Description copied from interface: WidgetExtensionProvider
Returns the extension "list" as string ready for inclusion

Specified by:
getJsonString in interface WidgetExtensionProvider
Returns:

activate

protected void activate(org.osgi.service.component.ComponentContext context)
                 throws RepositoryException
Activate this component.

Parameters:
context -
Throws:
RepositoryException

dump

public void dump(org.apache.sling.api.resource.Resource resource,
                 org.apache.sling.commons.json.JSONObject obj,
                 int maxRecursionLevels)
          throws org.apache.sling.commons.json.JSONException
Throws:
org.apache.sling.commons.json.JSONException

dump

protected void dump(org.apache.sling.api.resource.Resource resource,
                    org.apache.sling.commons.json.JSONObject obj,
                    int currentRecursionLevel,
                    int maxRecursionLevels)
             throws org.apache.sling.commons.json.JSONException
Dump given resource in JSON, optionally recursing into its objects

Throws:
org.apache.sling.commons.json.JSONException

dumpSingleResource

protected void dumpSingleResource(org.apache.sling.api.resource.Resource n,
                                  org.apache.sling.commons.json.JSONObject obj,
                                  int currentRecursionLevel,
                                  int maxRecursionLevels)
                           throws org.apache.sling.commons.json.JSONException
Dump a single node

Throws:
org.apache.sling.commons.json.JSONException

recursionLevelActive

protected boolean recursionLevelActive(int currentRecursionLevel,
                                       int maxRecursionLevels)
true if the current recursion level is active


writeProperty

protected void writeProperty(org.apache.sling.commons.json.JSONObject obj,
                             org.apache.sling.api.resource.ValueMap valueMap,
                             String key,
                             Object value)
                      throws org.apache.sling.commons.json.JSONException
Write a single property

Throws:
org.apache.sling.commons.json.JSONException

dumpValue

protected void dumpValue(org.apache.sling.commons.json.JSONObject obj,
                         Object value,
                         String key)
                  throws org.apache.sling.commons.json.JSONException
Throws:
org.apache.sling.commons.json.JSONException

dumpValue

protected void dumpValue(org.apache.sling.commons.json.JSONArray a,
                         Object value)
                  throws org.apache.sling.commons.json.JSONException
Throws:
org.apache.sling.commons.json.JSONException

format

public static String format(Calendar date)


Copyright © 2008 Day Management AG. All Rights Reserved.