[opencms-dev] custom class for templateone.form

Ian Kavanagh ikavanagh at acm.org
Wed May 2 16:36:34 CEST 2007


Carl Alex Friis Nielsen wrote:
> ok - sorry - I've nerver seen that done.
>
> Personally I find it most convenient to build the jar file and copy it to
> the webapps/opencms/WEB-INF/lib folder in the real file system without
> bothering to upload it to the module during devlopment.
> That would save you the work to find the proper place in the classes folder's
> subfolders to put the .class files and having to move multiple files around.
>
> Cheers,
>
> Carl
>
>   
>> -----Original Message-----
>> From: opencms-dev-bounces at opencms.org@KB On Behalf Of Detlef Beyer
>> <d.beyer at crash.de>
>> Sent: Wednesday, May 02, 2007 11:07 AM
>> To: The OpenCms mailing list
>> Subject: RE: [opencms-dev] custom class for templateone.form
>>
>>
>> I have to disagree a litle bit - I use libs only when I 
>> finshed my development. It works fine to put the .class files 
>> into my classes folder.
>>
>> Detlef
>>
>>     
>>> You have misunderstood the structure of modules.
>>> The "classes" folder is used to hold property files mostly 
>>>       
>> containing localized
>>     
>>> strings.
>>> If you want to add java stuff, build it into a jar file and 
>>>       
>> put it in the
>>     
>>> "lib" folder (dont forget to publish the jar file and to 
>>>       
>> restart the application server.)
>>     
>>> BTW Templateone is NOT a good tool to learn to use OpenCms - 
>>>       
>> it is way too complicated.
>>     
>>> Cheers,
>>>
>>> Carl
>>>
>>>       
>>>> -----Original Message-----
>>>> From: opencms-dev-bounces at opencms.org@KB On Behalf Of Ian Kavanagh
>>>> <ikavanagh at acm.org>
>>>> Sent: Wednesday, May 02, 2007 3:59 AM
>>>> To: opencms-dev at opencms.org
>>>> Subject: [opencms-dev] custom class for templateone.form
>>>>
>>>>
>>>> Greetings,
>>>>
>>>> I am new to OpenCms and am trying to do the following:
>>>> create a new form field type for templateone which allows for
>>>> a simple
>>>> block of text with no corresponding input field in the 
>>>>         
>> form, and have
>>     
>>>> this field be an option in the drop-down menu of the form
>>>> field section
>>>> of the edit dialog for an email form html file.  My idea 
>>>>         
>> is that the
>>     
>>>> user would select "Text Label" from the "Type" menu, and then
>>>> enter the
>>>> text to be displayed in the "Label" section.
>>>>
>>>> So far I have created a class called "CmsTextLabel" which extends
>>>> A_CmsField, compiled it, and put the .class file into the:
>>>> /system/modules/org.opencms.frontend.templateone.form/classes/
>>>> org/opencms/frontend/templateone/form/
>>>> directory.
>>>>
>>>> Also, I have created a file "CmsTextLabel.properties" which
>>>> consists of
>>>> the following text:
>>>> FIELDS=textlabel:org.opencms.frontend.templateone.form.CmsText
>>>> LabelField
>>>> and placed it into the:
>>>> /system/modules/org.opencms.frontend.templateone.form/classes/
>>>> directory.
>>>>
>>>> I have been trying to figure out the next steps in this
>>>> process from the
>>>> source code, but posting my question to opencms-dev seemed
>>>> like the most
>>>> efficient idea.  I haven't found any tutorial that specifically
>>>> addresses this question and would be very grateful for any 
>>>>         
>> assistance.
>>     
>>>> Thanks,
>>>> Ian
>>>>
>>>> _______________________________________________
>>>> 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
>>>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>>>
>>>>
>>>>         
>>> _______________________________________________
>>> 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
>>     
>>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>>       
>> _______________________________________________
>> 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
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>
>>
>>     
>
> _______________________________________________
> 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
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>   
Thanks very much for your prompt replies.  I did take a look at the 
.properties files in the classes directory, and it seemed like these 
strings are the actual text displayed on the edit form page, so I added 
an entry for my custom class in the "Input field types" section as follows:

form.field.type.textLabel = Text label

I hoped this would then show up as an option in the "Type:" drop-down 
menu, but it does not.
So basically, my problem is that I have my custom class, along with a 
.properties file for it, but I don't know how to integrate it into the 
larger templateone framework.  (My apologies if I'm missing something 
glaringly obvious).

Thanks again,
Ian



More information about the opencms-dev mailing list