Ability to attache files to a ticket - Research Story
this will allow user to upload screen short to a ticket.
Java Script / AJAX Client
useing jquery libs to handle file upload and page refresh
- jQuery lib will be idea for upload files.
- upload file to server
- waiting response from server
- refresh page with result
- generate wiki code to reference the file on server side.
this seems the winner for client:
- jQuery File Upload
- PLUpload is the built-in file uploader in WordPress 3.8.x
Supported File Typtes
- images
- office documents
Where the file stored?
In Trac
- XMLRPC api supports attachment or not?
- Yes! The Trac XML-RPC api does support attachement. It offers list, get, put, and delete methods to handle all possible cases for attachement.
- Is the XMLRPC api for attachement easy to use?
- ISSUE: it is not easy to reference the attachment if Trac installation is protected by password.
MediaWiki if available
- using api.app or special page
- centralized place for everything.
WordPress if available
- WordPress API or function...
- WordPress page template
Use Cases
There are 2 different use cases, one for image files and one for other files.
Image Files
- user select image file from local desktop or drag and drop image file from local desktop to input area
- file is uploaded to wiki server
- generate the URL for the image.
- attach the image wiki code to the description / comment textarea.
Binary Files
In the binary files case, we should generate a the link to the file instead fo the wiki image reference.
User Interface Design
The attachement section will be added to both main ticket creation / modification area and comment area.
- function wptc_widget_ticket_fieldset
- function wptc_widget_comment_fieldset
Scope
- We will start with using MediaWiki to save all binary files.
- Drag and drop will be support in future releae
MediaWiki API or Special Page
it is a bit challenge to calling MediaWiki calsses and APIs from WordPress world.
If we think from another perspective, we could create a special page on OPSpedia Wiki to handle the uploaded files.
Component Design
- function to generate new component called Attachment:
- load/enqueue PLupload libs, WordPress function wp_enqueue_script
- render the upload area, file selection button and upload button
- MediaWiki special page to handle PLupload request on server side.
- JavaScript client to add link to ticket textarea and / or comment textarea.
Tickets / Stories Design and Plan
- how to use PLUpload on WordPres page template?
- How to upload file through MediaWiki API?
- How to upload file through MediaWiki Special Page?
- How to create MediaWiki Special Page?