org.exoplatform.services.wcm.core
Class BaseWebSchemaHandler

java.lang.Object
  extended by org.exoplatform.container.component.BaseComponentPlugin
      extended by org.exoplatform.services.wcm.core.BaseWebSchemaHandler
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin, WebSchemaHandler
Direct Known Subclasses:
CSSFileHandler, HTMLFileSchemaHandler, JSFileHandler, PortalFolderSchemaHandler, WebContentSchemaHandler

public abstract class BaseWebSchemaHandler
extends org.exoplatform.container.component.BaseComponentPlugin
implements WebSchemaHandler

Created by The eXo Platform SAS.

Author:
: Hoa.Pham hoa.pham@exoplatform.com May 28, 2008

Field Summary
protected  java.lang.String EXO_OWNABLE
           
protected  java.lang.String NT_FILE
           
protected  java.lang.String NT_FOLDER
           
protected  java.lang.String NT_UNSTRUCTURED
           
 
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name
 
Constructor Summary
BaseWebSchemaHandler()
           
 
Method Summary
protected  void addMixin(javax.jcr.Node node, java.lang.String mixin)
          Adds the mixin.
protected  void createDefautWebData(javax.jcr.Node webContent)
           
protected  javax.jcr.Node findPortalNode(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, javax.jcr.Node child)
           
protected  java.lang.String getFileMimeType(javax.jcr.Node file)
           
protected abstract  java.lang.String getHandlerNodeType()
          Gets the handler node type.
protected abstract  java.lang.String getParentNodeType()
          Gets the parent node type.
protected
<T> T
getService(java.lang.Class<T> clazz)
           
 boolean matchHandler(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, javax.jcr.Node node)
          Match handler to process the schema
 void onCreateNode(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, javax.jcr.Node node)
          Process schema when crete node
 void onModifyNode(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, javax.jcr.Node node)
          Update schema when modify node
 void onRemoveNode(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider, javax.jcr.Node node)
          Update schema before a node is removed
 
Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXO_OWNABLE

protected final java.lang.String EXO_OWNABLE

NT_FOLDER

protected final java.lang.String NT_FOLDER

NT_UNSTRUCTURED

protected final java.lang.String NT_UNSTRUCTURED

NT_FILE

protected final java.lang.String NT_FILE
Constructor Detail

BaseWebSchemaHandler

public BaseWebSchemaHandler()
Method Detail

matchHandler

public boolean matchHandler(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider,
                            javax.jcr.Node node)
                     throws java.lang.Exception
Description copied from interface: WebSchemaHandler
Match handler to process the schema

Specified by:
matchHandler in interface WebSchemaHandler
node - the node
Returns:
true, if successful
Throws:
java.lang.Exception - the exception

onCreateNode

public void onCreateNode(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider,
                         javax.jcr.Node node)
                  throws java.lang.Exception
Description copied from interface: WebSchemaHandler
Process schema when crete node

Specified by:
onCreateNode in interface WebSchemaHandler
node - the node
Throws:
java.lang.Exception - the exception

onModifyNode

public void onModifyNode(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider,
                         javax.jcr.Node node)
                  throws java.lang.Exception
Description copied from interface: WebSchemaHandler
Update schema when modify node

Specified by:
onModifyNode in interface WebSchemaHandler
node - the node
Throws:
java.lang.Exception - the exception

onRemoveNode

public void onRemoveNode(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider,
                         javax.jcr.Node node)
                  throws java.lang.Exception
Description copied from interface: WebSchemaHandler
Update schema before a node is removed

Specified by:
onRemoveNode in interface WebSchemaHandler
node - the node
Throws:
java.lang.Exception - the exception

getHandlerNodeType

protected abstract java.lang.String getHandlerNodeType()
Gets the handler node type.

Returns:
the handler node type

getParentNodeType

protected abstract java.lang.String getParentNodeType()
Gets the parent node type.

Returns:
the parent node type

addMixin

protected void addMixin(javax.jcr.Node node,
                        java.lang.String mixin)
                 throws java.lang.Exception
Adds the mixin.

Parameters:
node - the node
mixin - the mixin
Throws:
java.lang.Exception - the exception

getService

protected <T> T getService(java.lang.Class<T> clazz)

findPortalNode

protected javax.jcr.Node findPortalNode(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider,
                                        javax.jcr.Node child)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getFileMimeType

protected java.lang.String getFileMimeType(javax.jcr.Node file)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

createDefautWebData

protected void createDefautWebData(javax.jcr.Node webContent)
                            throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2010 eXo Platform SAS. All Rights Reserved.