Jump to content

AlanTrewartha

Members
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About AlanTrewartha

  • Rank
    member
  1. Groovy script to post text to an ActiveMQ JMS

    If only XSLT wasn't taken out of web publishing in FMP12 :-(
  2. fmresultsetjson.xsl

    Version 1.0.0

    9 downloads

    XSLT to convert Filemaker's REST web-service XML response into clean JSON https://twitter.com/alantrewartha 2017-03-06 Adapted from the original Six Fried Rice XSLT here http://sixfriedrice.com/wp/products/filemaker-to-json-converter/ Changed: * single quotes to JSON-standard double-quotes * removed "fieldDefinitions" block (personal preference) * stopped every field value being presented as an [ array ] even when not a "repeating field" * added whitespace escaping code The white-space escaping code was entirely cribbed from https://github.com/doekman/xml2json-xslt/blob/master/xml2json.xsl

    Free

  3. View File fmresultsetjson.xsl XSLT to convert Filemaker's REST web-service XML response into clean JSON https://twitter.com/alantrewartha 2017-03-06 Adapted from the original Six Fried Rice XSLT here http://sixfriedrice.com/wp/products/filemaker-to-json-converter/ Changed: * single quotes to JSON-standard double-quotes * removed "fieldDefinitions" block (personal preference) * stopped every field value being presented as an [ array ] even when not a "repeating field" * added whitespace escaping code The white-space escaping code was entirely cribbed from https://github.com/doekman/xml2json-xslt/blob/master/xml2json.xsl Submitter AlanTrewartha Submitted 03/06/2017 Category Solutions FM Version FM Version: 0  
  4. SMLoadJar the main jar you get from http://www.apache.org/dyn/closer.cgi?path=/activemq/5.10.0/apache-activemq-5.10.0-bin.tar.gz And then here's the groovy code… RegisterGroovy( "sendToJMS( qURL ; qSubject ; qMessage )" ; "import javax.jms.*;¶ import org.apache.activemq.*;¶ ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(qURL);¶ Connection connection = connectionFactory.createConnection();¶ connection.start();¶ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);¶ Destination destination = session.createQueue(qSubject);¶ MessageProducer producer = session.createProducer(destination);¶ TextMessage message = session.createTextMessage(qMessage);¶ producer.send(message);¶ connection.close();¶ return true;"; "isGui=false" ) You get back '1'/true for success or 'ERROR' for a failure to post the message. Amazed about how easy that was to get done, and I'm just posting in case this is useful to anyone else. (It's entirely cribbed code from a java primer page I found online)
  5. I contacted support@360works.com and they fixed me up with a working update! Thanks very much to 360works - great service and a great product. (The other plugins too I expect!)
  6. I have discovered one thing about the errant SFTP server that might be causing the lockup. I've 7 servers and only one is causing the lock. Similarly if I try it from command line, it is the only server that *before the password prompt* asks for access to the id_dsa key of MY client i.e. the server is trying to check MY identity possibly for auto-authentication by token If you cancel this request and login with the password as normal the command line login works and you can upload normally. So it could be the plugin is just thrown into an unknown state by this response. Very much me guessing there. (And not truly understanding how SSH certificate checking *really* works)
  7. I too am having this issue - I've a process to upload to 7 SFTP servers, and one is stalling the upload during the FTPeek_Upload step. If you use a command line or UI sftp browser you can see 0 byte files of the intended upload file but the filenames prefixed with '.in.' to make them invisible. Was this issue quietly resolved to anyone's satisfaction - if so do let me know. (I've also sent a mail directly to 360 on this - I'm just covering the bases checking here with this exact same issue) Thanks for any advice.
  8. windows powershell

    MORE - adding the extra line in this bit of code appears to work for "true" waiting for output cases try {¶ process.getOutputStream().close();¶ if( process.waitFor() == 0 ) { //Successful¶ stdoutThread.join(); //Wait for all output to be read¶ return stdout.toString();¶ } else { //Error when running command¶ stderrThread.join(); //Wait for entire error message to be read¶ throw new RuntimeException( stderr.toString() );¶ }¶ } catch( InterruptedException e ) {¶ throw new RuntimeException("Process was interrupted; error output is: " + stderr.toString() );¶ }¶ I haven't yet tested if non powershell invoking cmds mess up with these extra commands.
  9. windows powershell

    (limited) SUCCESS! http://stackoverflow.com/questions/4745895/powershell-process-hanging-when-called-from-java-application suggested to me adding "process.getOutputStream().close();¶" to the registergroovy for RunShellScript might do the trick. And indeed it does, for cases where you DON'T wait for the results (the 2nd parameter is "false") the powershell process quits OK if you add an extra line like this I've not got it to work with the waiting for the result "true" option yet which I'd ideally like to do. In practice the shell is never going to take longer than a few seconds, so I can just sleep/wait before continuing what I am doing
  10. windows powershell

    FWIW, I'm trying RunShellScript( ""powershell.exe -ExecutionPolicy Unrestricted -File … ;"true";0) and it works (YAY), in that it runs the .ps1 file I specify, but when I run it as a schedule on the server, the schedule locks (BOO) with status "RUNNING" and the client by that schedule name persists. Previously when schedules lock like that I have to take the whole DB offline to fix that. I'm going to try "false" instead of true to see if I can work round it, and I'll post back if that works at least.
×

Important Information

By using this site, you agree to our Terms of Use.