Re: For those using Javascript

2020-01-17 Thread Tom DeMeo via 4D_Tech
Hi,


As Julio mentioned, Kendo UI has very fast, very well thought out grid tools. 
I’ve worked with them for a few years now.

The recommendation I would add is to not choose a grid separately, but rather 
to choose a complete UI toolkit. It is not ideal to have separate frameworks 
for various widgets. It is too much to manage and learn, and it is harder to 
provide a consistent look and coding style.

I chose Kendo’s complete UI framework, not just its grid.


Tom DeMeo
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Web aficionados - Not allow user to access file directly

2019-10-02 Thread Tom DeMeo via 4D_Tech
Hi,


A few commenters have suggested placing a 4D Web server behind a proxy server.

The problem as described can be very easily solved with very little change in 
complexity and without involving other technologies. One of the reasons we all 
use 4D is that it allows us to solve problems with less complexity. I suggest 
that developers should try to use just the 4D web server unless you have a good 
reason not to.  

Most of the time when I’ve encountered more complex web architectures involving 
4D and other technologies, it didn’t solve much of anything and just made 
maintenance and development more difficult.

Can anyone come up with an anecdote of any actual exploited vulnerabilities of 
a well constructed 4D web site?



Tom DeMeo
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D and Mongo

2019-03-07 Thread Tom DeMeo via 4D_Tech
Hi,


I’ve worked on a web site that does quite a bit of this. A MongoDB is typically 
part of an Apache/PHP based web site configuration which would already have a 
PHP Mongo module in place (its just a database of JSON objects). If that is the 
case, a 4D DB can make HTTP Client requests, and the requests can be handled on 
their side by a web page written to handle your AJAX request with PHP based 
queries. 


Tom DeMeo
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

[off] Project Request

2019-02-11 Thread Tom DeMeo via 4D_Tech
Hi David,

I've worked extensively with Active4D for over a decade, and also did a 2 year 
full time stint building an app with Wakanda, so I should have the skills your 
client is looking for. 

Let me know if they have any interest in discussing this project. 


Regards,

Tom DeMeo
tde...@walthamsoftware.com 
781-405-9381



A customer of mine asked me to post this.

He has a project request using 4D’s REST API or Wakanda in front of 4D,
creating a web-site that can replace an existing web site that is partially
generated from Active4D.

If you are interested, and familiar with these tools, please contact me.

Thanks!
David Ringsmuth

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Quoted from: 
http://4d.1045681.n5.nabble.com/off-Project-Request-tp5762348.html


_
Sent from http://4d.1045681.n5.nabble.com

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WA Evaluate JavaScript in 16.4

2018-12-20 Thread Tom DeMeo via 4D_Tech
Hi,


I would suggest constructing an HTML page and loading any javascript libraries 
you need into it. Then load that page into a web area on a form. That will 
allow you to use WA EXECUTE JAVASCRIPT FUNCTION instead to call the functions 
you need from your loaded page. If this has to occur on the server and you 
cannot run a utility client, the NTK plugin 
https://www.pluggers.nl/product/ntk-plugin/ has a javascript interpreter that 
may work for you.

 

Tom DeMeo

> Message: 4
> Date: Thu, 20 Dec 2018 10:21:00 -0800
> From: Noah 
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: WA Evaluate JavaScript in 16.4
> Message-ID:
>   
> Content-Type: text/plain; charset="UTF-8"
> 
> Thanks for the quick reply!
> 
> We had constructed a minimal test: an external js file that contains
> *alert('hello')* on a single line and nothing else.
> 
> We may have now narrowed the scope of this issue to WA Execute JavaScript's
> ability to handle the '\n' in the javascript that it reads from a file.
> 
> When the file is read into 15.4 or 16.4 the returned text is
> *alert('hello')\n*. This was not a problem in 15.4, but the \n creates a
> problem with WA Evaluate JavaScript in v16.4.
> 
> Overcoming the bug by processing the read JS (to remove the \n) does the
> trick for our very simple test case (JavaScript in external files that are
> only a single line). Web areas in v16.4 will now 'alert' as expected.
> 
>$tJS_path:=Get 4D folder(Current resources folder)+"ncs_test.js"
>DOCUMENT TO BLOB($tJS_path;$bDoc)
>$test_js:=BLOB to text($bDoc;UTF8 text without length)
>  // replace the carriage return \n with ''
>$codeBody:=Replace string($test_js;Char(10);"")
>WA Evaluate JavaScript(wa;$codeBody)
> 
> However, this is obviously not going to solve our larger problem of being
> able to load JavaScript libraries to scrape a web page.
> 
> The JavaScript code in the external files contains comments... and perhaps
> other nuances that would render the above solution insufficient.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Flexible SVG ID Strategy

2018-06-06 Thread Tom DeMeo via 4D_Tech
Hi John,


I understand there are cases where you might build an SVG interface using 4D 
commands instead of using javascript in a web area. But when you want to do 
drag and drop, that is probably the use case that will most benefit from using 
javascript. You can use a parent/child technique that works so well in js. Your 
IDs can just be auto assigned and can relate to the IDs of your associated 4D 
data.



Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: HTTPS Connection for Web Module

2018-05-08 Thread Tom DeMeo via 4D_Tech
Hi,


One of the main reasons to use 4D to publish on the web is the efficient 
simplicity of the architecture. There may be circumstances where putting 
another web server such as Apache in front is worth the trouble, but all too 
often, its done for no good reason. 

Getting the correct files for an SSL cert for your web server is not solved in 
any way by adding another layer to your architecture, unless there is already 
an Apache server with SSL in place for you to use. Just go back to your IT  
department and make sure they give you both the cert and key files. 


Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D data on the web - what do you use?

2018-03-14 Thread Tom DeMeo via 4D_Tech
Hi,


I highly recommend Active4D as your server side solution, assuming you plan to 
do more than a few days worth of web work. You will almost certainly have to 
work through many of the issues that Active4D would provide solutions for, and 
you almost certainly won’t do as good a job of it. The time savings will end up 
being substantial. With Active4D, you are writing server side logic with a 
superset of 4D code which resides in external text documents, and it is a 
fairly short learning curve.

There are lots of editing solutions. I use Sublime Text. It has themes for 
Active4D syntax formatting which helps a lot.

You should think carefully about using a REST architecture. You usually don’t 
want to expose all of your business logic client side, and most of us end up 
wanting to coordinate client server logic with web logic.  I’m not sure I 
understand how anyone can do anything complicated without a 4D developer being 
involved, although you may very well benefit from separating back end and front 
end responsibilities. 

I avoid any processing tags or HTML processing server side and stick to AJAX 
for anything I need from 4D. This enforces reusability of your code.

I like Kendo UI/jQuery for the front end. You probably won't need anything 
else. Like with Active4D, working with a high quality framework saves a lot of 
time. There is a lot of stuff to solve (widgets, CSS, templating, transport 
mechanisms/AJAX calls, data binding, and on and on…) and really good frameworks 
do much of it for you in a carefully engineered way you probably couldn’t 
achieve yourself. I try to use as few tools as I can because it is so easy to 
end up having to learn at least three or four libraries for every project if 
you aren’t careful.

At least one developer with good Javascript skills is necessary for anything 
complex, and it isn’t easy to keep things organized without some experience. 
Web work is nowhere near as self organizing as a 4D app is, and it can turn 
into a tangled mess without some planning.


Best of luck,


Tom DeMeo


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Javascript Calendar in Web Area

2018-02-10 Thread Tom DeMeo via 4D_Tech
Hi,


I would recommend that choosing a Calendar is less important than choosing a 
web UI/datasource framework (which would include a Calendar solution) and using 
it whenever you have a choice. Picking and choosing libraries for specific UI 
problems makes development more difficult and inefficient. In some specific 
cases, like charting, it makes sense, but for a Calendar, that’s less likely. 
Perhaps you have a really specific need that narrows what you can use, but its 
more likely that you can use any of the better UI frameworks for your solution.

I’d go shopping for a web UI toolkit and stick with it. I’ve been using Kendo 
UI more recently and really like the Calendar functionality, and more 
importantly the whole framework is great to work with.

As for how to get data into and get data out of a web area, it is very 
straightforward:


From 4D code to call javascript in the Web Area - WA EXECUTE JAVASCRIPT 
FUNCTION:
http://doc.4d.com/4Dv16/4D/16.3/WA-EXECUTE-JAVASCRIPT-FUNCTION.301-3652382.en.html
 



From the Web Area,  to call 4D methods using javascript code, look for using 
the $4d object in the middle of the page below:
http://doc.4d.com/4Dv16/4D/16.3/Programmed-management-of-Web-Areas.300-3652400.en.html
 




Tom
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Data from 4D to a webpage

2018-01-07 Thread Tom DeMeo via 4D_Tech
Hi Carl,


Based on what you said you wanted, I think what you need is to use the 4D HTTP 
client commands to post an HTTP Request to your web server from your standalone 
4D app. It would be the equivalent of having 4D fill out a form in a browser 
and submit it to your web server. No 4D tags would be involved. To your web 
server, it can be processed just like a submitted form.

Look in the 4D Language reference of the version you are using, and look under 
the HTTP Client theme. You’ll probably use the HTTP Request command


Regards,


Tom DeMeo




> On Jan 7, 2018, at 3:00 PM, 4d_tech-requ...@lists.4d.com wrote:
> 
> Message: 3
> Date: Sun, 7 Jan 2018 13:21:39 +0100
> From: "Carl Aage Wangel" >
> To: <4d_tech@lists.4D.com >
> Subject: Re: Data from 4D to a webpage
> Message-ID: <000c01d387b2$13cc2230$3b646690$@online.no 
> >
> Content-Type: text/plain; charset="us-ascii"
> 
> Thanks Janet,
> 
> I am selling/giving away  a few (very few) stand-alone solution created in
> 4D. My dream was to make the costumer connect to my webpage from the 4D
> solution and provide needed information on an automatic level, using 4D
> TAGS. My webpage is HTML5 embedded in PHP with a mySQL connection. 
> 
> Carl

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Anyone using 4D Write Pro with a semblance of success?

2017-10-17 Thread Tom DeMeo via 4D_Tech
Hi,


If you want to build emails or edit different types of text files that are kept 
server side, the Ace editor embedded in a web area is a better library than 
Tiny MCE. They seem to be shooting for a web implementation of Sublime Text. 
There are a ton of customizable features, and it’s nicely designed.

One advantage is that it isn’t that hard to implement the Active4D coding 
theme, which effectively provides a nice syntax highlighting/tokenization of 4D 
commands, as well as javascript, HTML and just about any other language you’d 
want. 


https://ace.c9.io/ 




Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Canvas alternative

2017-10-03 Thread Tom DeMeo via 4D_Tech
Hi Jim


Could you please explain a bit further how you get from attributes to event 
callbacks? Do you capture an event on the SVG area and scan all its element 
attributes?

I took a look at the Projects page you mentioned but those are screen shots.



Tom

> --
> 
> Message: 4
> Date: Tue, 3 Oct 2017 08:25:10 +0200
> From: Jim Dorrance 
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: Canvas alternative
> Message-ID:
>   

Re: SVG scale

2017-09-20 Thread Tom DeMeo via 4D_Tech
Hi Ortwin,



> On Sep 20, 2017, at 3:00 PM, 4d_tech-requ...@lists.4d.com wrote:
> 
>> 
>> SVG is a whole lot easier to manage in JavaScript.
> 
> I'm wondering about modern myths …


Perhaps you’ve primarily used SVG to render fixed images, or if the images do 
change, the triggers come from events in 4D, not on the SVG area. In that case, 
you probably don’t notice much difference. But the SVG spec creates objects 
just like HTML does, and just like HTML, you can bind events and attributes to 
those objects, and can do some very useful interactive stuff

The 4D SVG component and the 4D language don’t have any direct way to apply 
events to individual objects in an SVG area. With Javascript, this is easy. It 
is object oriented. Each SVG object can contain its own event handlers and 
attribute data. Objects can inherit prototype traits. Objects can nest inside 
each other. The language is built for this stuff.

An example of the difference would be in an implementation of drag and drop in 
SVG. You can do it with 4D, but it takes quite a few lines of code. Its pretty 
awkward, especially if there are a lot of objects. The same problem in 
javascript is simple and elegant and fast.



Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG Scale

2017-09-20 Thread Tom DeMeo via 4D_Tech
Hi,


> SVG is a whole lot easier to manage in JavaScript. If for no other reason,
> you've got access to the D3 libraries. 

I would strongly concur with David Adams point that you want to manage SVG with 
javaScript instead of the 4D language. This is an object oriented scheme, and 
its pretty difficult to work with if you don’t have an object oriented language 
to work with it. The D3 libraries or some other library are important too, but 
the language itself is truly important.


> * He's also pretty into that freight-car-function style from jQuery which I
> hated on sight. But it does make it easier to set a ton of properties
> legibly in a compact space. Virtually everything in D3 is set to return in
> a way that supports this syntax so, yeah, be aware of that.


This style is really just accepting a single hierarchical object of parameters. 
You can write code that defines attributes in objects in a lot of different 
ways in javaScript. I’d recommend to anyone that they spend some time 
considering a coding style that appeals to them and always try to do it the 
same way. The syntax the library’s examples shows you is not mandatory. Its 
just a javascript object, and as long as you respect the underlying 
architecture of that object, you can use whatever syntax you prefer. 


Regarding SVG scaling, I haven’t specifically used D3, but I’m sure it makes 
scaling issues easier. However, scaling in SVG is still something that requires 
you to think through the relationships of your objects. It isn’t magic, and it 
can’t guess what you have in mind.

Consider the scheme on a 4D form. In 4D, the form itself and the objects have 
sizing parameters (none/move/grow). Splitters can provide additional control. 
Its a nice, simple scheme. However, if you don’t bother to set these 
parameters, you don’t get the scaling you want.

A few years ago, I worked out an HTML layout scheme using a different 
javascript library, Raphael. I wrote a code library so that I could set 
move/grow parameters just like 4D provides in its forms, which I think is a 
pretty smart scheme. I haven’t done anything with it for quite a while, but I’m 
still hosting a demo, so you can check it out:

http://www.svglayout.com/svglayout/index.html 


When you get there, click on the SL widget in the upper right corner to 
activate the editor. You will see object outlines and handles and can drag 
objects around. You can also double click on an object to see the sizing and 
scaling attribute dialog. The whole site you see is built using an SVG based 
layout scheme. Traditional HTML layout strategies are not used.



Tom DeMeo







> --
> 
> Message: 5
> Date: Wed, 20 Sep 2017 09:02:08 +1000
> From: David Adams 
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: SVG Scale
> Message-ID:
>   

Re: SVG Scale

2017-09-19 Thread Tom DeMeo via 4D_Tech
Hi Jim,


It’s a common misperception that scaling in SVG is easy. You can apply a 
transform to get one specific scaling scheme, but there are a number of 
possible rules you might need for how you might want an object to scale. How an 
object might scale using a simple transform is baked in. If you want full 
programmatic control over the anchor points and how an object scales relative 
to the canvas and other objects, you need to write code to recalc coordinates 
yourself. 

Sorry it isn’t easier.


Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D and Fusion Charts

2017-09-12 Thread Tom DeMeo via 4D_Tech
Hi John,


Fusion charts will allow you to set an on click event handler in javascript. 
You need that function to be part of the page you are loading in the web area. 
You probably can look at one of your Wakanda examples to see how that event 
handler is written. Inside that function, you can make a call back to 4D, using 
the $4d object. For a detailed explanation, take a look at the following 
documentation:


http://doc.4d.com/4Dv16/4D/16.2/Programmed-management-of-Web-Areas.300-3434143.en.html
 



About half way down that page is a good description of how to access 4D methods 
and write your function. 

Look for “Accessing 4D methods” and “Using the $4d object”


___


Tom DeMeo





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Converting Quick Reports from 4D 2004 to Modern Version

2017-08-02 Thread Tom DeMeo via 4D_Tech
Hi Doug,


I had a conversion with this problem going from v11 to v15. There were numerous 
quick reports that were written in 2004 and were being used, but not re-saved 
in v11.

Quick Reports written in 2004 would open v11 but not v15. If they are saved in 
v11, we found you can then open them in v15. I don’t know about v12-14, but 
some or all of those  might serve to bridge this gap too.

We did not automate conversions because we had lots of users who stored quick 
report files locally. We sent out notes to have them prep their reports for the 
conversion.



Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: C-objects and memory use

2017-07-25 Thread Tom DeMeo via 4D_Tech
FWIW - This does sound like the way javascript objects work.


Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: XML or rest services

2017-03-29 Thread Tom DeMeo via 4D_Tech
Chuck,


4D Tags will help you compose, but they won’t help you parse. If you get an 
response from a request, whether XML or JSON, you will start with text. If you 
use XML, see the XML DOM commands. You would use DOM Parse XML source. You can 
then use commands in the XML DOM theme to inspect the results.

If you get JSON, you can parse the text into an object variable and inspect 
that with the Objects(Language) commands


Tom
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Understanding 4D Mobile

2017-02-17 Thread Tom DeMeo via 4D_Tech
Hi,

I worked with 4D Mobile and Wakanda for a couple of years, and for simply 
publishing grids and detail views of data from 4D, its pretty impressive how 
quickly you can put something together. Unfortunately, once you get into 
editing data and client side business logic, (which is what most of us do for a 
living), a developer will have to dig in every bit as much as they might using 
any other technology stack on the market. Personally, I have found it easier 
having my client side code making AJAX calls directly to 4D. You can write 
server side response code right into 4D methods, use Active4D (what I would 
recommend) or even try working with the new javascript framework in the latest 
version of NTK toolkit . 

I also don’t think using Wakanda as a back end is any easier than making calls 
to 4D via AJAX. Either way, 4D developers will need to learn some new things, 
but Wakanda is a whole new framework. At least with 4D, you are on familiar 
ground.

So, for simply browsing data in situations where the licensing is not a major 
issue, the 4D Mobile/Wakanda stack is a real time saver. When you are servicing 
larger numbers of users or building web apps that require significant business 
logic,  use a Web Expansion with unlimited connections, and manage your own 
requests and responses. A number of client side framework combinations will 
semi-automate your requests and your client side data modeling for you, and the 
server side responses aren’t really that hard to build from 4D.



Tom DeMeo
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**