FileMaker Basic DAPI walkthrough, Using RCC PHP Wrapper to drive web pages...Feb 23, 2022
oh dammit hi everyone rich carlson welcome to another amazing day of
filemakertrain. I'm here with jacob taylor whose video still works. Hi Jacob, how are you? I'm going to frame the conversation a little bit at the front because I want to make sure I see some feedback here, but I'm a little concerned that people think maybe this is something that it's not, so what I did was go out. my handy dandy book the book that we wrote and we actually talked about the specific topic here and there are differences here on this so I want to make sure that we reference the textbook class go to page 146 and 147 so Anyway, um, we'll talk about that today.
It's very cool, very exciting to be doing the archive creation platform. The next broadcast program today is the data API tour. Basically you are
usingthe file build server as the data source. It is a data source for your website. He is also a listener. a listener for incoming data coming into
filemakerwe'll talk about this it's a very important concept it's very important to all of you you may not understand how to code this but you need to understand what products can do correctly filemaker products there are a number of different products that do certain things certain things they just don't do they don't do them naturally you could do as always you would like to hack it to do it but uh unnatural and that unnatural ax with a filemaker product is not legal so we want to make sure you're
usingthe right tool for the right job so today tomorrow you can optimize your archive builder container backup so we'll cover with jacob taylor tomorrow a topic you're very familiar with . what's the idea is not that you separate um your containers, but that you back them up in different locations, so your file builder files, your fp12 files, go to one place, the containers go to a different place that allows you handle them.
More Interesting Facts About,
filemaker basic dapi walkthrough using rcc php wrapper to drive web pages...
Come back up slightly different which is great so Monday I'm flying out to see Christian we'll do the Indiana Jones action on Monday we'll look for gold coins I told them we're going to do the indiana jones thing there and in the area from pismo beach digging for gold coins on the beach and we will bring that footage back on monday to show you what we are doing cool stuff this is filemaker 19.2 .2 has hidden gold coins that clarisse hasn't told you why not they told you because they just don't live stream they don't communicate like we love claris they're great but there are limits to what humans can do and uh you need a super power like a live stream super power to be able to do these things, that's why we are going to take care of explaining where the gold coins are and how. to get to them free of charge there is no charge to be here monday tuesday coming soon intro to performance tuning we have
basically we're going to cover um i'll cover the performance tuning videos that have been updated we'll talk about the performance conversation , but we've reshot the videos very specifically in our of course most of you have our course our video it's our pro 19 filemaker 2020 course hopefully claris renumbers or does something in may they'll call it 19.3 in right now, but I suspect they're going to renumber or change the name. it's or do something wednesday thursday friday next week it's anchor buoy i'm pretty sure it's anchor buoy for at least two days we're going to cover it in great detail last time nick did it several people complained about nick he didn't.
I don't know what he was talking about, um, I covered an anchor buoy better than Nick, it's one of those rare moments where I can do better than him just because I'm more horizontally versed in the whole community and I'm going to reference some other wasteland rug as well and i'll explain it to you at a very
basiclevel i'm not going to put the french designer spin on this this is not a design thing this is a very mechanical step one step two follow the instructions and don't ramble out of the way okay conversation type so it's very basic so a lot of people want to know about it we'll cover it earlier in those days at the same time we'll do two streams at a time paid The neomorph stream will continue for those of you who paid the 4.99.
They will go to that at 11 am. I'll be running the live stream so we'll be doing two simultaneous streams so it should be pretty exciting uh that's what's coming so and if you're interested in signing up for neomorphism someone said well I don't I can be there I was one of probably one of the people here I can't be there and I'm Like, okay, but can we get the recording? I said yes if you pay it if you pay the fee if you pay the fee you can optionally appear live and you get the recordings they will clean up a bit for you and give it to you and he are like fine I'll wait for the recordings I'm like fine but it's not going to be like a sale later it's like a price and that's the way it is i think people are expecting me to give it to them for free because we give away a lot of stuff for free but uh yeah it's not going to happen this time ok the today's stream what are we going to do today jacob taylor so we're talking about the dappy data api which is a file create server mostly file create server it's on cloud two if you want to have a lot of hacking and other things work, but then you have to use python and all kinds of cool stuff to make it work, so it's not as simple as it is. file creation server, so what is it?
It's basically what used to be called custom web publishing. still use that term where you can have a php page or an xml page or something like that you can make a html call to the webserver and the webserver goes to the filemaker server and you can talk to the filemaker server talk to the filemaker server means that the server filemaker can add a record for you can find a record for you can make an ad find delete or edit ok basic crud right cr ud create create crud isn't it credit or cred crud create uh create read update or delete ok so create yeah , there you go, so secret, create, read, update or delete, and that's all the basics of databases, nothing else to do, and everything is one of those things, and that's what it does at the server level filemaker so moki was going oh i'm very excited about api apis ok this is how you turn filemaker server into an api source it's a datasource that can exhaust your api so if you look the class of books, consult our The books if you look in this chapter 9 page 144 there is a n A new section that we had to write for this edition of the book and we talk about plugins initially, then we talk about apis and I'm very specific about whether you're consuming apis with filemaker or if I'm correct about what i said huh we are talking about a font it should be bold um but consumption and then on page 150 we talk about filemaker as a source for apis which is 150 so we are talking about filemaker as a source apis in general it's just a method that usually uses a url um url protocol options curl is an http request you send the data somewhere data you send a url and it returns the text some kind of text that's what happens that's the basic level most people in filemaker use filemaker as apis consumer is consuming data for example you want the current so there are so many dollars translate ceremony into euro or sterling right ente, so say what is the conversion rate for filemaker pro to enter the online service, the recurring option says if I have a dollar that is a conversion rate for a euro and back I get a text that says that a euro it's so much blah blah, that's where Filemaker comes out and consumes the data.
This discussion today is about the FileMaker server being a source for some other service, typically a web page, but some other service can make a call and get the data, and again, the data it can create records. You can read the log by reading fine. the logs or delete to the right delete is always dangerous so it shouldn't be this cra no duh if you put the d in there you're going to be in trouble so you're at risk so great so jacob taylor tell us what you got and what you're doing now that I've framed the conversation a little bit well, well one last thing people say, I want FileMaker to receive data from the internet so it magically receives data, this is very, very, very, very even. if you don't know how to do it, you need to understand what tools do it when Filemaker Pro is running.
He is not listed on the internet with big mouse ears like Mickey Mouse. you could put some plugins on it do some hacking and make it do it once again i.e. software file creation server misuses can actually listen on the internet so if you have data that is they're sending the term is being pushed down like forced down the throat it's like here comes the food open your mouth wham let's force it you didn't ask for it comes on its own schedule the filemaker server can hear that and deal with it pro not so pro you start a script it shuts down makes a call brings it back pro doesn't listen if you need to have a receptacle waiting to listen 24 7 all day waiting for something to happen that's the file creation server right?
Well, yes, like a submitted web form. on a web form submit will be a push operation on uh filemaker on filemaker server no pro because pro pro doesn't listen pro starts a conversation at the end of initialization it can listen for 90 seconds or whatever then it times out and can set that timeout but the point is he talks then listens fine i talk alot then listens fine richard is the loudmouth true i talk too nice the filemaker server is like my wife she just sits and listens she doesn't do she doesn't say much , just listen, it's a file creation server, so you have to use the right tool for the right job, so I wanted to frame that, okay, sorry jacob, don't worry, are you ready?
What are we doing? this is jacob that's his kitchen that's his microwave on top of the fridge yeah okay yeah that's right so show us your screen what are we doing? um and let's let's go physically walk through each step um the example I have today is uh intentionally a little bit not so complex um so it's really easy to talk about everything okay this is what this does this is what this does this is what you know next step next step next step to the end so i have some things on my screen here uh the main one of course is uh actually this is the filemaker server here on the remote desktop um i just want to note uh there is a Couple of things.
Those are prerequisites, so you want to turn on the Data API if it's not already turned on on your server. One thing to note here. everyone still perfect perfect so you'll want to turn it on um one thing to note this is all a lot more difficult if you don't have an ssl cert on your server um there are ways you can basically turn off verification in your code so it doesn't check the ssl or do any of those things that is I'll say it's fine for development purposes never really do that on a client system or anything if you know you're writing it for yourself or your own company or what whatever don't you do that um you want the ssl verification to happen um that can also bite you because obviously if ssl times out then you can't do data but you need to go figure that out actually so um it's like a just it's a preliminary um to everything this the other thing i've done here so this server is the 19.2 build server uh i have to note that because the 19.2 build server doesn't come with php installed unless you cr ea it's on mac right now i think mac is the only one where it still comes built in so i had to configure it we're not going to cover that today i'm just noting it for you all you have to configure is install php if it's not running like a mac or something um you'll have to set that up so that your system is able to run this code in short I'm not going to cover the details but I just want to point out that because it doesn't work out of the box at least on the latest version of the server so if people want more info on them they can read the engineering blog i think the claris engineering blog covers we've talked about the engineering blog before yeah and they cover actually if you had a 19.1 server or one of the older ones any older version that came with php built in um they actually cover uh step by step how to get that old php and everything else over to 19.2 yeah it's a little better, so you'll want to make one search for clarisse, you would write clarisse and word engineering and then write a blog. and then you'll find that it's actually quite likely in my opinion the best documentation a company puts out and it's not even their official documentation so yeah yeah yeah this thing is a blog post right here outdated php package and file creation server removal ok and this is opening new tabs and doing all sortsthey'll recognize this from other things, they need the name of the layout, they need what you're looking for if you want to sort the records that come back, uh, there are parameters on how to do it. you're going to sort them or you might know you'll have a relationship inside a file builder that will sort them for you or something but you can, you can do post sorting, there's certain record offsets you can do. limit the number of records that come back you can look for particular ular portals in a layout if there are a bunch of things in the layout these could be scripts you trigger and then there's another one i haven't really figured out how to use this super effectively , but there is a way that you can pull in different layout data than it was historically so folks can understand how I used to do this historically so let me frame the conversation a little bit here on the day before training now and I'll lead the company and stuff i used to do this fill a ton in 2000 uh 1998 97 2000 2001 234 uh i did a ton of this coding so it normally points to a layout in your filemaker file and that lets you just that it's not a layout that they visit your other users it's a black and white layout there's no nick hunter layout there it's all just let me say this just the fields you want to access because any other fields you put ues there literally slows it down slows it down and so if you just put all the table fields in there and it has unstored calculations and summary fields and also these things it's going to process before it returns just the name and the last name that you're looking for, whatever you're looking for, so it'll create specific web designs, uh, very specific web designs, uh, that's just we put the typically we put the word web underscore in them so we know they're very yes like here so you can see here you've already marked it like if you touch this we'll have it cut you off we'll cut off parts of the body you know the parts we're going to cut off start with the word testicle okay it's not going to be pretty because if someone renames the layout or gets rid of a field we need here it breaks the web process and you don't know what's wrong you just get a random call from the client saying oh your website sucks people are very professional, did not work It works well, so I don't want to have these problems, so we put a little note here. don't touch it leave it alone and just put here what you need ok and if you do that and leave it alone in a little section don't touch it like here if you can see here it has it. in contacts actually in our internal system like you see me looking at the good finished system sometimes yeah we have a separate folder that says web based layouts don't touch or boss will go down upon you like the wrath of the gods zeus zeus will come down and shoot lightning up your ass so it's a danger it's good that's how it works and it's good that you understand it just understand if you have young people who are probably crushing the system behind your back, they need to understand that it's a high risk endeavor because filemaker normally if you rename a layout, rename a field, move it, it automatically rewires everything that breaks for that right, this is the web that's also why you don't use spaces and field name s and things like that because if you use look like prompt down here look here see there is no little space in the field names because as soon as you go to action api action php acc ion html action spaces isn't like real legit things it will be making things expose it so if nick fixes it slows down the response it will literally slow it down so someone say what if nick comes in here and us embellish and we do neomorphism and then we do this and we have something. and then we do this right then it just slows it down, it's unnecessary because the file creator, the client, the server is going to open the file, it's going to find the data and it has to process all of it before returning it to the web. server like whatever you requested it before sending it to the aps it's going to output all of that so if you have an unstored computation that you don't need it's going to do all of that yeah so um and actually to skip from one thing that Richard said that's basically is real. and useful for things like this so one thing it said there yes don't rename fields and stuff that's true because your php doesn't magically update for example but limit the number of fields in the layout it's really useful and so one of the reasons that it's really useful actually is that it's not just, oh, you know, minimizing what you're seeing, minimizing the number of concerns that you might have extracting data from these kinds of things, it also means that any fields that are not in the layout are not sent via the data api, they are simply not present in the dataset that is returned, so if you have, for example, if you are doing as if you were building a database, it means you know this table or this in at least the layout, but certainly the table is designed to be read from the web a bit, you can do some auto calculate field tricks where you minimize the amount of text that you know and other things They return only what you really need because sometimes you know you'll have a big notes field or something and you don't need all the data, you don't need to go back to the file creator, you don't need to go to php or anywhere else because you know that it's a database of contacts and you're just looking up names and stuff, there's no need to fetch notes, but if for example the notes field is in the record and in the layout you're reading the data api from, you'll get all those notes that will go back to the data and you'll be casting you know it's like you're not using that data in php somewhere you're pulling it to the ground you're casting it for no reason um worth noting that it's a big performance hit because people go oh it's so slow right it's slow because you're throwing you're literally throwing data through a pipe and then wasting it it's like you bought it it's like you went to the supermarket you bought a pile of groceries bles you put in the back of the car out of the fridge you go to the grocery store with everything refrigerated you leave them in the car and they all rot and you throw them away so why move all that data why buy all that groceries when you leave Let them rot and you just throw them away? it also comes back to this right so yeah and this is this is one thing so if that's why i say if you're going to be reading stuff from the database and you have i'm going to call it a notes field i'm thinking a big block of text because it's a great example of something.
If you don't need that data, don't send it. and so, over time, this number increases. I've never seen anyone get to the top, but if you don't need to upload three megabytes of text to every answer you know, not only is that not right, can you go back? to design very quick i just want to emphasize something because um kyle is having kind of a semi-disconnection well it's a conversation but he's a bit um so he's a problem is i have to respond to what he said kyle so organ dean says so you are so you build a layout specifically because just for lack of words I'm going to say the api will access it and the api could be using html php or whatever here so the api will access when you point to this, you can only access the fields that are in the layout, remember, it's slightly different than other things we do in filebuilder where if you don't, if you open a record, you get all the fields; in this case you are just making these fields available even if there are 500 fields in the table only the api can only access only these fields if you change a name here and don't update the code in the api it won't work no will see if you change the code in the api and it doesn't match here exactly it won't work this is this is how regular regular coding programming is unforgiving to people who are going through h life and are careless individuals ok very unforgiving , right, you put an extra comma, then the file creator, you put an extra as if you were writing a calculation, you put a comma somewhere by accident or a quote, you get an error message, it will not allow. you go ahead, you put an extra comma or quote here and everything stops working and you have no idea why, anyway, this is, uh, we're playing in the deep end of the pool where sharks live.
We talked about the little example here let's jump into the code basically um and I'll show you the address here so you can put this on discord so you can paste it there's only a few like records in this database so there's not much to search , but just to show that it works, we have a couple of jacob logs there. they uh and uh the scripts don't come up with anything That's like my three examples so I can go here search for jacob and uh here's my thing if we go back to the home page we can search actually let's do richard richard it shows up but it doesn't have his city state or zip code populated in our database so it doesn't have any of that data but if we have ronald which is our other example hey and they were sent over and over again so it's all the same data, but you can see you know each of these is a record which is record two record three record four um coming back to us through the data api so let's jump into the code real quick here, so i have a cute little debug function that i give to everyone every new php encoder um this little chunk we can stick it around what this does is um it's a switch to enable uh what i like to call full screen in um what is max out all warnings s the notices all of that in php um and then this pre function which is just I don't know why it's even Named that that was the name I chose a long time ago um and so what it does is you can pre I'm using air quotes which you can't see uh data whatever it doesn't matter what it is if it's a string or an array or whatever and this allows you to spit the data out on the page when you're doing what you know hit the refresh button look at the new bug you know in my code, please press try and fix it, hit the refresh button, look at the new one, hopefully the bug fixed in my code in the new bug that came after or something, it's really useful for that reason, these things are uh if debugged and then there's this here because when you change debug to false everything shuts down goes into sort of a production mode and there's no squawk at all php doesn't make any noise if you're having trouble in your code, uh, if you are pro enough problematic enough for the code to fail that's what happens so that's uh that's just a little preliminary thing I use that's helpful and we'll turn it on in just a second to show what that looks like, uh actual prerequisites for do this, then what is this web page?
Sorry I'm going to go to the home page so you can see there's like a little it's a menu button basically we have a little title text we have a field for our form and a lovely little search button Here it's not that complicated a page and as you can see it's basically not styled either I didn't I figure it was very much needed for this demo so we'll go through the html real quick about the code you'll need so in modern versions of php you should have a used line for the libraries you need. I'm going to use um which is what it sounds like and that's what it is so if you notice uh you know my code will use the rc consulting data api library ok then you have to say you have to tell php I'm going to use that and then there's this cool thing here and what's called autoloader r there's one it's a standard scripting tool for php called composer what it does is it helps you manage these collections of libraries that you might want to trust this it's often other people's open source maybe it's on github or somewhere else but not to cover it too deeply there's a notation you can use where you bring up other people's code now if for example you need uh we'll say it's creating a big old web app that's going to have 20, it's going to bring in 25 libraries or something, ok, but this simple search page that we're demonstrating here isn't going to use all 25 libraries, it's just going to use the data API of our cc, that's why you have Note that we're only going to use that one because if you have 25 other libraries here with this thing that uses Composer to build it.
It'll just load the rc consulting data api library for that page, instead of dragging all 25 things, so that will be a speed improvement among many other things it also means you're not logging all these things you don't have to know how to take up everything the code in php memory if memory limits are a problem that kind of thing you just get free optimization no speed but that's all it does we didn't do anything here we just said hey php let's use the rcc data api and then this is going to be, we're going to require this code, we're going to say we need one of these um that's what there's a requirement and there's a one time requirement um one time requirement means I only need one of they do see meImportant, great job up front protecting this quarterback. to give yourself a chance and that's all you can ask for to try to come back 10. 9 25 to go here in the fourth amendola's short movement from the left brady takes the shot they're going to step stands on the shots to the left ramadan reaches up and does a high throw and falls into the boy with one eye slightly behind him again makes the ground hit you
If you have any copyright issue, please Contact