External File for content completion
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
External File for content completion
Hi guys,
I have a question regarding content completion ... I asked a year ago but due to unforeseen events I never got to actually follow up on my questions...
(c.f. : topic24263.html)
long story short, I am the technical person in a large project where my colleagues work on editing stuff on a server, they are the most un-techy people that you will ever meet, so any configuration needs to be done server-side with little to no action requierd by them...
they want to use content completion to enter ids and stuff for tagged entities, etc.
Is there a way where people can hit [CTRL]+ [SPACE] and get content suggestions, such as <rs type={id}> ... </rs>
after reading, and probably misunderstanding the documentation, it feels like they always need to set it up on their own computers somehow, to which I don't have admin-access. I am, however, an admin for the exist-db that they are using.
Our structure, I have full access here:
Is there a way that does not need me to access their computer for them to get content completion?
(sorry, I didn't find the documentation helpful when it comes to this aspect )
I have a question regarding content completion ... I asked a year ago but due to unforeseen events I never got to actually follow up on my questions...
(c.f. : topic24263.html)
long story short, I am the technical person in a large project where my colleagues work on editing stuff on a server, they are the most un-techy people that you will ever meet, so any configuration needs to be done server-side with little to no action requierd by them...
they want to use content completion to enter ids and stuff for tagged entities, etc.
Is there a way where people can hit [CTRL]+ [SPACE] and get content suggestions, such as <rs type={id}> ... </rs>
after reading, and probably misunderstanding the documentation, it feels like they always need to set it up on their own computers somehow, to which I don't have admin-access. I am, however, an admin for the exist-db that they are using.
Our structure, I have full access here:
Code: Select all
server/project/texts/{some_text_to_be_edited}
server/project/xsl/{the_xsl_file}
server/project/*/{some_other_dirs}
(sorry, I didn't find the documentation helpful when it comes to this aspect )
-
- Posts: 1014
- Joined: Wed Nov 16, 2005 11:11 am
Re: External File for content completion
Post by alex_jitianu »
Hi,
Do you use Oxygen project files? If you do, then you can save the content completion configuration that I've mentioned in the other post in a TEI framework extension saved at project level. This way your colleagues will benefit from the customization without the need to do something extra on their machines.
Best regards,
Alex
Do you use Oxygen project files? If you do, then you can save the content completion configuration that I've mentioned in the other post in a TEI framework extension saved at project level. This way your colleagues will benefit from the customization without the need to do something extra on their machines.
Best regards,
Alex
Re: External File for content completion
Good morning
Thanks for your reply!
not yet, since they thought it not intuitive enoug, to use them ...
How would I go about setting the autocompletionup in a Project? maybe this would convince them to use project-files ...
Also: can I somehow utilise projects to have all the connections to our exist-db in there so that I can just share the project and have everything set up?
https://www.oxygenxml.com/doc/versions/ ... lt_script
There, the line 3.b and 3.c are unclear to me, sorry, I feel a little stupid
I have to copy the TEI P5 under document type association, let's say I name it rather creatively TEI P5 - copy. and in frameworks/tei/resources/ I add a cc_config.xml, I am confused ...
1) Do I have to copy the folder (tei) in frameworks and rename it accordingly?
2) Should I recreate the path in the project or is it enough to just have one folder "autocomplete" and put the files there?
3) Can I just put the resources-folder from my project on the classpath *after* the resources-path for the pre-existing resources folder?
my current setup:
Thanks for your reply!
not yet, since they thought it not intuitive enoug, to use them ...
How would I go about setting the autocompletionup in a Project? maybe this would convince them to use project-files ...
Also: can I somehow utilise projects to have all the connections to our exist-db in there so that I can just share the project and have everything set up?
https://www.oxygenxml.com/doc/versions/ ... lt_script
There, the line 3.b and 3.c are unclear to me, sorry, I feel a little stupid
I have to copy the TEI P5 under document type association, let's say I name it rather creatively TEI P5 - copy. and in frameworks/tei/resources/ I add a cc_config.xml, I am confused ...
1) Do I have to copy the folder (tei) in frameworks and rename it accordingly?
2) Should I recreate the path in the project or is it enough to just have one folder "autocomplete" and put the files there?
3) Can I just put the resources-folder from my project on the classpath *after* the resources-path for the pre-existing resources folder?
my current setup:
- image.png (17.47 KiB) Viewed 1243 times
Last edited by kwun on Thu Sep 14, 2023 11:26 am, edited 3 times in total.
-
- Posts: 1014
- Joined: Wed Nov 16, 2005 11:11 am
Re: External File for content completion
Post by alex_jitianu »
Hi,
There's always room for improvement in the documentation!
A couple of aspects to clarify, before giving a recommendation. What Oxygen version are you running? Are you using the buil-in TEI P5 framework or have you customize it or extended?
Assuming that you currently rely on the built-in TEI P5 framework, I would recommend to:
- Create an Oxygen project, *.xpr file and open it inside the Project view.
- go to Options->Preferences on page Document Type Association / Locations and switch it to Project level from the bottom of the page
- in the Additional Frameworks directories section add a path like ${pd}/frameworks
- click OK to save all these settings
- create a Framework script that extends TEI P5 and save it for example in <projectDir>/frameworks/my-tei-p5/my-tei-p5.exf
Now it's time to create the content completion configuration file:
- I suggest creating a new file <projectDir>/frameworks/my-tei-p5/resources/cc_config_ext.xml using the new document template Content Completion Configuration. The invoked XSLT file can sit next to the configuration file.
The next step is to link the framework configuration to the cc_config_ext.xml file :
- edit the my-tei-p5.exf and add a block like this:
Best regards,
Alex
There's always room for improvement in the documentation!
A couple of aspects to clarify, before giving a recommendation. What Oxygen version are you running? Are you using the buil-in TEI P5 framework or have you customize it or extended?
Assuming that you currently rely on the built-in TEI P5 framework, I would recommend to:
- Create an Oxygen project, *.xpr file and open it inside the Project view.
- go to Options->Preferences on page Document Type Association / Locations and switch it to Project level from the bottom of the page
- in the Additional Frameworks directories section add a path like ${pd}/frameworks
- click OK to save all these settings
- create a Framework script that extends TEI P5 and save it for example in <projectDir>/frameworks/my-tei-p5/my-tei-p5.exf
Now it's time to create the content completion configuration file:
- I suggest creating a new file <projectDir>/frameworks/my-tei-p5/resources/cc_config_ext.xml using the new document template Content Completion Configuration. The invoked XSLT file can sit next to the configuration file.
The next step is to link the framework configuration to the cc_config_ext.xml file :
- edit the my-tei-p5.exf and add a block like this:
Code: Select all
<classpath inherit="all">
<addEntry path="${framework}/resources" position="before"/>
</classpath>
Unfortunately, no. Database connections passwords are encrypted in a way that doesn't make them sharable through the project.Also: can I somehow utilise projects to have all the connections to our exist-db in there so that I can just share the project and have everything set up?
Best regards,
Alex
Re: External File for content completion
Hi, thanks for your response, again
I will try to follow the rest of your post and get back here once I've done that
You are really helpful and I am grateful for the help!
We have 25 and 24 running in the teamWhat Oxygen version are you running?
yes, we are using the built-in, but I can jsut make a copy of that as a project.Are you using the buil-in TEI P5 framework or have you customize it or extended?
I will try to follow the rest of your post and get back here once I've done that
You are really helpful and I am grateful for the help!
Re: External File for content completion
Hi there,
sorry for the long break, I've been to conferences and thus too busy for this
I think I followed all your steps to the point.
Now, something is happening:
I don't even get the suggestions from inside the xml-file, anymore, so I guess it goes looking for stuff *somewhere*
Can you maybe provide some more help?
my-tei-5p:
cc_config_ext.xml (I skipped the header for breviety in the post, I commented everything that was in there out)
not sure this one is correct:
the folder in which my index-files are stored is this one:
and finally my get_values_rfom_db.xsl, just to be sure:
edit, bcs I overlooked it:
I receive this error message:
I don't know why, but somehow I ended up with two document-types:
(the first one, I created with the new -> assistant), while TEI P5 - EuReD-autocomplete is my project-name.
I hope I am not overstretching your helpfulnes
sorry for the long break, I've been to conferences and thus too busy for this
I think I followed all your steps to the point.
- image.png (20 KiB) Viewed 1072 times
I don't even get the suggestions from inside the xml-file, anymore, so I guess it goes looking for stuff *somewhere*
Can you maybe provide some more help?
my-tei-5p:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!--
The file must be saved inside a framework directory, the same place where a *.framework file should sit.
To generate a *.framework file out of the script, you need to use the "Compile Framework Extension script" action
from the contextual menu.
-->
<script xmlns="http://www.oxygenxml.com/ns/framework/extend"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oxygenxml.com/ns/framework/extend http://www.oxygenxml.com/ns/framework/extend/frameworkExtensionScript.xsd"
base="">
<name>TEI cusotimisation for ZEiD-Projects</name>
<description/>
<priority>High</priority>
<author>
<!--
Author Actions are loaded from these directories:
{framework_directory}/externalAuthorActions
{framework_directory}/{framework_file_name}_externalAuthorActions
https://www.oxygenxml.com/doc/versions/22.1/ug-editor/topics/dg-create-custom-actions.html#dg-create-custom-actions__section_2
-->
<toolbars>
<toolbar>
<separator/>
<addAction id="insert.note"/>
</toolbar>
</toolbars>
<contextualMenu>
<submenu name="Other actions">
<addAction id="insert.note"/>
</submenu>
</contextualMenu>
<contentCompletion>
<authorActions>
<addAction id="insert.note" replacedElement="note" inCCWindow="true"/>
</authorActions>
</contentCompletion>
</author>
<classpath inherit="all">
<addEntry path="${framework}/resources" position="before"/>
</classpath>
</script>
Code: Select all
<valueProposals path="rs/@ref">
<xslt href="get_values_from_db.xsl" useCache="false" action="replace"/>
</valueProposals>
- image.png (80.53 KiB) Viewed 1072 times
- image.png (21.65 KiB) Viewed 1072 times
and finally my get_values_rfom_db.xsl, just to be sure:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:editorAccess="java:ro.sync.exml.workspace.api.editor.WSEditor" xmlns:textpage="java:ro.sync.exml.workspace.api.editor.page.text.xml.WSXMLTextEditorPage" xmlns:work="java:ro.sync.exml.workspace.api.PluginWorkspace" xmlns:saxon="http://saxon.sf.net/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:prov="java:ro.sync.exml.workspace.api.PluginWorkspaceProvider" exclude-result-prefixes="#all" version="3.0">
<xsl:param name="contextElementXPathExpression" as="xs:string"/>
<xsl:param name="documentSystemID" as="xs:string"/>
<xsl:template name="start">
<xsl:variable name="workspace" select="prov:getPluginWorkspace()"/>
<xsl:variable name="editorAccess" select="work:getEditorAccess($workspace, xs:anyURI($documentSystemID), 0)"/>
<xsl:variable name="pageID" as="xs:string" select="editorAccess:getCurrentPageID($editorAccess)"/>
<xsl:variable name="textpage" select="editorAccess:getCurrentPage($editorAccess)"/>
<xsl:variable name="type" select="textpage:evaluateXPath($textpage, $contextElementXPathExpression)/@type" as="xs:string"/>
<xsl:variable name="entries">
<xsl:choose>
<xsl:when test="$type = 'person'">
<xsl:sequence select="doc('${pd}/index/listPerson.xml')//*:person"/>
</xsl:when>
<xsl:when test="$type = 'place'">
<xsl:sequence select="doc('${pd}/index/listPlace.xml')//*:place"/>
</xsl:when>
<xsl:when test="$type = 'bibl'">
<xsl:sequence select="doc('${pd}/index/listBibl.xml')//*:bibl"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<items action="replace">
<xsl:apply-templates select="$entries">
<xsl:sort select="@xml:id"/>
</xsl:apply-templates>
</items>
</xsl:template>
<xsl:template match="*:person">
<item value="#{@xml:id}" annotation="{normalize-space(*:persName[1])}"/>
</xsl:template>
<xsl:template match="*:place">
<item value="#{@xml:id}" annotation="{normalize-space(*:placeName[1])}"/>
</xsl:template>
<xsl:template match="*:bibl">
<item value="#{@xml:id}" annotation="{normalize-space(*:abbr[1])}"/>
</xsl:template>
</xsl:stylesheet>
I receive this error message:
edit2:Fehlerlevel: error
Beschreibung: Couldn't load custom extension from class: ro.sync.ecss.extensions.tei.TEIP5ExtensionsBundle because: Could not load class: ro.sync.ecss.extensions.tei.TEIP5ExtensionsBundle
I don't know why, but somehow I ended up with two document-types:
- image.png (17.17 KiB) Viewed 1070 times
I hope I am not overstretching your helpfulnes
- Attachments
-
- image.png (205.82 KiB) Viewed 1072 times
Last edited by kwun on Mon Oct 02, 2023 10:17 am, edited 3 times in total.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service