<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
hello andy, ...<br>
<br>
the core of opencms is a singleton, and thus it is only instantiated
once, and it only creates one instance of the module class, too. it
also holds a reference to the module action object, so it will not
disappear. <br>
<br>
a.) to store the reference to CmsObject that is being passed to the
initialize() method, you could do something like this:<br>
<br>
<br>
<tt> public class BlahAction extends A_CmsModuleAction {<br>
<br>
private CmsObject co;<br>
<br>
[...]<br>
<br>
public void initialize(<br>
CmsObject _co, <br>
CmsConfigurationManager _ccm, <br>
CmsModule _cm) {<br>
this.co = _co;<br>
}<br>
}<br>
<br>
</tt>b.) to get a reference to the module's instance, you could simply
do something like this:<br>
<br>
<tt> public class BlahAction extends A_CmsModuleAction {<br>
<br>
private static </tt><tt>BlahAction </tt><tt>instance;<br>
<br>
</tt><tt> public void initialize(...) {<br>
instance=this; <br>
}<br>
</tt><tt> <br>
public static </tt><tt>BlahAction get</tt><tt>BlahAction() {<br>
return instance; <br>
</tt><tt> }<br>
}<br>
</tt><tt> <br>
</tt>you will have to check the return value of getBlahAction, though.
if the modules hasn't been initialized properly, it will be null.<br>
<br>
this concludes our lesson for today. in the next session, we will try
to combine a.) and b.) ...<br>
<br>
:)<br>
<br>
.rm<br>
<br>
<br>
<br>
Andy Bicksbo schrieb:
<blockquote
cite="midc67d43dd0611041936k6727c12awa1f4048b09c18941@mail.gmail.com"
type="cite">Hi
<br>
Does somebody may now how or where to store these instantiated Object
(at
<br>
initialize of ModuleActionHandler) for later use?
<br>
That whould help me alot
<br>
thx
<br>
andy
<br>
<br>
<br>
2006/11/4, Jonathan Woods <a class="moz-txt-link-rfc2396E" href="mailto:jonathan.woods@scintillance.com"><jonathan.woods@scintillance.com></a>:
<br>
<blockquote type="cite"><br>
Or if you're not packaging up the module as a JAR, the XML which Ruben
<br>
gives
<br>
may be incorporated directly in opencms-modules.xml.
<br>
<br>
Jon
<br>
<br>
-----Original Message-----
<br>
From: <a class="moz-txt-link-abbreviated" href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>
<br>
[<a class="moz-txt-link-freetext" href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] On Behalf Of ruben malchow
<br>
Sent: 04 November 2006 18:44
<br>
To: The OpenCms mailing list; <a class="moz-txt-link-abbreviated" href="mailto:schlachtzeuger@gmail.com">schlachtzeuger@gmail.com</a>
<br>
Subject: Re: [opencms-dev] I_CmsModuleAction
<br>
<br>
<br>
hi andy,
<br>
<br>
try putting this in your module's manifest file:
<br>
<br>
[...]
<br>
<module>
<br>
<name>youModuleName</name>
<br>
<nicename>Your Nice Module Name</nicename>
<br>
<class>com.foo.bar.bar.YourCmsModuleActionImpl</class>
<br>
[..]
<br>
</module>
<br>
[...]
<br>
<br>
.rm
<br>
<br>
> Hi all
<br>
> Has anybody some expirience with this and could explain some
basics?
<br>
> I made a new Module in Opencms called com.me.doit i have several
<br>
> package in the jar file, but the package with Class, which
implements
<br>
> the I_CmsModuleAction is called "com.me.doit" and the class
<br>
> "AtStartup"
<br>
> The imput field called Action class at the Module edit screen i
set to
<br>
> com.me.doit.AtStartup AtStartup implements this interface and at
the
<br>
> initialize Method i try to mkdir something, but somehow the
initialize
<br>
> method is never invoked.
<br>
> Can anybody plz help me...
<br>
> -How to name packages and the Module
<br>
> -How to set the right stuff for Action class in the Module -Do i
have
<br>
> to import or install the Module first or what else do i have to
do?
<br>
>
<br>
> thx
<br>
> Andy
<br>
>
<br>
>
----------------------------------------------------------------------
<br>
> --
<br>
>
<br>
>
<br>
> _______________________________________________
<br>
> This mail is sent to you from the opencms-dev mailing list To
change
<br>
> your list options, or to unsubscribe from the list, please visit
<br>
> <a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
<br>
<br>
<br>
_______________________________________________
<br>
This mail is sent to you from the opencms-dev mailing list To change
your
<br>
list options, or to unsubscribe from the list, please visit
<br>
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
<br>
<br>
<br>
<br>
_______________________________________________
<br>
This mail is sent to you from the opencms-dev mailing list
<br>
To change your list options, or to unsubscribe from the list, please
visit
<br>
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
<br>
<br>
</blockquote>
<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a></pre>
</blockquote>
<br>
</body>
</html>