Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post here questions and problems related to oXygen frameworks/document types.
Mauricio Marten
Posts: 7
Joined: Wed Sep 21, 2022 12:24 am

Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Mauricio Marten »

Hi,

We are migrating our custom framework from Oxygen 20.1 to Oxygen 25.1. I need the jar containing the package ro.sync.contentcompletion.xml similar to what was resolved in this topic posted by a coworker of mine: sdk-api-frameworks-document-types/topic25744.html

I am currently getting the error that the SchemaManagerFilter class cannot be loaded and it is related to that package.

Thanks,
Mauricio
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Radu »

Hi Mauricio,

Could you paste here the error message you get when attempting to compile your project?

Maybe you can tell me more about how your custom project is set up.
Do you have a Maven pom.xml which refers to our SDK? Did you make changes there? If so how are you referring to our SDK there?
Have you created an account on our SDK page? It should tell you how to refer our SDK from a Maven project.
https://www.oxygenxml.com/oxygen_sdk/download.html

Or does your Java project refer directly to certain JAR libraries from an Oxygen installation folder?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Mauricio Marten
Posts: 7
Joined: Wed Sep 21, 2022 12:24 am

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Mauricio Marten »

Hi Radu,

The error is the following:
"Unnable to load the schema manager filter class 'com.hp.kmctm.sdldita.framework.extensions.SDLContentAssistant'"

In the SDLContentAssistant class I am importing:
import ro.sync.contentcompletion.xml.SchemaManagerFilter;

The project is the same one as mentioned in this other topic as I said before:
sdk-api-frameworks-document-types/topic25744.html

What I need to know is where is the specific JAR for this ro.sync.contentcompletion.xml so that I can add it as a dependency to my pom.xml in the following way:

Code: Select all

<dependency>
    <groupId>com.sample</groupId>  
    <artifactId>samplifact</artifactId>  
    <version>1.0</version> 
    <scope>system</scope>
    <systemPath>C:\DEV\myfunnylib\yourJar.jar</systemPath>
</dependency>
Thanks,
Mauricio
Last edited by Mauricio Marten on Mon Sep 25, 2023 6:13 pm, edited 3 times in total.
Mauricio Marten
Posts: 7
Joined: Wed Sep 21, 2022 12:24 am

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Mauricio Marten »

Also we have the dependencies like this in the pom.xml:

Code: Select all

    <dependency>
      <groupId>com.oxygenxml</groupId>
      <artifactId>oxygen-sdk</artifactId>
      <version>${oxygen.sdk.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.oxygenxml</groupId>
      <artifactId>oxygen</artifactId>
      <version>${oxygen.sdk.version}</version>
      <scope>provided</scope>
    </dependency>
    
Last edited by Mauricio Marten on Mon Sep 25, 2023 10:19 pm, edited 1 time in total.
Mauricio Marten
Posts: 7
Joined: Wed Sep 21, 2022 12:24 am

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Mauricio Marten »

Hi Radu,
Were you able to check my previous messages? My team needs to solve this as quick as possible and we are running out of ideas.
Thanks,
Mauricio
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Radu »

Hi Mauricio,
Sorry for the delay, I somehow missed answering your last question.
So you have a class which extends "ro.sync.contentcompletion.xml.SchemaManagerFilter" and your project does not compile because the "ro.sync.contentcompletion.xml.SchemaManagerFilter" cannot be found in the Maven class path, correct?
Looking at your pom.xml I assume you also have in the same pom.xml file a property definition for the Oxygen sdk version:

Code: Select all

  <properties>
  ...
    <oxygen.sdk.version>25.1.0.2</oxygen.sdk.version>
    ...
  </properties>
Other than that does your Java IDE (I'm using Eclipse, you may be using something else) report any error inside the pom.xml file?
If you run maven clean and then update on the project does it work for you?

I tried on my side to use precisely the steps described here, maybe you can try the same thing on your side:
https://www.oxygenxml.com/oxygen_sdk/download.html
I run the command line here to create the sample project:
https://www.oxygenxml.com/oxygen_sdk/do ... mmand-line

Then in Eclipse I imported the "oxygen-sample-framework" sample project and it is valid for me, I can find the "SchemaManagerFilter" in the classpath, the sample SDFSchemaManagerFilter class also compiles correctly.
Screenshot 2023-10-04 at 08.41.43.png
Screenshot 2023-10-04 at 08.41.43.png (230.32 KiB) Viewed 915 times
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Mauricio Marten
Posts: 7
Joined: Wed Sep 21, 2022 12:24 am

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Mauricio Marten »

Hi Radu,

Yes, that is correct we have the oxygen.sdk.version defined as you mention.

The SDLContentAssistant class that we are using extends DITASchemaManagerFilter which eventually extends to the SchemaManagerFilter. The error doesn't occur during the build. To give some context this project is installed into Oxygen as an add-on and the error occurs when I open Oxygen and open a topic xml file. The error shows in the console as shown in the image below:
image.png
image.png (12.13 KiB) Viewed 895 times
During the build we do get the following warning:
image.png
image.png (17.29 KiB) Viewed 893 times

Also the current imports that we are using for this SDLContentAssistan class are:

Code: Select all

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ro.sync.contentcompletion.xml.CIElement;
import ro.sync.contentcompletion.xml.SchemaManagerFilter;
import ro.sync.contentcompletion.xml.WhatElementsCanGoHereContext;
import ro.sync.ecss.dita.ContextKeyManager;
import ro.sync.ecss.dita.ContextKeyManagerProvider;
import ro.sync.ecss.extensions.dita.DITASchemaManagerFilter;

public final class SDLContentAssistant extends DITASchemaManagerFilter {
Please let me know if you need any other information.

Thanks,
Mauricio
Last edited by Mauricio Marten on Wed Oct 04, 2023 7:26 pm, edited 2 times in total.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Radu »

Hi Mauricio,
The error doesn't occur during the build.
This would have been useful information from the very beginning.
Can you double check your framework configuration properly refers in the "Classpath" tab the proper JAR libraries, meaning the base dita.jar and your custom.jar? Can you look inside your custom framework JAR library to see that it incorporates the SDLContentAssistant class?
Looking at the code where the error is thrown it seems we do not log there the entire exception stack trace, which would have been useful in this case... maybe I could prepare for you a custom Oxygen kit which logs the exception stack trace...
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Radu »

Hi,
One more thing, the DITASchemaManagerFilter has a non-default constructor:

Code: Select all

  /**
   * Constructor 
   * 
   * @param documentTypeName The document type name
   * @param contextKeyManagerProvider A provider of a context key manager used to propose attributes values for 
   * attributes like keyref.
   * @param userNameProvider User name provider - it may return <code>null</code> in which case a fallback is used.
   */
  public DITASchemaManagerFilter(String documentTypeName, ContextKeyManagerProvider contextKeyManagerProvider, 
      Supplier<String> userNameProvider) {
]
As you are setting this SDLContentAssistant extension separately and not through an extension of the DITAExtensionsBundle, you must have a default constructor on the SDLContentAssistant class, I would suggest something like this:

Code: Select all

package ro.sync.ecss.extensions.dita;

import java.util.function.Supplier;

import ro.sync.ecss.dita.ContextKeyManager;
import ro.sync.ecss.dita.ContextKeyManagerProvider;
import ro.sync.exml.workspace.api.PluginWorkspaceProvider;

public class ABC extends DITASchemaManagerFilter {

  public ABC() {
    super("DITA", new ContextKeyManagerProvider() {
      @Override
      public ContextKeyManager getContextKeyManager() {
        return ContextKeyManager.getDefault();
      }
    }, new Supplier<String>() {
      @Override
      public String get() {
        return (String) PluginWorkspaceProvider.getPluginWorkspace().getGlobalObjectProperty(ro.sync.exml.options.APIAccessibleOptionTags.CHANGE_TRACKING_AUTHOR);
      }
    });
  }
}
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Mauricio Marten
Posts: 7
Joined: Wed Sep 21, 2022 12:24 am

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Mauricio Marten »

Hi Radu,

Thank you very much! The default constructor was what we were missing in the code. That solved the issue. Really appreciate it.

Regards,
Mauricio
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Package ro.sync.contentcompletion.xml in Oxygen 25.1

Post by Radu »

Hi Mauricio,
Great! Another way to overwrite the DITA schema manager filter would have been that instead of setting your filter as an individual extension, extend the "ro.sync.ecss.extensions.dita.DITAExtensionsBundle", then extend the "ro.sync.ecss.extensions.dita.DITAExtensionsBundle.createSchemaManagerFilter()", delegate to super to obtain the base filter, then wrap it in your own schema manager implementation. And use your "SDLDITAExtensiosBundle" extension in your DITA framework extension.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply