Aller au contenu

Blogs

 

Simple Bash Scripts for Lazy People | Part 1: Git

While the attribution may be hazy, the notion of laziness being an attribute of a good programmer is popular. I don’t know how good of a programmer I am, but I am really lazy. So lazy that if I find myself doing something over and over, I write a script to do it for me […]
Afficher la totalité du billet

vincenzo

vincenzo

 

Simple Bash Scripts for Lazy People | Part 4: Cadaver Dissection

This is part 4 of a five-part series: Part One has examples for common daily tasks in Git. Part Two, similar examples for Rails. Part Three, miscellaneous cases. Part Four dissects an example of a failed attempt at a useful script. Part Five concludes with a brief discussion of when to use Bash as opposed […]
Afficher la totalité du billet

vincenzo

vincenzo

 

Simple Bash Scripts for Lazy People | Part 5: When to Choose Bash

This is part 5 of a five-part series: Part One has examples for common daily tasks in Git. Part Two, similar examples for Rails. Part Three, miscellaneous cases. Part Four dissects an example of a failed attempt at a useful script. Part Five concludes with a brief discussion of when to use Bash as opposed […]
Afficher la totalité du billet

vincenzo

vincenzo

 

Simple Bash Scripts for Lazy People | Part 2: Rails

This is part 2 of a five-part series: Part One has examples for common daily tasks in Git. Part Two, similar examples for Rails. Part Three, miscellaneous cases. Part Four dissects an example of a failed attempt at a useful script. Part Five concludes with a brief discussion of when to use Bash as opposed […]
Afficher la totalité du billet

vincenzo

vincenzo

 

Simple Bash Scripts for Lazy People | Part 3: Other Examples

This is part 3 of a five-part series: Part One has examples for common daily tasks in Git. Part Two, similar examples for Rails. Part Three, miscellaneous cases. Part Four dissects an example of a failed attempt at a useful script. Part Five concludes with a brief discussion of when to use Bash as opposed […]
Afficher la totalité du billet

vincenzo

vincenzo

 

QR 86 – FileMaker et la mise en page de rapports

FileMaker est comme vous le savez, un logiciel puissant, qui parvient à réaliser des prouesses. Nous nous en faisons l’écho régulièrement sur ce blog ou dans nos fiches Astuces… Aujourd’hui, la question de Cristian vient peut-être souligner l’une de ses limites. Car gérer des données, ce n’est pas le même « métier » que faire de la […]
Afficher la totalité du billet

MagalieJ

MagalieJ

 

Custom ordered portals

Every software user loves convenience. Heck, every human being loves convenience. So, why not provide it within every aspect of your user interface? The problem, however, which you may run across is figuring certain features out. FileMaker can be a very simple program or something quite complex if you're trying to do something custom like providing users with the ability to custom order their related records. The most basic sequential ordering of data comes in the form of simply providing a number field called something like "order", "sequence" or the more mathematically inclined "delta". Once you have the field, you can allow the user to manually change the values. But, that becomes a real pain when you try to add a record between the numbers 1 and 2. You now have a user entering 1.5 or 1.3 and 1.7 in order to get values to sort properly. Then, having to manually reserialize all the original values is just an unnecessary pain. Well, the best solution to this problem is to simply use the automation provided by FileMaker's powerful scripting engine. With a few scripts, a value list, and a bit of FileMaker know-how, we can provide a very quick-and-easy method of allowing users to custom order portal rows. Click the title or link to this article to view the video.
Afficher la totalité du billet

FileMaker Magazine

FileMaker Magazine

 

Dans le contexte de la RGPD, nettoyer ses données FileMaker (1)

Ce sont – souvent – les événements de la vie qui orientent nos choix… Et cela concerne bien entendu aussi le domaine informatique ! Comme vous le savez très certainement, car voilà plusieurs semaines que le sujet est sur le tapis, la nouvelle réglementation européenne sur la protection des données personnelles (RGPD) est entrée en vigueur […]
Afficher la totalité du billet

MagalieJ

MagalieJ

 

Addendum : un outil d’aide au développement FileMaker

La nouvelle version Addendum 5.0 est disponible, suite au lancement de FileMaker 17. Qu’est-ce qu’Addendum ? Addendum est un outil d’aide pour le développement sur FileMaker 17. Cette application mobile pour iOS répertorie en effet les fonctions, actions et déclencheurs de script, codes erreurs et le glossaire de FileMaker. L’application est développée par fm:DATA, membre de FileMaker Business Alliance. Développeur Certifié FileMaker, fm:DATA offre des services de conseil et de développement sur toute la plateforme FileMaker. Addendum 5.0 est-elle seulement disponible en français ? Non, Addendum est une application multilingue et disponible en 11 langues ! De plus, quelque soit la langue dans laquelle vous utilisez l’application, vous pouvez toutefois saisir vos critères de recherche en anglais. Il vous est même également possible de traduire votre sélection dans une des langues disponibles directement dans l’application. Addendum 5.0 est-elle gratuite ? Oui ! L’application est gratuite et disponible au téléchargement sur l’App Store. Pour plus d’informations, RDV sur le site officiel de l’application. Pour en savoir plus sur notre partenaire fm:DATA, RDV ici. Addendum : un outil d’aide au développement FileMaker was originally published in FileMaker Fr on Medium, where people are continuing the conversation by highlighting and responding to this story.
Afficher la totalité du billet
 

FileMaker 17 : fenêtre de configuration des boutons

Pour une modification facilitée des paramètres de scripts Avec chaque nouvelle version de FileMaker, le temps passé par un développeur à cliquer sur la souris et à déplacer le curseur diminue toujours un peu plus. Avec FileMaker Pro Advanced 17, une nouvelle fonctionnalité simple, qui contribue de manière significative à réduire l’utilisation de la souris, est le champ Paramètre de Script Facultatif dans la fenêtre Configuration de bouton. Le champ Paramètre de Script Facultatif dans la Configuration de bouton est visible après avoir choisi le script. Lorsque vous sélectionnez Exécuter un script dans la liste déroulante Action, vous voyez la fenêtre Spécifier le script, avec le champ traditionnel Paramètre de script facultatif, ainsi que le bouton Modifier pour travailler sur des calculs plus longs ou des paramètres JSON. Vous pouvez voir le nouveau champ Paramètre de script après avoir cliqué sur OK dans la boîte de dialogue Spécifier un script. Avoir le Paramètre de Script disponible dès la configuration du bouton est beaucoup plus pratique pour changer ou ajouter un paramètre si besoin. Dans FileMaker 16 et autres versions antérieures, pour modifier ou ajouter un paramètre dans la fenêtre de Configuration du bouton, vous deviez cliquer sur le bouton à côté du nom du script, puis cliquer sur le bouton Modifier dans la fenêtre résultante. Parce que cette fenêtre est une boîte de dialogue, le bouton Modifier peut parfois être à une distance gênante de votre curseur. Maintenant, il vous suffit de cliquer sur le champ de Paramètre de script dans la fenêtre de configuration du bouton et vous êtes à l’éditeur Specify Calculation. Si vous aimez la vieille méthode en deux clics, la bonne nouvelle est que vous pouvez encore faire les choses de cette façon-ci. Cette article est une version traduite de l’article d’origine publié par LuminFire, membre Platinum de FileMaker Business Alliance. 📍 Vous êtes interressé-e par le développement FileMaker ? Découvrez nos ressources dédiées pour les développeurs novices ou plus expérimentés. FileMaker 17 : fenêtre de configuration des boutons was originally published in FileMaker Fr on Medium, where people are continuing the conversation by highlighting and responding to this story.
Afficher la totalité du billet
 

Extending FileMaker PDF Functionality with DynaPDF Demo

Did you know you can do more with pdfs in your FileMaker solution with DynaPDF? Download our complimentary resource to learn about capabilities with this product. This file contains a simple table containing pictures and images of different types of fruit. It helps you create a listing of each fruit with clickable links to different pages throughout the PDF, demonstrating the capabilities of DynaPDF within your FileMaker solution. Read the blog post…
Complete the form to receive the demo: Trouble with this form? Click here. The post Extending FileMaker PDF Functionality with DynaPDF Demo appeared first on Soliant Consulting.
Voir le billet d'origine
 

How to Use FileMaker 17 to Connect the Data API and Your WordPress Website

Connecting Your WordPress Website and FileMaker Solution In this post, we demonstrate how you can submit a form built with a freely available WordPress plugin, Ninja Forms. This makes building web forms easy while staying compliant with a WordPress theme. This process also supports responsiveness of your WordPress deployment. You do not need access to the backend MySQL database, which is not always easy or available. This makes it very portable and convenient to add as a WordPress administrator. You only need to add a custom action to the Theme Functions ("functions.php") file in WordPress and specify that custom action in your Ninja Forms configuration. Pre-FileMaker Strategy: Custom Web Publishing Previously in FileMaker 16 and prior, you could send data to a CWP (custom web publishing) script that could include the FM API for PHP and use that to insert to your database. This required a web server running PHP, possibly on the same machine where FileMaker Server was running. Simplified Process with the FileMaker Data API That changes in FileMaker 17. Now, you can communicate directly with the newly available Data API to insert a new record in your database with no other pieces needed or external APIs to load. Both methods use a WordPress function, WP_Http(), to make the external requests and submit all form data entered by end users. In WordPress, go to Appearance->Editor, then select the Theme Functions file and insert the following code, with adjustments made to the variables at the top of the function. add_action( 'fm_WordPress_action', 'fm_data_api_form' ); function fm_data_api_form( $form_data ){ // set variables $myServer = 'https://your_server_name/'; // the url of your server $myUser = 'Username'; // your username $myPass = 'password'; // your password $myFile = 'Your_File'; // your file name $myLayout = 'Your_Layout'; // your layout name // authenticate and get token $myEndpoint = 'fmi/data/v1/databases/' . $myFile . '/sessions'; $post_url = $myServer . $myEndpoint; $headers = array('Authorization' => 'Basic '.base64_encode("$myUser:$myPass") , 'Content-Type' => 'application/json'); $request = new WP_Http(); $response = $request->request($post_url, array( 'method' => 'POST', 'body' => $myJSON, 'headers' => $headers )); if($response){ //inspect response $responseObj = json_decode($response['body'], false); $responseCode = $responseObj->messages[0]->code; if($responseCode == '0'){ $responseToken = $responseObj->response->token; // format json from form data $form_array = array('fieldData'=>array()); foreach( $form_data['fields'] as $field ) { // get key/value pairs into an array by themselves if($field['key'] != 'submit_button'){ $form_array['fieldData'][$field['key']] = $field['value']; } } $myJSON_Data = json_encode($form_array); // insert record $myEndpoint = 'fmi/data/v1/databases/' . $myFile . '/layouts/' . $myLayout . '/records'; $post_url = $myServer . $myEndpoint; $headers = array('Authorization' => 'Bearer ' . $responseToken , 'Content-Type' => 'application/json'); $request = new WP_Http(); $response = $request->post( $post_url, array( 'method' => 'POST', 'body' => $myJSON_Data, 'headers' => $headers ) ); if($response){ // ok } else { // insert err } // log out $myEndpoint = 'fmi/data/v1/databases/' . $myFile . '/sessions/' . $responseToken; $post_url = $myServer . $myEndpoint; $headers = array('Content-Length' => '0'); $request = new WP_Http(); $response = $request->post( $post_url, array( 'method' => 'DELETE', 'headers' => $headers ) ); } else { // authentication err } } } Enabling Ninja Forms To use with Ninja Forms, we configure the "Emails & Actions" configuration (see Figure 1) for the form we are working on, enable the "Web Hook," (see Figure 2) and give it a Name and Hook Tag. The Hook Tag here is important, and it needs to match the action name given in the custom action. In the code above, it is the first parameter of the add_action function, where we name it "fm_WordPress_action". Figure 1- Use "Emails & Actions" to configure your form Figure 2- Use the slider to enable the "Web Hook" action. If we break down the above code, we see the performance of two steps. The first is to authenticate to the database and get a token back. Once we have successfully authenticated and have a token, we use that in the header of our HTTP request to submit JSON to the Data API that completes our record creation.
There are RESTful endpoints used to perform both authenticating and record creation. You can find these in the Data API documentation. First, we send credentials using a HTTP header and receive a token upon successfully authenticating to the database. Once we have a token, we do a bit of cleanup work to get our data out of the form, where we reference the "Field Key" from the form builder, and correctly format the JSON we will submit as the body of our request to create a new record. We define the Field Key for each field in the form (see Figure 3). Figure 3 - Define the Field Key for each field. Of course, all field keys need to match with the field names in your database. Also, this assumes that you have correctly set up security in your FileMaker file, and have enabled the "fmrest" privilege set for the account used to perform this action (see Figure 4). Figure 4 - Set up security in your FileMaker file to enable the "fmrest" privilege set. You will see the File and Layout specified in the endpoint we reference, so we only then need to include the JSON containing our record data, in addition to passing our authentication token as a header. All this is simple enough, once you have achieved a cursory understanding of REST architecture and how to work with it. Licensing and Costs FileMaker Server includes an amount of data transfer at no additional cost. The good news is that the amount already provided -- 2GB of data, per user each month -- should be more than enough for most every use case. That does not include container data and only counts toward outbound data transfer. Data is also shared for all users. For example, if you have a FileMaker Server with five licensed users, that would be 10 GB/month, or 120 GB for the year. That far exceeds the amount that most solutions see in data transfer even with FileMaker Pro pushing user interface and containers. If you go beyond this very high threshold, you would likely want to pay additionally for the support to handle that kind of traffic. Considering the cost of FileMaker Server effectively includes this licensing, I would not hesitate to recommend using the Data API in any new development. Building on Your FileMaker-WordPress Integration This is just an example showing a basic integration of a WordPress form used to create a record in your database. You could build on this example to add more robust error handling or additional functionality. Integrating with FileMaker is easier than ever! Hopefully this article gives you some insight into how you can extend your FileMaker applications in ways previously not conceived. If you have any questions or need additional help integrating your FileMaker solution with your website, please contact my team. We’d love to see if we’re a good fit for your next project.
References FileMaker Data API Guide
http://fmhelp.filemaker.com/docs/17/en/dataapi/ FileMaker Licensing FAQ
http://www.filemaker.com/purchase/store/faq-teams.html Ninja Forms
https://ninjaforms.com Your Guide to Using the FileMaker Data API to Enhance Your Application
https://www.soliantconsulting.com/blog/filemaker-data-api The post How to Use FileMaker 17 to Connect the Data API and Your WordPress Website appeared first on Soliant Consulting.
Voir le billet d'origine
 

dotfmp Developer Challenge

At recent dotfmp conference in Berlin (did I already mention this is the best FileMaker conference I know?), a developer challenge was orgnised. The challenge was to find the fastest way to download data from a FileMaker hosted database to a FileMaker Pro Client over the network. The table had 50K records (10 fields) of […] Cet article dotfmp Developer Challenge est apparu en premier sur 1-more-thing.
>>> Lire la suite… <<<

fabriceN

fabriceN

 

Extending FileMaker PDF functionality with DynaPDF

Generating PDFs in FileMaker FileMaker Pro has had the ability to generate PDF documents since version 8, providing basic functionality that has remained largely unchanged since its introduction. Using FileMaker Pro’s plugin architecture, we can extend this functionality to provide the following enhancements: Search PDF document text Append multiple PDF documents in non-sequential order Add a watermark to a PDF document Password protect a PDF document Delete pages from a PDF document Add clickable “Page Links” to move to different pages throughout a PDF document Compress a PDF file to prepare them for transmission over the internet An intermediate to advanced FileMaker Pro developer can leverage these features to create even more dynamic PDF documents inside FileMaker Pro. Setup and Installation The MBS FileMaker Plugin by MonkeyBread Software has one of the most feature-packed plugins in the FileMaker community with over 5,000 functions to date and developer Christian Schmitz continues to regularly add new features. As a side note, one of my favorite features is a more colorful script syntax coloring but there are many more that can be useful in a variety of situations. Using the MBS plugin, we can extend its functionality even further using the DynaPDF library. DynaPDF is a popular library for working with PDFs that the MBS plugin allows us to access using functions. For DynaPDF alone, you can use 484 custom functions inside FileMaker Pro. To setup this up, first download the MBS plugin. Included in that download is the DynaPDF library in both macOS and Windows formats. Read the installation documentation to know where to install the DynaPDF library on your computer. It is also worth noting DynaPDF and MBS FileMaker Plugin can also run as a server-side plugin, allowing you to leverage the power of server processing and not require an individual license for DynaPDF on every end user computer. Plugin Functions & Scripting All DynaPDF functions use a dot syntax starting with “DynaPDF.” DynaPDF requires some sequential steps to manipulate a PDF document. Using the “Set Variable” step we can increment the DynaPDF library and create a memory space inside FileMaker Pro. Here is an overview of this process using FileMaker script steps: #Initialize new PDF instance Set Variable [$pdf; Value:MBS ( "DynaPDF.New" )] #Convert path to DynaPDF native path Set Variable [$targetPath; Value:MBS( "Path.FileMakerPathToNativePath"; $fruitPath )] #Open Existing PDF into memory Set Variable [$x; Value:MBS ( "DynaPDF.OpenPDFFromFile" ; $pdf ; $targetPath )] After we call these initialize functions, we can perform any number of DynaPDF functions to this PDF we have brought into memory. Check out a complete listing of DynaPDF functions. To complete the PDF manipulation process and save our changes to the PDF document we perform the following steps: #Denote where to save changes to PDF file, could be same path or different path Set Variable [$x; Value:MBS ( "DynaPDF.OpenOutputFile" ; $pdf ; $targetPath )] #Save will commit those changes to that path Set Variable [$x; Value:MBS ( "DynaPDF.Save" ; $pdf )] #Release clears the memory space, allowing a new instance of "DynaPDF.new" to be created. Set Variable [$x; Value:MBS ( "DynaPDF.Release" ; $pdf )] It is important to note that you can redirect the output of your changes to a different file path than the one you started with in the initialization functions earlier. Download Our Demo File Get the demo file You can use our complimentary demo file to demonstrate a few capabilities of DynaPDF. This file contains a simple table containing pictures and images of different types of fruit. The goal is to create a listing of each fruit with clickable links to different pages throughout the PDF. First, DynaPDF allows us to create two PDFs and then combine them in the reverse order. We can parse the text of each page of the PDF to determine the page number of each fruit in the document. After combining the PDFs, we can add “Page Links” into specific locations on each page, allowing us to hyperlink within our combined PDF document. We use this in two ways --  first, by having a table of contents page that allows us to jump to a specific fruit on a page and second, by having a button on each page that allows us to return to the table of contents page. This minimizes the need to scroll through each page of the PDF, creating a more fluid user experience. Enhancing FileMaker Pro with PDF Document Manipulation With some script steps and external plugin functions, we see how powerful we can make FileMaker Pro by manipulating PDF documents. We can link around a PDF document dynamically, combine multiple PDF documents in different order and parse text from specific pages in a PDF, and much more. PDF functionality has remained the same for almost 15 years in FileMaker Pro. By using FileMaker Pro’s plugin architecture we can extend that functionality to build even more powerful custom applications. What kind of apps could you build with this powerful set of PDF tools? Next Steps for Your FileMaker Solution If you have any questions about this functionality or seek a development partner in using it to take your FileMaker solution to the next step, please contact our team. We’re happy to provide additional insights and determine if we’re a good fit for your next project. References MBS FileMaker Plugin
http://www.monkeybreadsoftware.de/filemaker/ DynaPDF from MBS
https://www.mbsplugins.eu/component_DynaPDF.shtml FileMaker Hacks Blog Post
https://filemakerhacks.com/2017/02/21/pdf-with-embedded-links/ The post Extending FileMaker PDF functionality with DynaPDF appeared first on Soliant Consulting.
Voir le billet d'origine
 

Exporting Field Data Properly

There's a lot of pretty boring stuff you need to know about when programming in FileMaker - or any other coding environment for that matter. Knowing the fundamentals of how to move information around is a critical skill. If the file format isn't correct or the receiving end of an online service just won't process your data, then it can certainly be a confusing dilemma which may take hours of learning in order to understand exactly what's going wrong. Of course, if you can simply watch a video like this, and gain an instant understanding of what it takes to move text in and out of a FileMaker field, then why not take advantage? In this video and technique file you'll find two super helpful scripts which can be used to pretty much move any text into and out of a field. It doesn't matter whether the text is JSON, XML, PHP, HTML or just plain simple text. Once you know how file encodings and line endings work you can move information around like a professional! Click the title or link to this article to view the video.
Afficher la totalité du billet
 

Nouveautés FileMaker 17 : Le gestionnaire d’apps (2)

Le deuxième niveau de nouveauté (le premier était le changement de nom des menus, voir notre article de la semaine dernière) concernant la gestion de l’ouverture de nos fichiers FileMaker est dans l’aspect proposé des fenêtres correspondant à ces divers menus. Vous pouvez le constater par vous-même, le menu Nouvelle solution, devenu Créer, a changé […]
Afficher la totalité du billet

MagalieJ

MagalieJ

 

Truc n°86 – Un lien hypertexte en passant par FileMaker ?

Des liens hypertextes dans FileMaker ? Il y a quelque chose dont je rêve dans FileMaker… C’est de pouvoir utiliser ou copier-coller des liens hypertextes dans du texte de manière aussi simple et intuitive qu’on le fait dans un traitement de texte… Vous connaissez le processus dans FileMaker : il faut sélectionner un objet complet (une […]
Afficher la totalité du billet

MagalieJ

MagalieJ

 

Why Your Project Proposal for Your FileMaker Solution Matters

It seems obvious that the project proposal for your FileMaker solution is extremely important.  However, most clients think that it’s only important from a cost value. The truth is your project proposal does so much more than that. Your project proposal is the foundation for the entire execution of the project. So what types [...] The post Why Your Project Proposal for Your FileMaker Solution Matters appeared first on The Scarpetta Group, Inc..
Afficher la totalité du billet
 

Comment utiliser les icônes Material Design dans FileMaker ?

Cette article est une version traduite de l’article d’origine publié par The Support Group, membre Platinum de FileMaker Business Alliance. Je suis toujours étonné de voir à quel point nous nous adaptons et réagissons facilement aux visuels. Non seulement la fonctionnalité est importante pour le développement de logiciels, mais le design est également très important. Puisque le temps est une ressource limitée, l’ergonomie et l’intuitivité sont des facteurs clés pour encourager les utilisateurs à adopter une nouvelle application. En général, les éléments visuels déterminent la rapidité avec laquelle les utilisateurs peuvent s’approprier une nouvelle application. Le design comprend de multiples et diverses aspects — la couleur, la mise en page, les polices, les tailles, etc. Il convient donc d’être stratégique avec les éléments de design, y compris les micro-images que nous appelons icônes. Ces symboles, en apparence petits, ont en fait un grand impact sur la navigabilité pour l’utilisateur et sa compréhension d’une application. Qui d’autre que Google a créé un guide de style pour toutes ses applications et l’a partagé sur les interwebs pour que tout le monde puisse l’utiliser. Material Design est essentiellement un langage de design que Google a créé pour unifier les interfaces et les expériences digitales. Ces derniers offrent de nombreuses bonnes idées de conception UI / UX dans ce document et un tas de ressources gratuites. Qui n’aime pas les trucs gratuits? Une de ces choses gratuites est un ensemble de belles icônes. Vous pouvez les consulter ici: https://material.io/icons/. Laissez-moi vous montrer comment utiliser ces icônes dans FileMaker. Sur le site Material Design, vous pouvez télécharger l’icône dans différents formats. Le meilleur format pour FileMaker est, bien sûr, SVG. Un de mes collègues, à travers des recherches, des essais et quelques erreurs a trouvé le meilleur moyen d’importer ces icônes dans FileMaker Pro. Étape 1: Sélectionnez l’icône et téléchargez-la en tant que SVG. Étape 2: Ouvrez ce fichier dans votre éditeur de texte local convivial. Lorsque vous l’ouvrez, cela devrait ressembler à ceci: Étape 3: Supprimer la ligne contenant fill = “none”. Cette étape est un peu difficile car le texte peut se trouver à différents endroits en fonction du fichier. Mais il faut toujours supprimer la ligne qui contient le texte fill = “none”. Assurez-vous de supprimer toute la ligne. Après l’avoir supprimée, le fichier devrait ressembler à ceci: Si vous vous demandez pourquoi vous devez supprimer la ligne qui contient le texte fill = “none”, laissez-moi vous expliquer. Contrairement à certaines applications, FileMaker ne prend en charge qu’une seule icône de couleur, les objets de l’icône doivent donc être de la même couleur. La ligne que vous supprimez décrit un carré de la même taille que l’icône (24x24). Si nous laissons cette ligne en place, elle dessine un carré de 24x24 couvrant l’icône, ce qui donne une icône carrée de 24x24 dans la couleur que vous choisissez … pas très utile. Une autre option serait de changer la taille du carré donc au lieu de “0h24v24H0z” (24x24) ce serait “0h0v0H0z” (0x0), et il disparaitrait alors. Étape 4: Importation dans FileMaker ! Créez un bouton, puis accédez aux options d’édition d’icône. Cliquez sur le bouton plus (+) pour importer le fichier que vous venez d’éditer. Sélectionnez le fichier et vous avez terminé! Vous devriez maintenant avoir cette nouvelle icône de l’omniscient Google dans votre solution FileMaker. Vous pouvez regarder une démo ici (en anglais). Bonne chance! Et merci tout particulièrement à Matt Stanford de The Support Group pour avoir découvert cela en premier lieu. Faites-nous savoir si vous rencontrez des difficultés ou si avez des questions. Trouver plus de conseils et astuces sur FileMaker Cet article a été rédigé par Eric Sterbenk et publié à l’origine sur le blog blog.supportgroup.com. Comment utiliser les icônes Material Design dans FileMaker ? was originally published in FileMaker Fr on Medium, where people are continuing the conversation by highlighting and responding to this story.
Afficher la totalité du billet
 

JSONPath in FileMaker Demo

Leveraging JSON to pull additional information into FileMaker introduces new opportunities for integration with web services and RESTful APIs. The functionality allows you to strengthen your FileMaker solution by querying specific JSON data elements. Learn more about how this functionality can empower your organization by downloading our complimentary demo file on setting up your JSON path. Read the blog post… Complete the form to receive the file: Trouble with this form? Click here.
The post JSONPath in FileMaker Demo appeared first on Soliant Consulting.
Voir le billet d'origine
 

JSONPath in FileMaker via the Web Viewer

Getting information from JSON opens up FileMaker for more integration with web services and RESTful APIs. With the Data API (beta in 16, v1 in 17) and Admin API (FileMaker Server 17), JSON will likely continue to become more important and more integrated with FileMaker. Querying JSON Data Elements The JSONGetElement function lets us query specific JSON data elements, using either an object name, an array index, or a path. The key is there that these must be known values. We need to either know something about the JSON structure if we want specific elements. We cannot query or search JSON based on certain criteria. Alternatively, we could get everything from the JSON object into a field or variable, and then apply some rules after the fact. Maybe we want to compare information or look for elements that fit certain requirements, such as a price above or below certain thresholds. Maybe we want to look for arrays that are missing certain elements, such as ISBN numbers in an array with book information. In XML there’s a syntax called XPath that uses expressions to find information in nodes or node-sets. There’s a similar concept that allows us to extend JSON, taking advantage of a JavaScript library called JSONPath, and FileMaker’s own Web Viewer to act as the engine for the JavaScript library. This lets us feed in JSON and a JSONPath expression into a Web Viewer, and return the result via the fmpurl protocol. FileMaker and Web Viewer Integrations Web Viewer and JavaScript integration is nothing new. A Google search for FileMaker and JavaScript integration will likely bring up many examples of such integration. Some examples include FileMaker reaching out to external APIs. Other examples use what’s called a “data uri” to render web pages directly in your web viewer. Using a “data uri” you can include CSS and JavaScript in your HTML code. Setting Up Your JSON Path The included demo file has a field for our jsonpath.js library. This is an open source file and our only dependency. When implementing this in a real solution, you’d likely place this in a resource table and only call it as needed. Next, we have a field for our JSON. This can be an object or array. Your own process may store the JSON in a variable, but the demo file uses a field so that we can see the source values as we’re testing our JSONPath expressions. Additionally, we have an “input” field, which is the JSONPath query. Instead of JSONGetURL, JSONPath uses expressions in a text format to search the JSON for matching results. Then, we have a result field so we can see the result of our JSONPath query for certain values from the JSON using the jsonpath.js library. Both the input and result fields also could be turned into variables. Finally, we have an empty Web Viewer object, with a name of “WebViewer” so we can point to the object as needed. Scripting Your JSON Path There are two short scripts, “JSONPathInput” and “JSONPathWrite.” The first script, “JSONPathInput,” builds HTML and sets this HTML into the Web Viewer. As mentioned above, we can use “fmpurl” inside HTML to call FileMaker scripts. The last action in our “JSONPathInput” script does just this, calling the “JSONPathWrite” with a script parameter. That script parameter is the result of the JSONPath query, and all the script does is set our Result field with this value. The process is simple enough, but the complexity and power lie in the HTML that we create. HTML The HTML inside the script takes up only a few lines of code. (Note: The \ characters are there to escape double quotes inside the text.) Substitute ( "data:text/html, <!DOCTYPE html> <html lang=\"en\"> <head> <script type=\"text/javascript\"> **JS_FUNCTION** </script> <script type=\"text/javascript\"> var json = **JSON**; var p = jsonPath(json, \"**INPUT**\" ); var r = JSON.stringify(p); var url = \"fmp://$/" & Get ( FileName ) & "?script=JSONPathWrite&param=\" + r ; window.location = url ; </script> </head> </html>" ; [ "**JS_FUNCTION**" ; zResources::JSONPath ] ; [ "**JSON**" ; zResources::JSON ] ; [ "**INPUT**" ; zResources::Input ] ) Let’s break this apart into smaller chunks. First, the HTML is wrapped inside a FileMaker substitute function. Skipping briefly to the last lines of code, we see three substitutions. Each bit of text bracketed by the double asterisks gets switched out with values from our fields. These three values, such as **INPUT**, appears in the HTML code as placeholders. We’ll tackle each piece separately. Our text starts with “data:text/html,” which means we’re constructing a web page. Next, we have some HTML specific tags at the beginning and end: <!DOCTYPE html> <html lang=\"en\"> <head> . . . </head> </html> Inside this HTML we have two JavaScript functions. The first function, represented by our **JS_FUNCTION** placeholder, represents the jsonpath.js library. This brings the library into our web page. The second function is where we write out how to apply the jsonpath.js library against our JSON and our JSONPath expression. <script type=\"text/javascript\"> var json = **JSON**; var p = jsonPath(json, \"**INPUT**\" ); var r = JSON.stringify(p); var url = \"fmp://$/" & Get ( FileName ) & "?script=JSONPathWrite&param=\" + r ; window.location = url ; </script> We declare our JSON value as a variable inside JavaScript. Then we declare another variable with the result of sending our **INPUT** or query from the field into the JSONPath function. Ordinarily, this might be enough, but sometimes JSONPath returns objects or arrays, and these might not display properly in certain browsers. Instead, you might see a value like “Object object,” so we use the built-in “JSON.stringify” function to convert objects into strings. Finally, we set a variable to the fmpurl address of our “JSONPathWrite” script, with the stringified variable as the script parameter, and then feed this url into the Web Viewer. How does JSONPath work? Let’s assume we have some JSON: { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 }, { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99 }, { "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99 } ], "bicycle": { "color": "red", "price": 19.95 } } } With JSONGetElement, to pull out the ISBN we’d need to loop through the “book” array and extract the value using something like: JSONGetElement ( JSON ; "store.book[2]isbn" ) The [2] represents the 3rd index in the book array. The first two indexes contain no value for ISBN, but we’d need to loop through all of them to pull out what we need. With JSONPath, all queries begin with “$” followed by a path with optional operators. The “$” represents the root object or element. Dot and bracket notation is used in ways similar to the JSONGetElement function. The power of JSONPath comes in the ability to traverse JSON and slice out elements, with the logic built into the JSONPath expression. Say you need to know which elements in the above JSON have an ISBN value. You can get the array values with this query. $..book[?(@.isbn)] If you want to find titles of books that don’t have an ISBN, then you flip this around and append the title key: $..book[?(!@.isbn)].title To find books where the price is greater than some value, you can use comparison operators. $..book[?(@.price &gt; 15)] This “stringify” action in our JavaScript function will wrap your result inside a JavaScript array, so some additional manipulation is required. If your result contains a single value, even if this is object, you can use JSONGetElement ( Result ; “[0]” ) to strip off the “[ ]” brackets. For arrays that contain multiple values, you can use JSONListKeys to determine how many values there are in your array and process these with the native JSON functions. This query returns one book object where the book costs more than 15: $..book[?(@.price > 15)] [{"category":"fiction","author":"J.R.R.Tolkien","title":"The Lord of the Rings","isbn":"0-395-19395-8","price":22.99}] In the above example, to get the title, use JSONGetElement ( Result ; “[0]title” ) and this will return “The Lord of the Rings.” For a more complete review of all options and operators available in this JSONPath Javascript library, refer to this article on JSONPath. Get the Demo file Download the JSONPath demo Why Use JSONPath? There is some overlap with JSONPath and JSONGetElement. $.store is the same as JSONGetElement( JSON; “” ) and returns our entire JSON. FileMaker reorders JSON based on the keys, so they might look different, but it’s the same content. JSONPath allows us to extend our applications that use JSON to both analyze and extract information, almost like searching the content, without first pulling apart as we’d need to do with JSONGetElement and additional scripting. Caveats with JSONPath There are a couple of considerations with fmpurl. Security settings will need to be updated to allow the “fmpurlscript” extended privilege set for any accounts that use this process. If you have multiple versions of FileMaker open, running the script with the “wrong” version may fail. If the fmpurl is bound to FileMaker 16, and you try to use it in 17, you might get an error. Leveraging New Features in FileMaker 17 If you have any questions about how to benefit from JSONPath and other new features in FileMaker 17, please contact our team. We’re happy to help your team determine the best way to leverage new functionality for your FileMaker solution. The post JSONPath in FileMaker via the Web Viewer appeared first on Soliant Consulting.
Voir le billet d'origine
 

FileMaker Server 17 and the Crucial ‘stats.log’

stats.log on FileMaker Server There is no log file more important on your FileMaker Server then the ‘stats.log’. It delivers invaluable information on how your deployment is behaving across the four traditional bottlenecks of any server: Is the processing power sufficient? Can the disk speed handle the volume? Is there enough memory available? Does the network card give me enough bandwidth? The information in that log will help you troubleshoot performance bottlenecks in your solution. The stats.log also will help you plan and extrapolate whether the current server can handle any new load you have in mind. It will inform you if it is safe to use more PSoS or more server-side schedules or add a few WebDirect users. Without this log, you are, in effect, flying blind. stats.log in FileMaker Server 16 In FileMaker Server 16, the toggle to enable this log was in the Admin Console as shown in Figure 1: Figure 1 - Toggle for stats.log in FileMaker Server 16 Admin Console (click to enlarge) The statistics themselves were visible in the Console too as shown in Figure 2: Figure 2 - Statistics shown in FileMaker Server 16 Admin Console (click to image to enlarge) That is not so anymore in the new FileMaker Server 17 Admin Console. stats.log in FileMaker Server 17 In the FileMaker Server 17 Admin Console, you can only toggle the top call stats log. To view any of the logs, you must download them (see Figure 3): Figure 3 - Download log files in FileMaker Server 17 Admin Console (click image to enlarge) Finding the stats.log in FileMaker 17 As per my previous blog post on missing features in FileMaker 17 illustrates, you may thiink the stats.log is no longer available in FileMaker Server 17. Rest assured: it is still there. However, it is also still turned off by default. (I really wish it wasn’t.) Because we do not get visual reminders of of this in the new Admin Console, you may easily forget about it. Turning on the stats.log in FileMaker 17 The very first thing I do when I install a new FileMaker Server or log into one already running is turn on the stats.log. I do not like flying blind… In FileMaker Server 17, you can only do so from the command line on the server itself – or through a secure tunnel to the command line on the server (see Figure 4): Figure 4 - Turn on the stats.log in FileMaker Server 17 (click image to enlarge) While you are there you can also enable the Client Stats log: fmsadmin enable clientstats Figure 5 - Verifying the logging interval and log size setting (click image to enlarge) That client stats log as well as the top call stats log will turn themselves off on every FileMaker Server restart, but the regular stats.log will remain on after issuing this command. Next, I will verify what the logging interval is and how big the log size setting is: fmsadmin get serverconfig: The default settings of logging every 30 seconds and keeping the log size at 40MB is usually sufficient. If you want to change them, the command would be: fmsadmin set serverconfig statsinterval=15 This, for example, would change the interval to 15 seconds. Accessing Your Data in the stats.log Now that we can sleep easy knowing our server deployment will log valuable performance data, how do we get the data when we need it? You cannot download the stats.log and the ClientStats.log from the Admin Console. You will need to grab them from the FileMaker Server logs folder (see Figure 6). Figure 6 - Get the stats.log and ClientStats.log from the FileMaker Server logs folder (click image to enlarge) Questions About the stats.log As always: post any questions on community.filemaker.com or as a comment on this blog, and we’ll be happy to help out. For a full run-down of the new Admin Console, the configuration options that are available from the command line, the new Admin API and the new Console, and a dedicated Tech Brief on monitoring your FileMaker Server, download comprehensive white papers. Leveraging New Features in FileMaker 17 If you have any questions about how to benefit from the features in FileMaker 17, please contact our team. We’re happy to help your team determine the best way to leverage new functionality for your FileMaker solution. The post FileMaker Server 17 and the Crucial ‘stats.log’ appeared first on Soliant Consulting.
Voir le billet d'origine
×