Mark, You can make use of the Project Rules and Validations engine. It sounds like what you're looking for. Dropping down into Java to validate a string is a bit heavy-handed, and it creates an external dependency between your LiveServer project and that class file.
To create a rule, look at the following steps: Administer your project, and select Rules -> Administer Formatting and Validation Rules. Here you can create some rules, such as a ValidateEmail rule. Create a new rule, and then select Operations. Here you can create a chain of checks, but in this case, all you'll need is a CheckPattern operation. Select that, and then hit Options. I'm sure you can figure it out from here. As for accessing this rule via DynaMents, here's an example I've used in the past: <!-- Format check --> <rde-dm:attribute mode="write" attribute="temp" source="request" op="set" value="[#request:email#]" rule="ValidateEmail" result-attribute="email-rule-result" /> <rde-dm:attribute mode="condition" attribute="email-rule-result" source="request" op="ne" value="0" default="0" tag="notag"> <!-- Invalid format --> </rde-dm:attribute> Hope that helps! -Ken PS. I've tried to resend this several times, having problems with the google group. On Dec 8, 1:28 am, MarK <[email protected]> wrote: > First of all, thank You Henry and Daniel for your suggestion. > > Daniel, I found that files. I will try to use it. > > Henry, what I find out, is that my installation of LS 4.0 ( build > 4.0.0.8) in not complete somehow. It looks like I installed LS with > standard option, but location support describe, where files should be > in, shows me empty catalogue. Their suggestion after my feedback was > to upgrade my LS to SP1 plus optional HF. This is very strange for me, > because I thought that standard installation should contain all > needed files. So know I will upgrade my installation in case there are > more files missing in my installation. But once again, thank You for > your help and suggestions. > > Regards > MarK > > On 7 Gru, 17:26, "Henry Lu a.k.a. Javahand" <[email protected]> > wrote: > > > Thats pretty outrageous that support could not point you to the file. > > > Its here rdls-basic-x.x.x.x.jar\de\reddot\liveserver\inlinefunction under > > tomcat\webapps\cps\WEB-INF\lib. Just copy rdls-basic-x.x.x.x.jar to your > > path so javac can find it. > > > rdls-basic-x.x.x.x.jar corresponds to whatever version you are running. > > > Henry Lu > > > On Mon, Dec 7, 2009 at 9:59 AM, Daniel <[email protected]> wrote: > > > Hello MarK, > > > > on LiveServer is a file rde.jar in the WEB-INF/lib directory of your > > > OT Delievery Server installation. This contains the class file you > > > mentioned. > > > > Kind regards, > > > Daniel > > > > On 7 Dez., 11:03, MarK <[email protected]> wrote: > > > > Hello, > > > > > I'm looking for a examples or suggestion how can I extend build-in > > > > java classes with my own class, that I want use as an inline function > > > > in dynaments. I read about it in documentation, I prepared also code > > > > for this class, which looks like this(example e-mail validation): > > > > > package mypackage; > > > > > import de.reddot.xmaps.dynament.DefaultInlineFunctions; > > > > import java.util.regex.*; > > > > > public class form_validation extends DefaultInlineFunctions{ > > > > public boolean email_check (String email) > > > > { > > > > //Set the email pattern string > > > > Pattern p = Pattern.compile("....@.+\\.[a-z]+"); > > > > > //Match the given string with the pattern > > > > Matcher m = p.matcher(email); > > > > > //check whether match is found > > > > boolean matchFound = m.matches(); > > > > > return matchFound; > > > > } > > > > > } > > > > > My problem is that when I am trying to compile this java file into a > > > > class file, my compiler is looking for > > > > de.reddot.xmaps.dynament.DefaultInlineFunctions library which is > > > > necessary to extend standard classes included in the reddot with my > > > > own classes. I couldn't find this de.reddot.... to import it with my > > > > package during compilation. I asked support about that, but they can't > > > > help with that, and they have no example code, or clue how to do that. > > > > I know that this package de.reddot... is build in the LiveServer, I > > > > tried to find it in LS catalogues but with no result. Does anyone know > > > > where I can find this library file > > > > de.reddot.xmaps.dynament.DefaultInlineFunctions so I can use it for > > > > compilation of my own class? I need this class to prepare a form > > > > validation using dynaments on Liveserver platform. And for this > > > > validation, I need some extra functions like e-mail validation. Maybe > > > > someone have an example of this kind form validation on dynaments? I > > > > would be very grateful for any help or suggestions. > > > > > Thanks > > > > MarK > > > > infinity-group.pl > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > > "RedDot CMS Users" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<reddot-cms-users%[email protected]> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/reddot-cms-users?hl=en. > > > -- > > 646-807-8683 -- You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.
