Javascript problem.....

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Javascript problem.....

Sathish K Mittapelli

 Hai all........

I am trying to use JS in my xforms. I have written some JS like this with two functions.

<script type="text/javascript">
       
        function getModelData(){
                           var model = document.getElementById("dept-model");
                           var instance = model.getInstanceDocument("department");
                           var dataElement = instance.getElementsByTagName("departments")[0];
                           var itemElements = dataElement.getElementsByTagName("department");
                           var cnt = itemElements.length;
                            if (cnt > 1){
                               
                                    alert("itemElements");
                                }
                            }
        function Submit(){
             alert("Hai All");
             }
       
    </script>

when i am calling a event on mouseover to a table the second function  functioning properly.But with the first  function in which  i am trying to get the model data i am not getting the functionality.

Please give me a Solution for this.
THANKS & REGARDS
SATHISH K MITTAPELLI  



Bring your gang together. Do your thing. Find your favourite Yahoo! Group.

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How do they work together (orbeon++tomcat++eXist) AUTHENTIFICATION

masjab-2
Hey,

Please, I am a newbie and I need some information because I´m stuck  
for days...

I want to build a dictionary app that does the following:
1) Authentificated users(group a) shall be able to subscribe(via  
orbeonXforms) to the dictionary. This form is ready and working.
2) An eXistDb shall store the data...is working, too! The dict.xhtml  
(form from above) submitts the xml output to a save.xq in eXist
3) Authentificated users (group b) shall search the dictionary for  
entries...

Now my problem:
I don´t know how tto build this webapp...
i)I want group b to have access to the webapp but they shall not be  
able to subscribe
ii) the group a shall be the same users as in the eXist database

Do I have to use two different ways???
a) adding users to Tomcat and use the authExample to login into the  
pages
b) adding users to eXist and..then?

As you can see, I don´t even know how it should be done....

Please, if someone could give me something like a "todolist" or an  
"example" ...

It´s frustrating having the Form working and the eXist save.xq but now  
I need to build an app around it...




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: How do they work together (orbeon++tomcat++eXist) AUTHENTIFICATION

fl.schmitt(ops-users)
Hi Masen,

> I want to build a dictionary app that does the following:
> 1) Authentificated users(group a) shall be able to subscribe(via
> orbeonXforms) to the dictionary. This form is ready and working.
> 2) An eXistDb shall store the data...is working, too! The dict.xhtml
> (form from above) submitts the xml output to a save.xq in eXist
> 3) Authentificated users (group b) shall search the dictionary for
> entries...

i think it's easier if you keep the exist-db user administration apart
from the webapp authentification. This way, you don't have to
synchronize the user databases. You could create one exist-db user for
each of the "roles" or groups the users of you webapp could be member
of. When they authenticate in your webapp, you will have to determine to
which group they belong, and depending on that a different db access
could be choosen.

There are different ways to implement such a user-group mapping, for
example using the tomcat-users.xml file [1] or using LDAP. With Orbeon,
you could use web.xml to define which group of users can access which
parts of your application [2]. In your case, you could create a
subdirectory that's accessible by both groups of users (but they have to
authenticate). Then, for the functions that should be available only for
one of the groups, you could create another subdir with a specific
security constraint naming only the specific group. If you put the exist
access credentials inside that subdir, it should be accessible only for
the authenticated users belonging to that group. So it should be sure
that only the authenticated users belonging to that group could access
the exist db according to the permissions of the exist-db "group user".

[1] http://www.orbeon.com/ops/doc/reference-authentication#d276e152
[2] http://www.orbeon.com/ops/doc/reference-authentication#d276e20


HTH
florian




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: How do they work together (orbeon++tomcat++eXist) AUTHENTIFICATION

masjab-2
Ok, that sounds good!
I am going to read the informations and try a little bit...
But I´m pretty sure that I´ll need some help..
I´ll let you know what happens=)


Am 30.04.2008 um 10:52 schrieb Florian Schmitt:

> Hi Masen,
>
>> I want to build a dictionary app that does the following:
>> 1) Authentificated users(group a) shall be able to subscribe(via  
>> orbeonXforms) to the dictionary. This form is ready and working.
>> 2) An eXistDb shall store the data...is working, too! The  
>> dict.xhtml (form from above) submitts the xml output to a save.xq  
>> in eXist
>> 3) Authentificated users (group b) shall search the dictionary for  
>> entries...
>
> i think it's easier if you keep the exist-db user administration  
> apart from the webapp authentification. This way, you don't have to  
> synchronize the user databases. You could create one exist-db user  
> for each of the "roles" or groups the users of you webapp could be  
> member of. When they authenticate in your webapp, you will have to  
> determine to which group they belong, and depending on that a  
> different db access could be choosen.
>
> There are different ways to implement such a user-group mapping, for  
> example using the tomcat-users.xml file [1] or using LDAP. With  
> Orbeon, you could use web.xml to define which group of users can  
> access which parts of your application [2]. In your case, you could  
> create a subdirectory that's accessible by both groups of users (but  
> they have to authenticate). Then, for the functions that should be  
> available only for one of the groups, you could create another  
> subdir with a specific security constraint naming only the specific  
> group. If you put the exist access credentials inside that subdir,  
> it should be accessible only for the authenticated users belonging  
> to that group. So it should be sure that only the authenticated  
> users belonging to that group could access the exist db according to  
> the permissions of the exist-db "group user".
>
> [1] http://www.orbeon.com/ops/doc/reference-authentication#d276e152
> [2] http://www.orbeon.com/ops/doc/reference-authentication#d276e20
>
>
> HTH
> florian
>
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Javascript problem.....

Alessandro Vernet
Administrator
In reply to this post by Sathish K Mittapelli
Sathish,

On Tue, Apr 29, 2008 at 2:48 AM, sathish kumar <[hidden email]> wrote:

> I am trying to use JS in my xforms. I have written some JS like this with
> two functions.
>
> <script type="text/javascript">
>
>         function getModelData(){
>                            var model =
> document.getElementById("dept-model");
>                            var instance =
> model.getInstanceDocument("department");
>                            var dataElement =
> instance.getElementsByTagName("departments")[0];
>                            var itemElements =
> dataElement.getElementsByTagName("department");
>                            var cnt = itemElements.length;
>                             if (cnt > 1){
>
>                                     alert("itemElements");
>                                 }
>                             }
>         function Submit(){
>              alert("Hai All");
>              }
>
>     </script>
>
> when i am calling a event on mouseover to a table the second function
> functioning properly.But with the first  function in which  i am trying to
> get the model data i am not getting the functionality.
You can't access the DOM of the instances in JavaScript, for security
reasons, and for other reasons. You can only access the DOM indirectly
by accessing the value of controls shown in the page and bound to the
instance. This comes down to using the two functions
ORBEON.xforms.Document.getValue() and
ORBEON.xforms.Document.setValue(). You can find more about this on:

http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript-get-set-value

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws