cirsfid-unibo / lime

LIME (Language Independent Markup Editor)
http://lime.cirsfid.unibo.it/
29 stars 14 forks source link

Where exactly are documentInfo properties set when loading a AN-xml document ? #37

Closed kohsah closed 7 years ago

kohsah commented 8 years ago

I am a bit confused as to where documentInfo is set in DocProperties when a AN document is opened in lime.

I looked at Storage.openDocument (line 200) , but couldn't get where it gets set when me.transformContent() is called in the success callback. Any pointers ?

kohsah commented 8 years ago

Basically, by changing the folder name for markup configuration from the documentType (as I am trying to do with editorType), the folder to load the markup configuration cannot be determined from the loaded file (since currently the docType name is determined from the Akoma-Ntoso file, and the docType name is the folder for markup config in languagePlugins).

What i can do instead is find the best match for editorType from structure.json based on the docType and subType. Thats why was trying to understand at what point the docType is read from the loading XML.

obujor commented 8 years ago

documentInfo is set in the setDocProperties function in lime-core/src/controller/Language.js file (this file will be renamed soon). Anyway try to reduce the use of documentInfo and use the metadata store (Ext.getStore('metadata').getMainDocument()) instead because documentInfo soon will be removed.

The docType is read from the XML in akn-main/overrides/Language.js (old style) and in akn-metadata/src/sync/ImportController.js, function importDocumentMeta (new way). The old style will be removed in the future.