[Xsltforms-support] Applet Packaged XForm (APX)
Brought to you by:
alain-couthures
From: Stephen C. <ste...@gm...> - 2012-06-14 09:52:39
|
---------- Forwarded message ---------- From: Stephen Cameron <ste...@gm...> Date: Thu, Jun 14, 2012 at 7:49 PM Subject: Re: [Xsltforms-support] Xsltforms-support Digest, Vol 37, Issue 3 To: srividhya <n.s...@ni...> Cc: Alain Couthures <ala...@ag...> Hi Vidhya There seem to be minimal web servers about 4KB in size that can be used e.g SimpleWebServer.jar but this starts up on port 80 and if that port is in use then it won't start!, a bit unreliable I think. so forgetting the minimal web-server otpion, I think if you can find a way to start the default browser by the user clicking a jar file, then you might have some success with what I am suggesting. One really crazy idea is to build the whole XForm from inside an applet, so the applet itself contains everything needed (html,css,javascript) and it builds the XForm around itself. This should be possible via DOM scripting. If this is technically feasible it should be possible to create an XForm packager exe that takes all the files needed (XForm (transformed to HTML using xsltforms.xsl), css, Javascript) and builds the 'Applet Packaged XForm' (APX) for you. Interesting idea at least. Steve On Thu, Jun 14, 2012 at 7:16 PM, srividhya <n.s...@ni...> wrote: > thanks for the quick reply Stephen.. > The client have the java in their machine. Tell me any suggestions for the > tools to use to make a bundle as .exe or .jar. > I will try this. > Also previously we have bundled one application which is running on > existdb defaultly it is running on jetty server. > how i create the bundle ie. .exe and .jar is: > 1. developed the application with xquery and xforms and upload into the > existdb. > 2. using the IZpack i bundleld > 3. finally it will create the .exe file and .jar file.so if i click the > .exe file means http://myapp/index.xhmtl will open in the browser > > so,Now in this case, xsltforms is not running under any server. Its going > to be run from the localmachine itself. ok. > here what i want if i click the .exe file means for ex. in browser it has > to open like this.. > file://home/desktop/index.xhtml. > > now can you understand what i trying to say? > > > thanks, > vidhya > > On 06/14/12, *Stephen Cameron * <ste...@gm...> wrote: > > I assume you mean that in the past you bundled exist database server jars > into the exe/jar? > > Not exactly sure how, but I can offer the following suggestions. > You need to package it, as you say, into a single file, if you can assume > they have Java installed then an executable jar will work (or make use of > webstart perhaps). > The jar is just a zip file with a manifest file that identifies a main > class which will start when the user clicks the jar. > Just this is no good as everything the browser needs is inside the jar > (xforms, css,java_script), so the main class has to extract everything into > a temp folder, this is not a problem as it will do it each time. It then > has to start the browser, possibly by executing a batch file that you have > just also extracted, and pass a URL to the browser, which I'm assuming you > can do on the command-line. > > I don't know if this will work as I've never tried it, but it might. > To save the form locally you'll need an applet anyway, I think this exists > in XSLTForms already, but you will have to extend that to make it save into > your jar(zip archive). > You can repackage existing jars into one single jar, there is a tool to do > this. > > Alternately I think Java Webstart (if its allowed to be used) might be > another alternative, this might provide an easier way to start the default > browser perhaps? > > The small web-server idea was something from William Velasquez that he put > out to the XSLTForms mailing list. > > I don't have much time to work on this now but maybe next week, if you > don't get it working yourself, I can try to help you. > > I did propose that this problem be looked at by the XForms working group > but perhaps they don't see it as part of their mandate, but its an > important issue when you are trying to compete with other things like PDF > forms. > > On Thu, Jun 14, 2012 at 5:02 PM, srividhya <n.s...@ni...> wrote: > >> Hi Stephen!!! >> Thanks for the reply!!!!!!!!! and also you are interested .... >> Actually my application is a offline application and it contains a >> single form(embed css, schema, etc..) and a xsltforms folder. Now i want >> issue to the client. how to give as a folder if i give like this means they >> can able to change the form. They may use windows or linux machine. so for >> that i want to give as a .exe file or .jar file . for one click the >> application has to open in the browser and after filling the form , the >> ouput will be saved as xml file. >> >> Previously we bundled the application in existdb (also offline) using >> IZpack. and we make the application as .exe and .jar. but now we have only >> xsltforms folder and a single xhmtl form. so guide me how to do.... >> >> thanks, >> vidhya >> >> >> >> >> On 06/14/12, *Stephen Cameron * <ste...@gm...> wrote: >> >> Hi vidhya >> >> Is an executable jar file going to work for you here? >> I am interested in this problem too, my thoughts are that you need the >> main class in the jar to: >> 1) Extract XML resources from the jar to a folder. >> 2) Start the default browser with the link to the just extracted main >> XForm. >> There was some talk of a micro Java web-server implementation that could >> work in this scenario as well. >> I'm interested to hear what results you have. >> >> On Wed, Jun 13, 2012 at 3:19 PM, srividhya <n.s...@ni...> wrote: >> >>> Hi all!!! >>> Hai i have developed the application using xsltforms in offline >>> mode. In terms of security concern, we can't able to give the application >>> as folder(ie. with xsltforms folder and forms). so, i need your help >>> regarding how to package as the .exe file or .jar file. If anybody have a >>> idea help me... >>> Awaiting for the reply... >>> >>> thanks, >>> vidhya. >>> >>> On 06/12/12, xsl...@li... wrote: >>> >>> Send Xsltforms-support mailing list submissions to >>> xsl...@li... >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>> or, via email, send a message with subject or body 'help' to >>> xsl...@li... >>> >>> You can reach the person managing the list at >>> xsl...@li... >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of Xsltforms-support digest..." >>> >>> >>> Today's Topics: >>> >>> 1. Re: Xsltforms-support Digest, Vol 36, Issue 6 (srividhya) >>> 2. fix: XsltForms_browser.getNil() returns true when @xsi:nil is >>> specified as 'false' (Adam McKee) >>> 3. A blank space renders in place of my nested group should >>> appear (Ihe Onwuka) >>> 4. browser incompatibilities. CSS labels and hints not showing . >>> (Ihe Onwuka) >>> 5. Problem with upload in IE8 without Java installed (it is not >>> clear to user that Java is needed) (Javier D?az) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Thu, 07 Jun 2012 10:44:05 +0530 >>> From: srividhya <n.s...@ni...> >>> Subject: Re: [Xsltforms-support] Xsltforms-support Digest, Vol 36, >>> Issue 6 >>> To: Alain Couthures <ala...@ag...> >>> Cc: xsl...@li... >>> Message-ID: <fb9...@ni...> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> Hi Alain, >>> I have one query regarding the saving the xsltforms output in the same >>> directory of the application residing. >>> >>> I have designed a offline application using xsltforms, which is saving >>> the form value in any of the directory which user wants , but i want to >>> save the output of the form in root directory of the application . Is it >>> possible ? If yes, means how to do? >>> Awaiting of the reply. >>> >>> -- >>> Srividhya >>> >>> >>> On 05/30/12, Alain Couthures <ala...@ag...> wrote: >>> > Hi Sree, >>> > >>> > You should have a look at this example: >>> http://www.agencexml.com/xsltforms/address.xml >>> > >>> > xf:itext support is not inherited from XForms Specification but from >>> JavaRosa implementation. >>> > >>> > Thank you for your feedbacks! >>> > >>> > -Alain >>> > >>> > Le 28/05/2012 12:06, srividhya a ?crit : >>> > >Hi All!!!!! >>> > > >>> > > I want to know about the international support in xsltforms. for >>> example i have a field called "Name" in that the user has to enter either >>> in english or hindi. How to do that one? any sample code is there means >>> greatly help. >>> > > >>> > >with thanks, >>> > >sree >>> > > >>> > >>> > >>> > >>> -- >>> With thanks and Regards, >>> N.Srividhya(RS-I) >>> O.T.C, N.I.C, >>> Chennai. >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> >>> ------------------------------ >>> >>> Message: 2 >>> Date: Thu, 7 Jun 2012 20:06:56 -0600 >>> From: Adam McKee <Ada...@gm...> >>> Subject: [Xsltforms-support] fix: XsltForms_browser.getNil() returns >>> true when @xsi:nil is specified as 'false' >>> To: Xsl...@li... >>> Message-ID: >>> <CAERL=Xz=OZi...@ma...> >>> Content-Type: text/plain; charset="utf-8" >>> >>> Hi Alain and everyone :) >>> >>> I've spent some time integrating my software with XSLTForms, and I feel >>> this has been a good use of time. I had integrated with EMC Formula >>> before, but XSLTForms seems to have all the XForms-y goodness that I >>> require, with a nice open source license. I really appreciate this >>> project. >>> >>> I've hardly got my feet wet with xsltforms.js, but I was able to find out >>> why values in my form were marked as invalid even though they were valid. >>> >>> If @*xsi:nil* is given as 'false', *XsltForms_browser.getNil()* will >>> return >>> true, because *XsltForms_globals.booleanValue('false')* returns true >>> because 'false' is a string with length > 0. >>> >>> This new version of *XsltForms_browser.getNil()* behaves the same as >>> before, except that it returns false if @*xsi:nil* is given as 'false': >>> >>> XsltForms_browser.getNil = function(node) { >>> if (node.nodeType !== XsltForms_nodeType.ELEMENT) return false; >>> var att; >>> if (node.getAttributeNS) { >>> att = node.getAttributeNS(" >>> http://www.w3.org/2001/XMLSchema-instance", >>> "nil"); >>> } else { >>> att = node.selectSingleNode("@*[local-name()='nil' and >>> namespace-uri()='http://www.w3.org/2001/XMLSchema-instance']"); >>> if (!att || (att.value === "")) return false; >>> att = att.value; >>> } >>> return XsltForms_globals.booleanValue(att) && (att !== "false"); >>> }; >>> >>> The context for this is that I use @xsi:nil to make it clear which >>> elements >>> have values which do not, which is helpful to me in the context of forms >>> processing. It's simpler to just include all the elements which may have >>> values, and specifying @xsi:nil='true' means it's clear there's no value, >>> even though the element is present. One would not typically specify >>> @xsi:nil='false', but it's valid to do so, and in this context of working >>> with forms, I find it helpful for values which may *become* nil. >>> >>> @xsi:nil is just a static attribute in a document, but it comes alive >>> quite >>> easily in XForms with this bind: >>> >>> <xf:bind nodeset='//@xsi:nil' calculate="if(..='', 'true', 'false')"/> >>> >>> >>> The bind obviously does not work if you want to have an element be empty >>> and not nil, but I'm OK with not handling that case right now. >>> >>> I had trouble getting the bind to work, until I realized the problem was >>> Firefox-specific and I found this page: >>> >>> http://en.wikibooks.org/wiki/XSLTForms/Known_Restrictions >>> >>> >>> so I specify @xsi:nil='false' on the root html element and now all is >>> well >>> on Firefox :) >>> >>> Something else: it seems that xs:pattern regex can't include a >>> forward-slash unless I backslash-escape it (which causes validation of >>> the >>> schema itself to fail), or I can put it in a character set by itself: >>> "[/]" >>> (which is a good workaround) >>> >>> For example: >>> >>> <xs:simpleType name="fraction"> >>> <xs:restriction base="xs:string"> >>> <!--<xs:pattern value="[0-9]+/[0-9]+"/>--> >>> <xs:pattern value="[0-9]+[/][0-9]+"/> >>> </xs:restriction> >>> </xs:simpleType> >>> >>> >>> It's easy to work around once I found it, but I wanted to mention it. >>> >>> /Adam >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> >>> ------------------------------ >>> >>> Message: 3 >>> Date: Fri, 8 Jun 2012 08:00:00 +0100 >>> From: Ihe Onwuka <ihe...@go...> >>> Subject: [Xsltforms-support] A blank space renders in place of my >>> nested group should appear >>> To: xsl...@li... >>> Message-ID: >>> <CAL...@ma...> >>> Content-Type: text/plain; charset=ISO-8859-1 >>> >>> My problem is that in the view all the fields for address render as >>> blank - that is there is a placeholder where they should appear but it >>> is blank - as below. >>> >>> Clients: >>> Client Name:* >>> >>> Address: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> E-Mail: >>> >>> Phone: >>> >>> Comments: >>> >>> Here is the instance >>> >>> <Client xmlns="http://www.b2b.net/plants"> >>> <Name/> >>> <Address> >>> <BuildingName/> >>> <Street/> >>> <City/> >>> <County/> >>> <Postcode/> >>> </Address> >>> <EmailAddress/> >>> <Phone/> >>> <Comments/> >>> </Client> >>> >>> Here is my model for the instance >>> >>> <xf:model xmlns:xf="http://www.w3.org/2002/xforms" >>> id="clientModel"> >>> <xf:instance src="data/client.xml"/> >>> <xf:bind id="clientName" nodeset="b2b:Name" >>> type="xsd:string" required="true()"/> >>> <xf:bind id="clientBuildingName" >>> nodeset="b2b:BuildingName" type="xsd:string"/> >>> <xf:bind id="clientStreet" nodeset="b2b:Street" >>> type="xsd:string"/> >>> <xf:bind id="clientCity" nodeset="b2b:City" >>> type="xsd:string"/> >>> <xf:bind id="clientCounty" nodeset="b2b:County" >>> type="xsd:string"/> >>> <xf:bind id="clientPostcode" nodeset="b2b:Postcode" >>> type="xsd:string"/> >>> <xf:bind id="clientEmailAddress" >>> nodeset="b2b:EmailAddress" type="xsd:string"/> >>> <xf:bind id="clientPhone" nodeset="b2b:Phone" >>> type="xsd:string"/> >>> <xf:bind id="clientComments" nodeset="b2b:Comments" >>> type="xsd:string"/> >>> <xf:submission id="submitClient" method="Post" >>> action="save-new.xq"/> >>> </xf:model> >>> >>> Here is the view..... it is a case within xf:switch >>> >>> Note the following >>> 1. I have edited out the labels and hints to reduce the clutter. >>> 2. The ref on the group has an absolute address - however the problem >>> still shows when the address is relative as in group ref=b2b:Address >>> >>> <case id="clientCase"> >>> <group ref="/b2b:Client" model="clientModel"> >>> <xf:input xmlns:xf="http://www.w3.org/2002/xforms" >>> bind="clientName"> >>> </xf:input> >>> <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> >>> <group ref="/b2b:Client/b2b:Address" >>> model="clientModel"> >>> <xf:input >>> xmlns:xf="http://www.w3.org/2002/xforms" bind="clientBuildingName"> >>> </xf:input> >>> <html:br xmlns:html=" >>> http://www.w3.org/1999/xhtml"/> >>> <xf:input >>> xmlns:xf="http://www.w3.org/2002/xforms" bind="clientStreet"> >>> </xf:input> >>> <html:br xmlns:html=" >>> http://www.w3.org/1999/xhtml"/> >>> <xf:input >>> xmlns:xf="http://www.w3.org/2002/xforms" bind="clientCity"></xf:input> >>> <html:br xmlns:html=" >>> http://www.w3.org/1999/xhtml"/> >>> <xf:input >>> xmlns:xf="http://www.w3.org/2002/xforms" >>> bind="clientCounty"></xf:input> >>> <html:br xmlns:html=" >>> http://www.w3.org/1999/xhtml"/> >>> <xf:input >>> xmlns:xf="http://www.w3.org/2002/xforms" >>> bind="clientPostcode"></xf:input> >>> <html:br xmlns:html=" >>> http://www.w3.org/1999/xhtml"/> >>> </group> >>> <xf:input xmlns:xf="http://www.w3.org/2002/xforms" >>> bind="clientEmailAddress"> >>> </xf:input> >>> <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> >>> <xf:input xmlns:xf="http://www.w3.org/2002/xforms" >>> bind="clientPhone"> >>> </xf:input> >>> <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> >>> <xf:input xmlns:xf="http://www.w3.org/2002/xforms" >>> bind="clientComments"> >>> </xf:input> >>> <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> >>> </group> >>> <xf:submit xmlns:xf="http://www.w3.org/2002/xforms" >>> submission="submitClient"> >>> <xf:label>Save</xf:label> >>> </xf:submit> >>> </case> >>> >>> >>> >>> ------------------------------ >>> >>> Message: 4 >>> Date: Mon, 11 Jun 2012 11:34:30 +0100 >>> From: Ihe Onwuka <ihe...@go...> >>> Subject: [Xsltforms-support] browser incompatibilities. CSS labels and >>> hints not showing . >>> To: xsl...@li... >>> Message-ID: >>> <CAL...@ma...> >>> Content-Type: text/plain; charset=ISO-8859-1 >>> >>> I have been switching chrome and firefox. >>> >>> Chrome >>> My labels and hints show up on chrome but the my fieldset and legend >>> tags do not work. Takes forever for browser to render the the XForm >>> (minutes). >>> >>> Firefox >>> Fieldset and legend tags work but labels and hints don't display ..... >>> slow to render but not nearly as slow as chrome and >>> >>> I am running on ubuntu 12.4 >>> >>> >>> >>> ------------------------------ >>> >>> Message: 5 >>> Date: Tue, 12 Jun 2012 20:18:20 +0200 >>> From: Javier D?az <jd...@tc...> >>> Subject: [Xsltforms-support] Problem with upload in IE8 without Java >>> installed (it is not clear to user that Java is needed) >>> To: XSLTForms support <xsl...@li...> >>> Message-ID: <4FD...@tc...> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> Hello, >>> >>> In order to test my web with IE, I installed a virtual machine to test >>> it. >>> >>> When testing upload control, it didn't work, it didn't load the applet, >>> but no error message appeared. >>> >>> Another person tested it and I realized I hadn't java installed in my >>> virtual machine. >>> >>> The only problem with IE8 and Java is that it doesn't appear a clear >>> error that says to you that you need Java to use the web. Instead, it >>> appear ajava_script error in IE that people don't pay attention to it. >>> >>> >>> I have done this change in my xsltforms version in order to make clear >>> that Java is not installed: >>> >>> >>> if (document.applets.xsltforms) { >>> return document.applets.xsltforms.readFile(fname, >>> encoding, xsdtype, title) || ""; >>> } else { >>> - if( document.getElementById("xsltforms_applet") ) { >>> + if( document.getElementById("xsltforms_applet") && >>> (typeof document.getElementById("xsltforms_applet").readFile != >>> 'undefined')) { >>> return >>> document.getElementById("xsltforms_applet").readFile(fname, encoding, >>> xsdtype, title) || ""; >>> } else { >>> XsltForms_browser.loadapplet(); >>> if (document.applets.xsltforms) { >>> return >>> document.applets.xsltforms.readFile(fname, encoding, xsdtype, title) || >>> ""; >>> } else { >>> - if( >>> document.getElementById("xsltforms_applet") ) { >>> + if( >>> document.getElementById("xsltforms_applet") && (typeof >>> document.getElementById("xsltforms_applet").readFile != 'undefined')) { >>> return >>> document.getElementById("xsltforms_applet").readFile(fname, encoding, >>> xsdtype, title) || ""; >>> + } else { >>> + alert("Error: Java no est? >>> habilitado. Es necesario Java para subir ficheros en Internet Explorer"); >>> } >>> } >>> } >>> >>> (Alert message is intentionally in Spanish, because is an internal web) >>> >>> I hope it is useful to anybody. >>> >>> Best Regards, >>> Javier >>> >>> PS: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> ************************************************************************************************************************************************ >>> *La informaci?n contenida en este mensaje de correo electr?nico es >>> confidencial y puede revestir el car?cter de reservada. * >>> *Est? dirigida exclusivamente a la persona >>> destinataria. >>> * >>> *El acceso o cualquier uso por parte de cualquier otra persona de este >>> mensaje no est?n autorizados y pueden ser ilegales.* >>> *Si no es Ud. la persona destinataria, le rogamos que proceda a >>> borrarlo. >>> * >>> *The information in this e-mail is confidential and may be legally >>> privileged. >>> * >>> *It is intended solely for the >>> addressee. >>> * >>> *Access or any use by any other person to this Internet e-mail is not >>> authorised and may be unlawful. * >>> *If you are not the intended recipient, please delete this >>> e-mail. >>> * >>> >>> ************************************************************************************************************************************************ >>> >>> -------------- next part -------------- >>> A non-text attachment was scrubbed... >>> Name: jdiaz.vcf >>> Type: text/x-vcard >>> Size: 397 bytes >>> Desc: not available >>> >>> ------------------------------ >>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. >>> Discussions >>> will include endpoint security, mobile security and the latest in >>> malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>> >>> >>> End of Xsltforms-support Digest, Vol 37, Issue 3 >>> ************************************************ >>> >>> -- >>> With thanks and Regards, >>> N.Srividhya(RS-I) >>> O.T.C, N.I.C, >>> Chennai. >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>> >>> >> -- >> With thanks and Regards, >> N.Srividhya(RS-I) >> O.T.C, N.I.C, >> Chennai. >> > > -- > With thanks and Regards, > N.Srividhya(RS-I) > O.T.C, N.I.C, > Chennai. > |