Comments (9)
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:
from cityslavegirls.
@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.
@RJP43 @Ampzilla Thanks for the PHP help! I am just learning this myself. 👍
from cityslavegirls.
@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.
@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.
@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.
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.
from cityslavegirls.
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.
@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)
- Where are we going? HOT 5
- The tagging saga continues.... Dashes and Quotation Marks HOT 2
- The tagging saga continues ... Version Control HOT 3
- The tagging saga continues ... Grammatical Markup HOT 5
- XSLT Batch Transformation
- Schematron Issue HOT 3
- Network Analysis Discussion: Bimodal and Directed HOT 27
- What is done: HOT 6
- Data for *Possible* Mapping HOT 9
- Preparing Historic Maps for the Web HOT 2
- What needs to be done:
- Help with XSLT -- Suggestions Please!! HOT 3
- Checkbox Javascript??? HOT 1
- Official Submission Spring 2016 HOT 3
- Notes for Revision on Nell Nelson Website HOT 1
- Summer Transcription and Coding Work HOT 10
- ILiADS Ideas and Job Opportunities HOT 40
- Archetype Network Graphs HOT 9
- Mapping/Image Mapping Stuff HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cityslavegirls.