mcardle 2005/08/24 17:19:44 CEST
Modified files:
core/src/java/org/jahia/aop EsiJspContentDetectionAspect.java
Log:
various refactorings
Revision Changes Path
1.3 +9 -594
jahia/core/src/java/org/jahia/aop/EsiJspContentDetectionAspect.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/aop/EsiJspContentDetectionAspect.java.diff?r1=1.2&r2=1.3&f=h
Index: EsiJspContentDetectionAspect.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/aop/EsiJspContentDetectionAspect.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EsiJspContentDetectionAspect.java 23 Aug 2005 16:51:16 -0000 1.2
+++ EsiJspContentDetectionAspect.java 24 Aug 2005 15:19:44 -0000 1.3
@@ -3,10 +3,8 @@
import org.codehaus.aspectwerkz.joinpoint.*;
import org.jahia.registries.ServicesRegistry;
import org.jahia.services.esi.JesiObject;
-import org.jahia.services.esi.Fragment;
import java.util.EmptyStackException;
import org.jahia.data.containers.JahiaContainerList;
-import org.jahia.services.esi.Template;
import org.jahia.data.beans.ContainerListBean;
import org.jahia.data.containers.JahiaContainer;
import org.jahia.data.beans.ContainerBean;
@@ -27,8 +25,8 @@
private int indent = -1;
- private static boolean debug = false; //using this toggle as log4j seems
to conflict with Aspects
- private static boolean debug_verbose = false;
+ private static boolean verbose = false; //using this toggle as log4j
seems to conflict with Aspects
+ private static boolean very_verbose = false;
/**
* Aspect which detects access to a ContainerList (usually from JSP
pages or tags)
@@ -124,7 +122,7 @@
*/
public static void addContent (final JoinPoint joinPoint, Object aspObj,
final String ObjType , final String aspectName)
throws Throwable {
- if (debug_verbose) {
+ if (very_verbose) {
MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
System.err.println(
@@ -143,7 +141,7 @@
return;
}
- if (debug_verbose) {
+ if (very_verbose) {
//System.err.println(aspectName+"[" +
this.getClass().getClassLoader().hashCode() + "] ");
//System.err.println(aspectName+" this[" + this + "] ");
@@ -208,7 +206,7 @@
}
else System.err.println(" " + aspectName + ": Not a recognized
object type : " + aspObj);
- if (debug) System.err.println(" " + aspectName + ": added
" + contentType + " " +
+ if (verbose) System.err.println(" " + aspectName + ":
added " + contentType + " " +
" ID[" +objID + "]"
+ " to " + jesiObj.getObjDetails());
@@ -230,9 +228,9 @@
if (parentCtnListID > 0) { // make sure the parent object is not
the page, or some temp object with negative ID
jesiObj.addContainerList(parentCtnListID);
- if (debug) System.err.println("*
"+aspectName+": added PARENT ContainerList ID[" + parentCtnListID + "] for "
+ if (verbose) System.err.println("*
"+aspectName+": added PARENT ContainerList ID[" + parentCtnListID + "] for "
+contentType + " ID[" + ctnID + "]" + " to
"+jesiObj.getObjDetails());
- } else if (debug) System.err.println("* "+aspectName+":
Could not get Parent ContentContainerList for ContentContainer ID[" + ctnID +
"]");
+ } else if (verbose) System.err.println("* "+aspectName+":
Could not get Parent ContentContainerList for ContentContainer ID[" + ctnID +
"]");
}
/**
@@ -252,10 +250,10 @@
if (parentCtnID > 0) { // make sure the parent object is not the
page, or some temp object with negative ID
jesiObj.addContainer(parentCtnID);
- if (debug) System.err.println("* " + aspectName + ":
added PARENT Container ID[" + parentCtnID + "] for "
+ if (verbose) System.err.println("* " + aspectName + ":
added PARENT Container ID[" + parentCtnID + "] for "
+ contentType + " ID[" + ctnListID + "]" + " to " +
jesiObj.getObjDetails());
- } else if (debug) System.err.println("* "+aspectName+":
Could not get Parent JahiaContainer for JahiaContainerList ID[" + ctnListID +
"]");
+ } else if (verbose) System.err.println("* "+aspectName+":
Could not get Parent JahiaContainer for JahiaContainerList ID[" + ctnListID +
"]");
}
@@ -308,588 +306,5 @@
}
//*******************************************************************
-
-
- /*
- public void addContainerList (JoinPoint joinPoint)
- throws Throwable {
-
- if (debug) {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "-------\n addContainerList aspect: AFTER() : "
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString() );
- }
- JesiObject obj = null;
- try {
- obj = (JesiObject)
ServicesRegistry.getInstance().getEsiService().tagStackPeek();
- } catch(EmptyStackException ex) {
- System.err.println(" QUITTING
EsiJspContentDetectionAspect.addContainerList() as OUTSIDE FRAGMENT OR
TEMPLATE");
- return;
- }
-
- // System.err.println("addContainerList[" +
this.getClass().getClassLoader().hashCode() + "] ");
- // System.err.println("addContainerList this[" + this + "] ");
-
- MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
- System.err.println(" MethodRtti
Method:"+mrtti.getMethod().toString());
- // +" Return type:"+mrtti.getReturnType() );
- Object[] parameters = mrtti.getParameterValues();
- for (int i = 0, j = parameters.length; i < j; i++) {
- System.err.println(" param "+i+"
Name:"+parameters[i]);
- }
-
- if (obj instanceof Fragment) {
- //Fragment fr = (Fragment) obj;
- //following might not be necessary, but do it anyway
- Fragment frg =
ServicesRegistry.getInstance().getEsiService().getFragment(
- ((Fragment)obj).fragID);
-
- if (joinPoint.getCallee() instanceof JahiaContainerList ) {
- JahiaContainerList ctnlist = (JahiaContainerList)
(joinPoint.getCallee());
- frg.addContainerList(ctnlist.getID(),
ctnlist.getPageID());
- if (debug) System.err.println(" COMONNNN
JahiaContainerList: added ContainerList " +
- ctnlist.getID()
- + " [" +
ctnlist.getDefinition().getName() + "]"
- + " to Fragment " + frg.fragID + "
on pageID: " +
- frg.pageID);
- }
- else if (joinPoint.getCallee() instanceof
ContainerListBean ) {
- ContainerListBean ctnlistbean = (ContainerListBean)
(joinPoint.getCallee());
- frg.addContainerList(ctnlistbean.getId(),
ctnlistbean.getPageID());
- if (debug) System.err.println(" COMONNNN
ContainerListBEAN: added ContainerList " +
- ctnlistbean.getId()+ " [" +
ctnlistbean.getTitle() + "]"
- + " to Fragment " + frg.fragID
+ " on pageID: " +
- frg.pageID);
- }
- }
- else if (obj instanceof Template) {
- //Temaplate tpl = (Template) obj;
- //following might not be necessary, but do it anyway
- Template tpl =
ServicesRegistry.getInstance().getEsiService().getTemplate(
- ((Template)obj).pageID);
- //System.err.println("
joinPoint.getCalleeClass().getID() "+joinPoint.getCalleeClass().getID());
- if (joinPoint.getCallee() instanceof JahiaContainerList ) {
- JahiaContainerList ctnlist = (JahiaContainerList)
(joinPoint.getCallee());
-
tpl.addContainerList(ctnlist.getID(),ctnlist.getPageID());
- if (debug) System.err.println(" HOURRRAYYY
added ContainerList "+ctnlist.getID()
- + " [" +
ctnlist.getDefinition().getName() + "]"
- +" to Template on pageID: "+tpl.pageID);
- }
- else if (joinPoint.getCallee() instanceof ContainerListBean
) {
- ContainerListBean ctnlistbean = (ContainerListBean)
(joinPoint.getCallee());
- tpl.addContainerList(ctnlistbean.getId(),
ctnlistbean.getPageID());
- if (debug) System.err.println(" HOURRRAYYY
ContainerListBEAN: added ContainerList " +
- ctnlistbean.getId()+ " [" +
ctnlistbean.getTitle() + "]"
- +" to Template on pageID:
"+tpl.pageID);
- }
- }
- else System.err.println("HOUSTON!!!!!!!!!!!!!
EsiJspContentDetectionAspect: obj is not of type template or fragment...
obj:"+obj);
-
- }
-
- */
- //*******************************************************************
-
- /*
- public void addContainer (JoinPoint joinPoint)
- throws Throwable {
-
- if (debug) {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "-------\n addContainer aspect: AFTER() : "
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString() );
- }
- JesiObject obj = null;
- try {
- obj = (JesiObject)
ServicesRegistry.getInstance().getEsiService().tagStackPeek();
- } catch(EmptyStackException ex) {
- System.err.println(" QUITTING
EsiJspContentDetectionAspect.addContainer() as OUTSIDE FRAGMENT OR TEMPLATE");
- return;
- }
-
- if (debug) System.err.println("addContainer[" +
this.getClass().getClassLoader().hashCode() + "] ");
- if (debug) System.err.println("addContainer this[" + this + "] ");
-
- if (debug) {
- MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
- System.err.println(" MethodRtti Method:" +
mrtti.getMethod().toString());
- // +" Return type:"+mrtti.getReturnType() );
- Object[] parameters = mrtti.getParameterValues();
- for (int i = 0, j = parameters.length; i < j; i++) {
- System.err.println(" param " + i + " Name:" +
parameters[i]);
- }
- }
- if (obj instanceof Fragment) {
- //Fragment fr = (Fragment) obj;
- //following might not be necessary, but do it anyway
- Fragment frg =
ServicesRegistry.getInstance().getEsiService().getFragment(
- ((Fragment)obj).fragID);
-
- if (joinPoint.getCallee() instanceof JahiaContainer ) {
- JahiaContainer ctn = (JahiaContainer)
(joinPoint.getCallee());
- frg.addContainer(ctn.getID(), ctn.getPageID());
- if (debug) System.err.println(" COMONNNN
JahiaContainer: added Container " +
- ctn.getID()+ " [" +
ctn.getDefinition().getName() + "]"
- + " to Fragment " + frg.fragID + " on
pageID: " +
- frg.pageID);
- }
- else if (joinPoint.getCallee() instanceof ContainerBean ) {
- ContainerBean ctnbean = (ContainerBean)
(joinPoint.getCallee());
- frg.addContainer(ctnbean.getId(), ctnbean.getPageID());
- if (debug) System.err.println(" COMONNNN
ContainerBEAN: added Container " +
- ctnbean.getId()+ " [" +
ctnbean.getDefinition().getName() + "]"
- + " to Fragment " + frg.fragID + "
on pageID: " +
- frg.pageID);
- }
- }
- else if (obj instanceof Template) {
- //Temaplate tpl = (Template) obj;
- //following might not be necessary, but do it anyway
- Template tpl =
ServicesRegistry.getInstance().getEsiService().getTemplate(
- ((Template)obj).pageID);
- //System.err.println(" joinPoint.getCalleeClass().getID()
"+joinPoint.getCalleeClass().getID());
- if (joinPoint.getCallee() instanceof JahiaContainer ) {
- JahiaContainer ctn = (JahiaContainer)
(joinPoint.getCallee());
- tpl.addContainer(ctn.getID(),ctn.getPageID());
- if (debug) System.err.println(" HOURRRAYYY
added Container "+ctn.getID()
- + " [" + ctn.getDefinition().getName() +
"]"
- +" to Template on pageID: "+tpl.pageID);
- }
- else if (joinPoint.getCallee() instanceof ContainerBean ) {
- ContainerBean ctnbean = (ContainerBean)
(joinPoint.getCallee());
- tpl.addContainer(ctnbean.getId(), ctnbean.getPageID());
- if (debug) System.err.println(" HOURRRAYYY
ContainerBEAN: added Container " +
- ctnbean.getId() + " [" +
ctnbean.getDefinition().getName() + "]"
- +" to Template on pageID:
"+tpl.pageID);
- }
- } else System.err.println("HOUSTON!!!!!!!!!!!!!
EsiJspContentDetectionAspect: obj is not of type template or fragment...
obj:"+obj);
- } */
-
-
-
- //*******************************************************************
- /*
- public void addField (JoinPoint joinPoint)
- throws Throwable {
-
- if (debug) {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "-------\n addField aspect: AFTER() : "
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString() );
- }
-
- JesiObject obj = null;
- try {
- obj = (JesiObject)
ServicesRegistry.getInstance().getEsiService().tagStackPeek();
- } catch(EmptyStackException ex) {
- System.err.println(" QUITTING
EsiJspContentDetectionAspect.addField() as OUTSIDE FRAGMENT OR TEMPLATE");
- return;
- }
-
- if (debug) {
- System.err.println("addField[" +
this.getClass().getClassLoader().hashCode() + "] ");
- System.err.println("addField this[" + this + "] ");
-
- MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
- System.err.println(" MethodRtti
Method:"+mrtti.getMethod().toString());
- // +" Return type:"+mrtti.getReturnType() );
- Object[] parameters = mrtti.getParameterValues();
- for (int i = 0, j = parameters.length; i < j; i++) {
- System.err.println(" param "+i+"
Name:"+parameters[i]);
- }
- }
-
- if (obj instanceof Fragment) {
- //Fragment fr = (Fragment) obj;
- //following might not be necessary, but do it anyway
- Fragment frg =
ServicesRegistry.getInstance().getEsiService().getFragment(
- ((Fragment)obj).fragID);
-
- if (joinPoint.getCallee() instanceof JahiaField ) {
- JahiaField fd = (JahiaField) (joinPoint.getCallee());
- frg.addField(fd.getID(), fd.getPageID());
- if (debug) System.err.println(" COMONNNN
JahiaField: added Field " +
- fd.getID()+ " [" + fd.getValue() +
"]"
- + " to Fragment " + frg.fragID + "
on pageID: " +
- frg.pageID);
- }
- else if (joinPoint.getCallee() instanceof FieldBean ) {
- FieldBean fdbean = (FieldBean) (joinPoint.getCallee());
- frg.addField(fdbean.getId(), fdbean.getPageID());
- if (debug) System.err.println(" COMONNNN
FieldBEAN: added Field " +
- fdbean.getId() + " [" +
fdbean.getTitle() + "]"
- + " to Fragment " + frg.fragID +
" on pageID: " +
- frg.pageID);
- }
- }
- else if (obj instanceof Template) {
- //Temaplate tpl = (Template) obj;
- //following might not be necessary, but do it anyway
- Template tpl =
ServicesRegistry.getInstance().getEsiService().getTemplate(
- ((Template)obj).pageID);
- //System.err.println("
joinPoint.getCalleeClass().getID() "+joinPoint.getCalleeClass().getID());
- if (joinPoint.getCallee() instanceof JahiaField ) {
- JahiaField fd = (JahiaField) (joinPoint.getCallee());
- tpl.addField(fd.getID(),fd.getPageID());
- if (debug) System.err.println(" HOURRRAYYY
added Field "+fd.getID()
- + " [" + fd.getValue() + "]"
- +" to Template on pageID: "+tpl.pageID);
- }
- else if (joinPoint.getCallee() instanceof FieldBean ) {
- FieldBean fdbean = (FieldBean) (joinPoint.getCallee());
- tpl.addField(fdbean.getId(), fdbean.getPageID());
- if (debug) System.err.println(" HOURRRAYYY
FieldBEAN: added Field " +
- fdbean.getId() + " [" +
fdbean.getValue() + "]"
- +" to Template on pageID:
"+tpl.pageID);
- }
- } else System.err.println("HOUSTON!!!!!!!!!!!!!
EsiJspContentDetectionAspect: obj is not of type template or fragment...
obj:"+obj);
- }*/
-
-
- //*******************************************************************
- /*
- public void addPage (JoinPoint joinPoint)
- throws Throwable {
-
- if (debug) {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "-------\n addPage aspect: AFTER() : "
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString() );
- }
-
- JesiObject obj = null;
- try {
- obj = (JesiObject)
ServicesRegistry.getInstance().getEsiService().tagStackPeek();
- } catch(EmptyStackException ex) {
- System.err.println(" QUITTING
EsiJspContentDetectionAspect.addPage() as OUTSIDE FRAGMENT OR TEMPLATE");
- return;
- }
-
- if (debug) {
- System.err.println("addPage[" +
this.getClass().getClassLoader().hashCode() + "] ");
- System.err.println("addPage this[" + this + "] ");
-
- MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
- System.err.println(" MethodRtti
Method:"+mrtti.getMethod().toString());
- // +" Return type:"+mrtti.getReturnType() );
- Object[] parameters = mrtti.getParameterValues();
- for (int i = 0, j = parameters.length; i < j; i++) {
- System.err.println(" param "+i+"
Name:"+parameters[i]);
- }
- }
-
- if (obj instanceof Fragment) {
- //Fragment fr = (Fragment) obj;
- //following might not be necessary, but do it anyway
- Fragment frg =
ServicesRegistry.getInstance().getEsiService().getFragment(
- ((Fragment)obj).fragID);
-
- if (joinPoint.getCallee() instanceof JahiaPage ) {
- JahiaPage pg = (JahiaPage) (joinPoint.getCallee());
- frg.addPage(pg.getID());
- if (debug) System.err.println(" COMONNNN
JahiaPage: added Page " +
- pg.getID() + " [" + pg.getTitle() + "]"
- + " to Fragment " + frg.fragID + " on
pageID: " +
- frg.pageID);
- }
- else if (joinPoint.getCallee() instanceof PageBean ) {
- PageBean pgbean = (PageBean) (joinPoint.getCallee());
- frg.addPage(pgbean.getID());
- if (debug) System.err.println(" COMONNNN
PageBEAN: added Page " +
- pgbean.getID() + " [" +
pgbean.getTitle() + "]"
- + " to Fragment " + frg.fragID + "
on pageID: " +
- frg.pageID);
- }
- }
- else if (obj instanceof Template) {
- //Temaplate tpl = (Template) obj;
- //following might not be necessary, but do it anyway
- Template tpl =
ServicesRegistry.getInstance().getEsiService().getTemplate(
- ((Template)obj).pageID);
- //System.err.println(" joinPoint.getCalleeClass().getID()
"+joinPoint.getCalleeClass().getID());
- if (joinPoint.getCallee() instanceof JahiaPage ) {
- JahiaPage pg = (JahiaPage) (joinPoint.getCallee());
- tpl.addPage(pg.getID());
- if (debug) System.err.println(" HOURRRAYYY
added Page "+pg.getID()
- + " [" + pg.getTitle() + "]"
- +" to Template on pageID: "+tpl.pageID);
- }
- else if (joinPoint.getCallee() instanceof PageBean ) {
- PageBean pgbean = (PageBean) (joinPoint.getCallee());
- tpl.addPage(pgbean.getId());
- if (debug) System.err.println(" HOURRRAYYY
PageBEAN: added Page " +
- pgbean.getId() + " [" +
pgbean.getTitle() + "]"
- +" to Template on pageID: "+tpl.pageID);
- }
- } else System.err.println("HOUSTON!!!!!!!!!!!!!
EsiJspContentDetectionAspect: obj is not of type template or fragment...
obj:"+obj);
-} */
-
-
-
- /*
- public void addContainerListSET (JoinPoint joinPoint,
org.jahia.data.containers.JahiaContainerList returnValue)
- throws Throwable {
-
- if (debug) {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "!!!!!!!!!!!!!!!!!!!!!!!!!! -------\n addContainerListSET aspect:
"
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString());
-
- System.err.println(
- "-------\n returnValue: "
- + returnValue);
- }
- JesiObject obj = null;
- try {
- obj = (JesiObject)
ServicesRegistry.getInstance().getEsiService().tagStackPeek();
- } catch(EmptyStackException ex) {
- System.err.println(" QUITTING
EsiJspContentDetectionAspect.addContainerListSET() as OUTSIDE FRAGMENT OR
TEMPLATE");
- return;
- }
-
- if (debug) {
- System.err.println("addContainerListSET[" +
- this.getClass().getClassLoader().hashCode()
+ "] ");
- System.err.println("addContainerListSET this[" + this
+"] ");
-
- MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
- System.err.println(" MethodRtti Method:" +
mrtti.getMethod().toString());
- // +" Return type:"+mrtti.getReturnType() );
- Object[] parameters = mrtti.getParameterValues();
- for (int i = 0, j = parameters.length; i < j; i++) {
- System.err.println(" param " + i + "
Name:" + parameters[i]);
- }
- }
- if (obj instanceof Fragment) {
- //Fragment fr = (Fragment) obj;
- //following might not be necessary, but do it anyway
- Fragment frg =
ServicesRegistry.getInstance().getEsiService().getFragment(
- ((Fragment)obj).fragID);
-
- frg.addContainerList(returnValue.getID(),
returnValue.getPageID() );
- if (debug) System.err.println("
HOURRRAYYY addContainerListSET: added ContainerList " +
- returnValue.getID() + " [" +
returnValue.getDefinition().getName() + "]"
- + " to Fragment " + frg.fragID
+ " on pageID: " +
- frg.pageID);
- }
- else if (obj instanceof Template) {
- //Temaplate tpl = (Template) obj;
- //following might not be necessary, but do it anyway
- Template tpl =
ServicesRegistry.getInstance().getEsiService().getTemplate(
- ((Template)obj).pageID);
- //System.err.println("
joinPoint.getCalleeClass().getID() "+joinPoint.getCalleeClass().getID());
-
- tpl.addContainerList(returnValue.getID(),
returnValue.getPageID() );
- if (debug) System.err.println(" HOURRRAYYY
addContainerListSET: added ContainerList " +
- returnValue.getID() + " [" +
returnValue.getDefinition().getName() + "]"
- + " to Template " + tpl.pageID);
- } else System.err.println("HOUSTON!!!!!!!!!!!!!
EsiJspContentDetectionAspect: obj is not of type template or fragment...
obj:"+obj);
- } */
-
-
- //*******************************************************************
- /* public void detectedActionMenu (JoinPoint joinPoint)
- throws Throwable {
-
- if (debug) {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "-------\n detectedActionMenu aspect: AFTER() : "
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString() );
- }
- JesiObject obj = null;
- try {
- obj = (JesiObject)
ServicesRegistry.getInstance().getEsiService().tagStackPeek();
- } catch(EmptyStackException ex) {
- System.err.println(" QUITTING
EsiJspContentDetectionAspect.detectedActionMenu() as OUTSIDE FRAGMENT OR
TEMPLATE");
- return;
- }
-
- if (debug) {
- System.err.println("detectedActionMenu[" +
this.getClass().getClassLoader().hashCode() + "] ");
- System.err.println("detectedActionMenu this[" + this + "] ");
-
- MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
- System.err.println(" MethodRtti
Method:"+mrtti.getMethod().toString());
- // +" Return type:"+mrtti.getReturnType() );
- Object[] parameters = mrtti.getParameterValues();
- for (int i = 0, j = parameters.length; i < j; i++) {
- System.err.println(" param "+i+"
Name:"+parameters[i]);
- }
- }
- if (joinPoint.getCallee() instanceof ActionMenuTag ) {
-
- ActionMenuTag actag = (ActionMenuTag) (joinPoint.getCallee());
-
- if (obj instanceof Fragment) {
- //Fragment fr = (Fragment) obj;
- //following might not be necessary, but do it anyway
- Fragment frg =
ServicesRegistry.getInstance().getEsiService().
- getFragment(( (Fragment) obj).fragID);
- actag.setFragid(Integer.toString(frg.fragID));
- actag.setPid(Integer.toString(frg.pageID));
-
- if (debug) System.err.println(" HOWDY found
ActionMenuTag inside Fragment #"+ frg.fragID
- + " on pageID: " + frg.pageID);
-
- } else if (obj instanceof Template) {
- //Temaplate tpl = (Template) obj;
- //following might not be necessary, but do it anyway
- Template tpl =
ServicesRegistry.getInstance().getEsiService().
- getTemplate(( (Template) obj).pageID);
- actag.setPid(Integer.toString(tpl.pageID));
-
- if (debug) System.err.println(" HOWDY found
ActionMenuTag inside a Template "
- + " on pageID: " + tpl.pageID);
-
- } else System.err.println("HOUSTON!!!!!!!!!!!!!
EsiJspContentDetectionAspect: obj is not of type template or fragment... obj:"
+ obj);
- }
- }
- */
- //*******************************************************************
- /* public void returnContainer (JoinPoint joinPoint, Object returnValue)
- throws Throwable {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "-------\n returnContainer aspect: "
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString());
-
- System.err.println(
- "-------\n returnValue: "
- + returnValue);
-
- }
-
- public void returnContainer (JoinPoint joinPoint)
- throws Throwable {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "-------\n returnContainer aspect: "
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString());
-
-
- }*/
-
-
-
-
}
-/*
-addContainer aspect: AFTER() :
org.jahia.data.containers.JahiaContainerList::getContainers
-addContainer[4414010] addContainer [EMAIL PROTECTED] MethodRtti
Method:public java.util.Enumeration org.jahia.data.containers.J
-ahiaContainerList.getContainers()
- */
-
-/*
- public void addContainerSET (JoinPoint joinPoint,
org.jahia.data.containers.JahiaContainer returnValue)
- throws Throwable {
-
- if (debug) {
- MemberSignature signature = (MemberSignature)
joinPoint.getSignature();
-
- System.err.println(
- "!!!!!!!!!!!!!!!!!!!!!!!!!! -------\n addContainerSET aspect: "
- + joinPoint.getCalleeClass().getName()
- + "::"
- + signature.getName()
- + "\n"
- + joinPoint.toString());
-
- System.err.println(
- "-------\n returnValue: "
- + returnValue);
- }
- JesiObject obj = null;
- try {
- obj = (JesiObject)
ServicesRegistry.getInstance().getEsiService().tagStackPeek();
- } catch(EmptyStackException ex) {
- System.err.println(" QUITTING
EsiJspContentDetectionAspect.addContainerSET() as OUTSIDE FRAGMENT OR
TEMPLATE");
- return;
- }
-
- if (debug) {
- System.err.println("addContainerSET[" +
this.getClass().getClassLoader().hashCode() + "] ");
- System.err.println("addContainerSET this[" + this + "] ");
-
- MethodRtti mrtti = (MethodRtti) joinPoint.getRtti();
- System.err.println(" MethodRtti
Method:"+mrtti.getMethod().toString());
- // +" Return type:"+mrtti.getReturnType() );
- Object[] parameters = mrtti.getParameterValues();
- for (int i = 0, j = parameters.length; i < j; i++) {
- System.err.println(" param "+i+"
Name:"+parameters[i]);
- }
- }
- if (obj instanceof Fragment) {
- //Fragment fr = (Fragment) obj;
- //following might not be necessary, but do it anyway
- Fragment frg =
ServicesRegistry.getInstance().getEsiService().getFragment(
- ((Fragment)obj).fragID);
-
- frg.addContainer(returnValue.getID(),
returnValue.getPageID() );
- if (debug) System.err.println("
HOURRRAYYY addContainerSET: added Container " +
- returnValue.getID() //+ " [" +
returnValue.getDefinition().getName() + "]"
- + " to Fragment " + frg.fragID
+ " on pageID: " +
- frg.pageID);
- }
- else if (obj instanceof Template) {
- //Temaplate tpl = (Template) obj;
- //following might not be necessary, but do it anyway
- Template tpl =
ServicesRegistry.getInstance().getEsiService().getTemplate(
- ((Template)obj).pageID);
- //System.err.println("
joinPoint.getCalleeClass().getID() "+joinPoint.getCalleeClass().getID());
-
- tpl.addContainer(returnValue.getID(),
returnValue.getPageID() );
- if (debug) System.err.println("
HOURRRAYYY addContainerSET: added Container " +
- returnValue.getID() //+ " [" +
returnValue.getDefinition().getName() + "]"
- + " to Template " + tpl.pageID);
-
- } else System.err.println("HOUSTON!!!!!!!!!!!!!
EsiJspContentDetectionAspect: obj is not of type template or fragment...
obj:"+obj);
-
- } */
-
\ No newline at end of file