Giter Site home page Giter Site logo

Comments (9)

adammparker avatar adammparker commented on June 12, 2024

Also if you want to see a fully functioning version of this (except for the PHP code obviously which is on the server) you can visit:

presidential.obdurodon.org

from cityslavegirls.

RJP43 avatar RJP43 commented on June 12, 2024

@ebeshero this is the basics of what my brother taught me ... I hope to experiment with this further in preparation for our Oakland Presentations.

from cityslavegirls.

ebeshero avatar ebeshero commented on June 12, 2024

@RJP43 @Ampzilla Thanks for the PHP help! I am just learning this myself. 👍

from cityslavegirls.

RJP43 avatar RJP43 commented on June 12, 2024

@ebeshero's idea for PHP integrated into SVG from Cytoscape

grabbing the elements controlling particular nodes or edges with JavaScript, and firing a script that that would grab and post the associated file information, and pull up some relevant content from that file formatted in HTML in the same window

Moved this from other issue to keep all PHP stuff together!

from cityslavegirls.

RJP43 avatar RJP43 commented on June 12, 2024

@spadafour and I were discussing creating several xslts (@Ampzilla 's suggestion) that all have a different focus (ie. versioning, gender, grammatical) for the markup so that users could choose what kind of marked up text they want to see

more to come on this soon!

from cityslavegirls.

ebeshero avatar ebeshero commented on June 12, 2024

@RJP43 @spadafour @Ampzilla For implementing PHP on the CitySlaveGirls site at the PSC, here's what here's what I've learned, and what I recommend

  • In order to make XSLT execute from within the Apache web server, we'd need to install a special program there, something so that Java can execute the saxon XSLT transformation. It's probably a security risk for the PSC, and it's something we'd need to inquire about
  • Here's what we can do now, and maybe it's better: You can save your XSLT transformations in eXist directories, so that you can call them in eXist (the same we we get a REST address for your XQuery output). eXist-db can run XSLT as well as XQuery, so you could write PHP to call the XSLT file where it's saved in eXist, and make it run a transformation, and access the output from an output directory you set up in eXist. Here's how that could work:
  • Write XQuery that uses the transform(transform) function (we can read up on this)--because that's how you make XQuery execute XSLT, and set up a place in eXist to save your XSLT and your output.
  • Write your PHP to call the XQuery (that calls the XSLT and makes the output!
  • One more thing you can do (once this is working) is do a check in your output directory to see if an HTML file was already generated and that its date is the same as your most recent XML input. If its date is older, you can run the XSLT again and make new output. If it's the same date, just pull in the existing HTML so you don't have to run the transformation (which should speed up site access for your users).

Does that make sense as a battle plan? I'm pinging David Birnbaum, who's done things like this before.
@djbpitt

from cityslavegirls.

djbpitt avatar djbpitt commented on June 12, 2024

This is the PHP I use when users click on a tale title at http://aal.obdurodon.org (remove the ".txt" extension; GitHub made me add that). Let me know if anything is unclear. The basic logic is that when a user asks for a tale (to be served in HTML), after a lot of security checking, it checks whether the HTML exists. If not, it generates it, saves it, and serves it. If it does exist, it compares the dates of the HTML and the corresponding XML. If the HTML is newer, it serves it. If not, that means that the XML has been updated since the last access, so it regenerates the HTML, caches it, and serves it. The point of all of this is that I just upload revised XML whenever I have it, and I don't have to remember to create or recreate the HTML manually each time I do that.

readTale.php.txt

from cityslavegirls.

djbpitt avatar djbpitt commented on June 12, 2024

The security risk with the approach I describe above is that PHP exec() can execute malicious code if a user knows how to fool it. For that reason, some systems that run PHP disable the exec() function. If you need it, you don't have to be afraid of it, but you should sanitize any user input carefully before passing it to exec(). If you're already running eXist for other purposes, the idea of going through that, as Elisa describes, makes good sense.

from cityslavegirls.

RJP43 avatar RJP43 commented on June 12, 2024

@djbpitt My brother ( @Ampzilla ) and I attempted to use your PHP code discussed above on the Nelson site sitting on Obdurodon; however, seems that since the folder owner is not apache my exec function in PHP can't write the html output file. The error message we are getting is:
( [0] => Error on line 8 of readingView.xsl: [1] => Failed to create output file [2] => file:/var/www/html/nell/articles/html/1888-07-30-ChTimes.html: Permission denied [3] => Failed to create output file file:/var/www/html/nell/articles/html/1888-07-30-ChTimes.html )

I attempted to change ownership of the necessary directories, but cannot do that through FTP (at least as rjp43).

You can view our edited version of your PHP code and all of the site code here and see the error live on the site (as of 8/13 4:15PM) here.

So what I'm asking is for you to change ownership of the articles folder in the Nelson site to be changed to ownership and for the properties to have group write power so I can still access/change. Or perhaps this is a larger ((private?) conversation we need to have about permission structure for the Nelson site sitting on Obdurodon. Open for any and all suggestions on what to do here and your time is always much appreciated!

We were hoping to first get the site up and running on Obdurodon and then find out how to approach PSC to get it working there (have the Saxon9HE.jar installed there and obtain permissions).

from cityslavegirls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.