Code Monkey home page Code Monkey logo

texture's Introduction

Table of Contents

Introduction

OJS Texture Plugin integrates the Texture editor with OJS workflow for direct editing of JATS XML documents.

Handbook

Installation

Texture is available under Plugin gallery

  • Settings -> Web site -> Plugins -> Plugin gallery

texture_plugin

Supported JATS Tags

Tag Definition Support
code A container element for technical contentsuch as programming language code, pseudo-code, schemas, or a markup fragment. πŸ†—
disp-formula Mathematical equation, expression, or formula that is to be displayed as a block (callout) within the narrative flow. πŸ†—
disp-quote Extract or extended quoted passage from another work, usually made typographically distinct from surrounding text. πŸ†—
fig-group Container element for figures that are to be displayed together. πŸ†—
fig Block of graphic or textual material that is identified as a figure, usually bearing a caption and a label such as β€œFigure 3.” or β€œFigure”. πŸ†—
graphic Description of and pointer to an external file containing a still image. πŸ†—
list Sequence of two or more items, which may or may not be ordered. πŸ†—
p Textual unit or block; a textual paragraph. πŸ†—
preformat Text in which spaces, tabs, and line feeds must be preserved. Content is typically displayed in monofont to preserve character alignment. πŸ†—
sec Headed group of material; the basic structural unit of the body of a document. πŸ†—
supplementary-material Container element for a description of, and possibly a pointer to,external resources that support the article, but which are not part of the content of the article. πŸ†—
table-wrap Wrapper element for a complete table, including the tabular material (rows and columns), caption (including title), footnotes, and alternative descriptions of the table for purposes of accessibility. πŸ†—
tex-math Used to hold encoded math, expressed in TeX or LaTeX. πŸ†—
ack Textual material that names the parties who the author wishes to thank or recognize for their assistance in/contributions toward the article, for example, producing the work, funding the work, inspiring the work, or assisting in the research on which the work is based. --
address Container element for contact information such as a postal address for a person or organization. --
alternatives Container element used to hold a group of processing alternatives, for example, a single that ships in several formats(tif, gif, and jpeg) or in different resolutions. This element is a physical grouping to contain multiple logically equivalent (substitutable) versions of the same information object. Typically these are processing alternatives, and the reader is expected to see only one version of the object. --
array Tabular arrangement of text in the narrative flow of the document. Unlike a , an array does not contain a label, title, caption, or table headings (column heads). --
boxed-text Textual material that is part of the body but is outside the flow of the narrativetext (for example, a sidebar). --
chem-struct-wrap Wrapper element for a chemical expression, reaction, equation, etc. that is set apart from the text; includes any number, label, or caption that accompanies the chemical expression. --
def-list List in which each item consists of two parts: 1) a word, phrase, term, graphic,chemical structure, or equation, that is paired with 2) one or more descriptions, discussions, explanations, or definitions of it. --
disp-formula-group Container element for equations or other mathematical expressions. --
media Description of and pointer to an external file that holds a media object (for example, an animation, a movie). --
related-article Description of a journal article related to the content but published separately. May include a link to the related article. --
related-object Description of an object (for example, book, book chapter, figure, or table) related to the article content but published separately. May include a link to the related object. --
sig-block Area of text and graphic material placed at the end of the body of a document or document component to hold the graphic signature or description of the person(s) responsible for or attesting to the content. --
speech One exchange (a single speech) in a real or imaginary conversation between two or more entities. --
statement Theorem, Lemma, Proof, Postulate, Hypothesis, Proposition, Corollary, or other formal statement, identified as such with a label and usually made typographically distinct from the surrounding text. --
table-wrap-group Container element for tables ( elements) that are to be displayed together. --
verse-group Song, poem, or verse. --
x Generated text or punctuation. Typically used when:an archive decides not to have text generated on display and thus to pre-generate such things as commas or semicolons between keywords, oran archive receives text with tags embedded and wishes to retain them. --

Usage

Texture supports editing XML files in JATS XML standard.

  • After plugin installation, go to a Production Stage of the submission

  • Upload JATS XML to the Production Ready state. You can find sample files blank manuscript or a list of samples here.

production_ready_edit

  • All the uploaded images in texture are integrated as dependent files in production ready stage.

  • When you later publish the texture-edited JATS XML file as galley, you have to upload the images again in the dependancy grid.

gallery_edit

  • In the editing modal, upload the same images as dependent files you uploaded for texture.

Issues

Please find any issues here

Technical documentation

Backend Integration

Texture Plugin creates a Backend URL endpoint for the Editor client to send GET, PUT, DELETE Requests.

GET DAR File

GET /texture/json

Example : http://localhost/index.php/my_journal/texture/json?submissionId=4&fileId=29&stageId=5

  • Parameters:

    1. submissionId : integer

    2. fileId : integer

    3. stageId : integer

  • Return:

    DAR File : json

    • Example:

        {"version":18,"resources":{"manifest.xml":{"encoding":"utf8","data":"XML PAYLOAD","size":22087,"createdAt":0,"updatedAt":0},"placeholder_2.jpg":{"encoding":"url","data":"http://localhost:8000/index.php/stable-3_2_0/texture/media?submissionId=4&fileId=29&stageId=5&fileName=placeholder_2.jpg","size":39385,"createdAt":1592229618,"updatedAt":1592229618},"coverimage_2.png":{"encoding":"url","data":"http://localhost:8000/index.php/stable-3_2_0/texture/media?submissionId=4&fileId=29&stageId=5&fileName=coverimage_2.png","size":48334,"createdAt":1594576206,"updatedAt":1594576206}}}
      

Update DAR File

PUT /texture/json

Example : http://localhost/index.php/my_journal/texture/json?submissionId=4&fileId=29&stageId=5

  • Payload : DAR File

  • Parameters:

    1. submissionId : integer

    2. fileId : integer

    3. stageId : integer

  • Return:

    String : json

    • Example:

        {"status":true,"content":"","elementId":"0","events":null}
      

GET Media File

`GET /texture/media`

Example : http://localhost/index.php/my_journal/texture/media?submissionId=4&fileId=29&stageId=5&fileName=placeholder_2.jpg

  • Parameters:

    1. submissionId : integer

    2. fileId : integer

    3. stageId : integer

    4. fileName: string (should be unique per submission)

  • Return:

    Media file : media file

DELETE Media File

`DELETE /texture/media`

Example : http://localhost/index.php/my_journal/texture/media?submissionId=4&fileId=29&stageId=5

  • Parameters:

    1. submissionId : integer

    2. fileId : integer

    3. stageId : integer

  • Return:

    String : json

    Example:

     {"status":true,"content":{"submissionId":4,"fileId":4,"fileRevision":1,"delete_stauts":true},"elementId":"0","events":null}
    

texture's People

Contributors

amirzoian avatar asmecher avatar carlamarques avatar ckamburov avatar ctgraham avatar defstat avatar diegojmacedo avatar eddoff avatar jirrka avatar jordilacruz avatar josekarvalho avatar kaitlinnewson avatar kant avatar klausru avatar mandroide avatar mhvezina avatar mirkospiroski avatar neffe avatar ppv1979 avatar primoz-svetek avatar ronniebrito avatar t-fildishevska avatar tigran54 avatar trungvjm avatar vitaliy-1 avatar vormia avatar withanage avatar xmlflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

texture's Issues

Editing access within submission workflow stages

The "Edit with Texture" link formulates with a stageId:

$dispatcher->url($request, ROUTE_PAGE, null, 'texture', 'editor', null,
array(
'submissionId' => $submissionFile->getSubmissionId(),
'fileId' => $submissionFile->getFileId(),
'stageId' => $stageId
)
)

This is, presumably, the workflow stage, given that it generally sources from the fetch-grid call for a files grid, e.g. ojs/index.php/test/$$$call$$$/grid/files/production-ready/production-ready-files-grid/fetch-grid?submissionId=3&stageId=5&_=1570819236851

It fails to be assigned any value in a new submission as soon as the wizard moves beyond the initial upload.

Steps to reproduce:

  1. As author, start a new submission
  2. Upload a JATS XML and Dependent Files
  3. Finalize the Submission.
  4. Return to the Submission (ojs/index.php/test/$$$call$$$/grid/files/submission/author-submission-details-files-grid/fetch-grid?submissionId=1&_=1570820690723)
  5. Try to Edit With Texture (fails)

or

  1. Do not finalize the Submission
  2. Return to the Submission (ojs/index.php/test/$$$call$$$/grid/files/submission/submission-wizard-files-grid/fetch-grid?submissionId=4&_=1570820830259)
  3. Try to Edit With Texture (fails)

There is no need to rely on the URI for the workflow stage. We can get it from the submission.

Enable upload of DAR file directly

Proposed workflow:
Upload of DAR file via the SubmissionsFilesUploadForm is hooked by this plugin and the contents are extracted (if valid).

Specifically:

  • Hook submissionfilesuploadform::execute examines the upload
  • If a 'dar' extension, and if it has at least a "manuscript.xml" and "manifest.xml"
  • Extract the manuscript.xml to create a new submission file
  • Use the manifest.xml to extract new dependent files
  • Replace the submission file from the upload form with the extracted submission file (and dependent files).

Prerequisite: pkp/pkp-lib#5146

Texture plugin never runs in OJS 3.1.1

I have an OJS running with texture plugin installed. But this plugin doesn't shows up anywhere in the workflow. I have tested many times even on a fresh install of OJS on other hosting and local servers because error log reports depreciation warning.

[30-Oct-2018 10:59:58 UTC] PHP Strict Standards: Declaration of TexturePlugin::register() should be compatible with LazyLoadPlugin::register($category, $path, $mainContextId = NULL) in /home/roesolca/public_html/plugins/generic/texture/TexturePlugin.inc.php on line 141

Is there any way we can disable Lazyload plugin if this is the major error causing reason.

Please tell if there is a way to resolve this error along with multiple other depreciation warnings. If there is a problem with PHP version do tell me. I am running 5.6 Native PHP.

By default OJS doesn't runs many of the plugins like texture, JATS template etc due to these warnings. Please help me resolve these issues since I am fed up of this.

Sync some metadata between XML and OJS backend

When an XML file is the Main Manuscript file (this would need to be established somehow if there are more than one), then the metadata in the XML should be sync'ed with what's in the OJS back end (title, authors, etc.). This should probably be a two-way sync.

Missing handling of localized file name of dependent files

File names are handled as non-localized data, which was changed in OJS 3.3.
This leads to broken links to figures when reading the file as well as incorrect data of uploaded ones.
Associated error in the log when opening JATS XML with attached image:

PHP Warning:  Illegal offset type in /home/doc/OJS/development/versions/ojs-3.3.0-8/plugins/generic/texture/classes/DAR.inc.php on line 204

Uploading the image through the plugin leads to incorrect database entry in submission_file_settings table:

submission_file_id	locale	setting_name	setting_value	setting_type	

2466	0	name	fig4_2.jpg	string

Tested with OJS 3.3.0 and main branch of the Texture plugin

Reusability of handler helper methods

Methods TextureHandler::_createDependentFile() and TextureHandler::_updateManuscriptFile() seem reusable enough that they could be methods of the Plugin, or even of SubmissionFileManager.

For example, for #32, we would want a plugin hook to potentially do both of these things. There would be no need to reach out to a Handler.

@withanage , @asmecher , opinions on whether to promote these methods to the plugin or to SubmissionFileManager? Are there assumptions or specifics I'm missing here which limit the reusability of this code?

CanΒ΄t install texture plugin

Hi. I use OJS 3.1.2.4 and I canΒ΄t install texture plugin, neither from the plugin panel nor uploading the plugin file (both updated and old version). Is there any solution? Thank you.
Pablo

OS platform: Linux
PHP version: 7.2.26
Apache version: LiteSpeed
Driver DB: mysqli
DB: 10.2.30-MariaDB

fails on OJS 3.3.0.2. undefined method SubmissionFile::getExtension()

When OJS is "loading files" in the production phase (I suppose the same in other phases), the page never ends "loading files" and I get this error in apache logs:

[Sun Feb 07 20:46:50.849739 2021] [php7:error] [pid 13397] [client 127.0.0.1:46010] PHP Fatal error: Uncaught Error: Call to undefined method SubmissionFile::getExtension() in /home/isaac.marco/git/ojs33/plugins/generic/texture/TexturePlugin.inc.php:130\nStack trace:\n#0 /home/isaac.marco/git/ojs33/lib/pkp/classes/plugins/HookRegistry.inc.php(107): TexturePlugin->templateFetchCallback('TemplateManager...', Array)\n#1 /home/isaac.marco/git/ojs33/lib/pkp/classes/template/PKPTemplateManager.inc.php(1070): HookRegistry::call('TemplateManager...', Array)\n#2 /home/isaac.marco/git/ojs33/lib/pkp/classes/controllers/grid/GridHandler.inc.php(1020): PKPTemplateManager->fetch('controllers/gri...')\n#3 /home/isaac.marco/git/ojs33/lib/pkp/classes/controllers/grid/GridHandler.inc.php(986): GridHandler->renderRowInternally(Object(Request), Object(SubmissionFilesGridRow))\n#4 /home/isaac.marco/git/ojs33/lib/pkp/classes/controllers/grid/GridHandler.inc.php(1031): GridHandler->renderRowsInternally(Object(Request), Array)\n#5 /home/isaac.marco/git/ojs33/lib/pkp/classes/controllers/grid/GridHandler.inc.php(921): GridHandler->renderGri in /home/isaac.marco/git/ojs33/plugins/generic/texture/TexturePlugin.inc.php on line 130, referer: http://loc.ojs33/index.php/cero/workflow/index/3/5

Create License automatically from Distribution settings by galley creation

Add teh follwing settings according to the license in the distribution settings.

e.g.

<permissions>
            <copyright-statement>Β© 202X The Author(s)</copyright-statement>
            <copyright-year>202X</copyright-year>
            <license license-type="open-access"
              xlink:href="https://creativecommons.org/licenses/by/3.0/de/deed.en" xml:lang="en">
              <license-p><inline-graphic
                xlink:href="http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by.svg"
              />This work is licensed under a Creative Commons Attribution 3.0 Germany License (CC BY 3.0 DE).</license-p>
            </license>
</permissions>

Relax the Schema support

Texture currently supports stricly v1.0 , v1.1 and v1.2 of the JATS green.

-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN'

As long as schema is undefined correctly it throws an exception.

uploading images

when we try to insert an image it seems that it is not being uploading to OJS_dir

Authorization improvements

The SubmissionFileAccessPolicy at https://github.com/pkp/texture/blob/master/TextureHandler.inc.php#L64 should use SUBMISSION_FILE_ACCESS_MODIFY instead of SUBMISSION_FILE_ACCESS_READ. This will prevent authors from making modifications which they are generally not allowed to do. If there is a need for author preview/editing, I guess we need to figure out what that looks like with the existing submission file access policies.

Wherever $request->getUserVar('submissionId') is used, use $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION); instead. For example here: https://github.com/pkp/texture/blob/master/TextureHandler.inc.php#L101. Generally the auth policies should prevent this code from being reached, but this ensures that if the code is fired we are using an authenticated object instead of the unauthorized data passed by the user. (It will also save some database hits.)

Imported image's name should be localized

The main branch and 2_4_3-8 release are affected.

When importing the image through Texture, it's being saved in OJS database as a submission file with non-localized name property. This leads to an incorrect path to the file on the front-end when presenting with JATS Parser Plugin.

To reproduce:

  1. Edit an XML file with Texture.
  2. Click on Insert -> Figure or replace the existing one.
  3. Save the change
  4. Look for the correspondent submission file in submission_file_settings table. The entry looks like:
submission_file_id	locale	setting_name	setting_value	setting_type
2314	                0	name	        fig4.jpg	string	

Question: How do you update Texture?

Hi, how do you currently upgrade Texture?
(I am asking because as an npm dependency it seems to depend on node libraries - but there may be a better way)

Make Texture load within the OJS frame

Right now, Texture loads in its own window in a way that looks separate from OJS. Change to have Texture load "within" OJS, perhaps with a full-screen view that still keeps a top line banner (similar to full page article views).

JATS XML export contains incorrect citation ordering

I doubt that it's something that can be corrected on our side but anyway worth leaving a record.

When editing citations, which involves correcting in-text pointers to references, the JATS XML export doesn't include it's corrected citation ordering.
Assuming I have a reference with rid bib26. I want to put it as a first reference. While all is working as it should inside the editor, in JATS XML output the reference would look like:

<xref id="_xref-1" ref-type="bibr" rid="bib26">[1]</xref>

While id is correct, the text label pointers to the first reference in the sequence. There is no way to figure out from JATS XML what is the right order of references inside the list. The order of exported references is from lower to higher ids, thus citation label [1] points to the reference, which appears first, i.e. id bib1:

<ref-list>
	<ref id="bib1"></ref>
        <ref id="bib2"></ref>
        <ref id="bib3"></ref>
...
</ref-list>

To make any sense, the label here should repeat the numeric value of id:

<xref id="_xref-1" ref-type="bibr" rid="bib26">[26]</xref>

Or the order of refs inside the list should correspond to the text label:

<ref-list>
	<ref id="bib26"></ref>
...
</ref-list>

Texture supports chrome browser warning

There's a warning that appears when using Texture in Firefox that says Texture only supports Chrome. Do we know what limitations are faced in other browsers?

Do not save author's orcid

Hi all:

I have an issue when try to save an author with orcid. The orcid doesn't record.

Regards,
Diego.

Fix HTTP request parsing mechanism

Currently TextureHandler contains code to manually parse an HTTP multipart request. However, using file_get_contents('php://input') with multipart/form-data is out of spec. From http://php.net/manual/en/wrappers.php.php:

php://input is not available with enctype="multipart/form-data".

While it does appear to work on some systems, it's been reported not to work on all. Another mechanism needs to be used to communicate with the Texture editor. (Ideally, we should not be manually parsing HTTP requests at all!)

(Note that #6 may require a rewrite of the storage interface anyway -- this should be considered in conjunction with that issue.)

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.