Page 1 of 1

Webapp customReferencesResolver

Posted: Thu Jun 09, 2016 10:52 am
by Konstantin
Hi !!!
I use Webapp 18.0

I need implement custom references resolving.
For it I overwrite dita.framework and added

Code: Select all

<field name="customReferencesResolver">
<String>webapp.customworkspace.DITAReferenceResolver</String>
</field>
and copied this file to "oxygen-frameworks/dita".
There I had problem...
After a zip file building, inside it created two files with same names "dita/dita.framework" and after extract zip, remains only one default file.

Code: Select all

<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>1.7</version>
<configuration>
<target>
<zip destfile="${project.build.directory}/classes/frameworks.zip">
<zipfileset dir="oxygen-frameworks"></zipfileset>
<zipfileset dir="default-oxygen-frameworks">
I changed sequence of building to :

Code: Select all

<zipfileset dir="default-oxygen-frameworks"></zipfileset>
<zipfileset dir="oxygen-frameworks">
it work, but probable it not right.

So I have call of references resolver (webapp.customworkspace.DITAReferenceResolver) and I placed this class to plugin which normal works

But when I open topic with references this class does not called

Could you advice me how better implement references resolving ?

Re: Webapp customReferencesResolver

Posted: Thu Jun 09, 2016 2:56 pm
by Gabriel Titerlea
Hi Konstantin,

The recommended method of adding functionality to a framework is to extend it [1].
This way you will benefit from changes to the original framework without having to update the extended framework.

After creating the extension and adding your reference resolver you should copy it inside the bundle-frameworks/oxygen-frameworks folder.

To include your DITAReferencesResolver you need to add it as a customReferencesResolver field, like you did, but you should also make sure to include it in the classpath:

Code: Select all


<field name="classpath">
<String-array>
<String>${framework}/YOUR_REFERENCE_RESOLVER_CLASS_OR_JAR</String>
</String-array>
</field>
Regarding the class methods not being called. Can you look over the server logs for anything regarding your ReferencesResolver class and post the findings?
You can usually find them in the tomcat/logs/oxygen.log file.

Regarding the zipfileset part. You shouldn't need to make any changes if you will be extending a framework.
However if you really want to overwrite the DITA framework and not extend it, you will need to copy your overwritten framework to the oxygen-frameworks folder (with a name different from DITA) and edit the bundle-frameworks/pom.xml file and change:

Code: Select all


<include name="dita/**"/>
to

Code: Select all


<exclude name="dita/**"/>
Regards,
Gabriel

[1] - https://www.oxygenxml.com/doc/versions/ ... aring.html

Re: Webapp customReferencesResolver

Posted: Thu Jun 09, 2016 5:29 pm
by Konstantin
I tried do what you said but it does not work.
I added classpath for my jar
Image

I added customReferenceResolver property
Image

I put jar to bundle-frameworks/oxygen-frameworks/dita/DITAReferenceResolver.jar
Image

jar file look like
Image

This is my class:
Image

I do not have oxygen.log but I look logs in catalina.out, which show Exceptions and System.out.println
world "opend" - it is I catch opening new topic
"java.lang.ClassNotFoundException: webapp.extention.resolver.DITAReferenceResolver" - it is I try take this class from plugin

Code: Select all

System.out.println("--DITAReferenceResolver = " + Class.forName("webapp.extention.resolver.DITAReferenceResolver").getClass().getName());

Code: Select all

Listening for transport dt_socket at address: 1043
09-Jun-2016 17:14:05.550 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.32
09-Jun-2016 17:14:05.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 2 2016 19:34:53 UTC
09-Jun-2016 17:14:05.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.32.0
09-Jun-2016 17:14:05.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
09-Jun-2016 17:14:05.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-22-generic
09-Jun-2016 17:14:05.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
09-Jun-2016 17:14:05.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-oracle/jre
09-Jun-2016 17:14:05.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_91-b14
09-Jun-2016 17:14:05.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
09-Jun-2016 17:14:05.554 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /home/konstantin/soft/tomcat8
09-Jun-2016 17:14:05.554 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /home/konstantin/soft/tomcat8
09-Jun-2016 17:14:05.554 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/home/konstantin/soft/tomcat8/conf/logging.properties
09-Jun-2016 17:14:05.554 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
09-Jun-2016 17:14:05.554 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n
09-Jun-2016 17:14:05.554 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/home/konstantin/soft/tomcat8/endorsed
09-Jun-2016 17:14:05.555 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/home/konstantin/soft/tomcat8
09-Jun-2016 17:14:05.555 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/home/konstantin/soft/tomcat8
09-Jun-2016 17:14:05.555 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/home/konstantin/soft/tomcat8/temp
09-Jun-2016 17:14:05.555 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
09-Jun-2016 17:14:05.839 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
09-Jun-2016 17:14:05.858 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Jun-2016 17:14:05.861 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
09-Jun-2016 17:14:05.863 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Jun-2016 17:14:05.863 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 896 ms
09-Jun-2016 17:14:05.917 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
09-Jun-2016 17:14:05.918 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32
09-Jun-2016 17:14:05.941 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/konstantin/soft/tomcat8/webapps/oxygen-editor.war
09-Jun-2016 17:14:10.982 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Initializing log4j with: file:/home/konstantin/soft/tomcat8/webapps/oxygen-editor/WEB-INF/log4j.properties
0 [localhost-startStop-1] INFO ro.sync.servlet.StartupServlet - Loading frameworks from folder: /home/konstantin/soft/tomcat8/work/Catalina/localhost/oxygen-editor/frameworks-v18.0.0
1032 [localhost-startStop-1] INFO ro.sync.servlet.StartupServlet - Loading plugins from: /home/konstantin/soft/tomcat8/work/Catalina/localhost/oxygen-editor/plugins-v18.0.0
1181 [localhost-startStop-1] WARN ro.sync.exml.plugin.PluginManager - Attribute "type" with value "AuthorStylesheet" must have a value from the list "selectionProcessor WebappServlet documentProcessor generalExtension URLStreamHandler URLHandler TargetedURLHandler URLChooser URLChooserToolbar componentsValidator OpenRedirect WorkspaceAccess LockHandlerFactory StylesFilter OptionPage RefactoringOperationsProvider AuthorCSS ".
1181 [localhost-startStop-1] WARN ro.sync.exml.plugin.PluginManager - Attribute "href" is not allowed to appear in element "extension".
1181 [localhost-startStop-1] WARN ro.sync.exml.plugin.PluginManager - Attribute "type" with value "WebappStaticResourcesFolder" must have a value from the list "selectionProcessor WebappServlet documentProcessor generalExtension URLStreamHandler URLHandler TargetedURLHandler URLChooser URLChooserToolbar componentsValidator OpenRedirect WorkspaceAccess LockHandlerFactory StylesFilter OptionPage RefactoringOperationsProvider AuthorCSS ".
1181 [localhost-startStop-1] WARN ro.sync.exml.plugin.PluginManager - Attribute "path" is not allowed to appear in element "extension".
1181 [localhost-startStop-1] WARN ro.sync.exml.plugin.PluginManager - Attribute "href" is not allowed to appear in element "extension".
1190 [localhost-startStop-1] WARN ro.sync.exml.plugin.PluginManager - Attribute "type" with value "AuthorStylesheet" must have a value from the list "selectionProcessor WebappServlet documentProcessor generalExtension URLStreamHandler URLHandler TargetedURLHandler URLChooser URLChooserToolbar componentsValidator OpenRedirect WorkspaceAccess LockHandlerFactory StylesFilter OptionPage RefactoringOperationsProvider AuthorCSS ".
1190 [localhost-startStop-1] WARN ro.sync.exml.plugin.PluginManager - Attribute "href" is not allowed to appear in element "extension".
java.lang.ClassNotFoundException: webapp.extention.resolver.DITAReferenceResolver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at ro.sync.util.db.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at webapp.customworkspace.CustomWorkspacePluginExtension.applicationStarted(CustomWorkspacePluginExtension.java:65)
at ro.sync.ecss.webapp.n.f(Unknown Source)
at ro.sync.ecss.webapp.n.b(Unknown Source)
at ro.sync.ecss.extensions.api.webapp.WebappAuthorDocumentFactory.setPlugins(Unknown Source)
at ro.sync.servlet.StartupServlet.loadPlugins(StartupServlet.java:196)
at ro.sync.servlet.StartupServlet.prepareWebappFactory(StartupServlet.java:145)
at ro.sync.servlet.StartupServlet.contextInitialized(StartupServlet.java:424)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
--workspace platform = WEBAPP
java.lang.ClassNotFoundException: webapp.extention.resolver.DITAReferenceResolver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at ro.sync.util.db.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at webapp.customworkspace.CustomWorkspacePluginExtension.applicationStarted(CustomWorkspacePluginExtension.java:65)
at ro.sync.ecss.webapp.n.f(Unknown Source)
at ro.sync.ecss.webapp.n.b(Unknown Source)
at ro.sync.ecss.extensions.api.webapp.WebappAuthorDocumentFactory.setPlugins(Unknown Source)
at ro.sync.servlet.StartupServlet.loadPlugins(StartupServlet.java:196)
at ro.sync.servlet.StartupServlet.prepareWebappFactory(StartupServlet.java:145)
at ro.sync.servlet.StartupServlet.contextInitialized(StartupServlet.java:424)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1812)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
--workspace platform = WEBAPP
1246 [localhost-startStop-1] INFO ro.sync.servlet.StartupServlet - oXygen XML WebApp initialized successfully.
09-Jun-2016 17:14:15.498 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/konstantin/soft/tomcat8/webapps/oxygen-editor.war has finished in 9,556 ms
09-Jun-2016 17:14:15.499 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/konstantin/soft/tomcat8/webapps/manager
09-Jun-2016 17:14:15.616 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/konstantin/soft/tomcat8/webapps/manager has finished in 117 ms
09-Jun-2016 17:14:15.616 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/konstantin/soft/tomcat8/webapps/examples
09-Jun-2016 17:14:16.548 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/konstantin/soft/tomcat8/webapps/examples has finished in 932 ms
09-Jun-2016 17:14:16.549 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/konstantin/soft/tomcat8/webapps/ROOT
09-Jun-2016 17:14:16.603 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/konstantin/soft/tomcat8/webapps/ROOT has finished in 54 ms
09-Jun-2016 17:14:16.603 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/konstantin/soft/tomcat8/webapps/docs
09-Jun-2016 17:14:16.652 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/konstantin/soft/tomcat8/webapps/docs has finished in 49 ms
09-Jun-2016 17:14:16.652 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/konstantin/soft/tomcat8/webapps/host-manager
09-Jun-2016 17:14:16.788 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/konstantin/soft/tomcat8/webapps/host-manager has finished in 135 ms
09-Jun-2016 17:14:16.799 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
09-Jun-2016 17:14:16.811 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
09-Jun-2016 17:14:16.813 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 10949 ms
129794 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129805 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129808 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129808 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129819 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129820 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129821 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129821 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129821 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129825 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129826 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129826 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129827 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129827 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129827 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129828 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129828 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129828 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129829 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129829 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129829 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129829 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129830 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129830 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129830 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129830 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129830 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129830 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129831 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129831 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129831 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
129831 [http-nio-8080-exec-6] WARN org.jboss.resteasy.jsapi.MethodMetaData - Overriding @Consumes annotation in favour of application/x-www-form-urlencoded due to the presence of @FormParam
opened
opened
opened
opened
opened
opened

Re: Webapp customReferencesResolver

Posted: Thu Jun 09, 2016 5:46 pm
by cristi_talau
Hello,

It seems that the .jar contains the ".java" file. It should contain the ".class" compiled file instead.

Please let us know if you still have problems.

Best,
Cristian

Re: Webapp customReferencesResolver

Posted: Fri Jun 10, 2016 10:22 am
by Konstantin
Thanks, It works

Re: Webapp customReferencesResolver

Posted: Tue Jun 14, 2016 12:19 pm
by Konstantin
Hi !!!
Reference resolving working right, but now I need make Image resolving
I do it thru cssStylesFilterExtension

I set my class to dita.framework

Code: Select all

<field name="cssStylesFilterExtension">
<String>webapp.extention.filter.DITAStylesFilter</String>
</field>
DITAStylesFilter:

Code: Select all


package webapp.extention.filter;

import ro.sync.ecss.extensions.api.StylesFilter;

public class DITAStylesFilter implements StylesFilter {

@Override
public Styles filter(Styles styles, AuthorNode authorNode) {
.......
final String nodeName = authorNode.getName();

// processing image element
if (IMAGE_TAG.equals(nodeName)) {
processImage(styles, authorNode);
return styles;
}

return styles;
}

public void processImage(Styles styles, AuthorNode authorNode) {
......
try {
styles.setProperty(Styles.KEY_MIXED_CONTENT, new StaticContent[] { new URIContent(baseUrl.toString(), request.toString()) });
//baseUrl = http://localhost:8888/
//request = repository_root?sourceDocPath=some/path&destDocPath=small_01.jpg&CacheTime=1465830254141

} catch (Exception e) {
e.printStackTrace();
}
}
}
As I understand after that Webbapp must send request by this URL (to my servlet)
http://localhost:8888/repository_root?s ... 5830254141

But it does not happen.
What I have to do to send request to servlet.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Also tag IMG created with
scr=../rest/v18.0.0/load/image-cached/framework/file/?/home/konstantin/soft/tomcat8/work/Catalina/localhost/oxygen-editor/frameworks-v18.0.0/dita/css/core/small_01.jpg

and search image inside
tomcat8/work/Catalina/localhost/oxygen-editor/frameworks-v18.0.0/dita/css/core/small_01.jpg
how can I change this path ?

Re: Webapp customReferencesResolver

Posted: Tue Jun 14, 2016 4:21 pm
by Gabriel Titerlea
Hi Konstantin,

There seems to be a bug at the moment and setting MIXED_CONTENT is not working. We have recorded the issue and it will be fixed in the next version.

As a workaround you will have to use custom css functions [1] and modify your frameworks CSS.
You might want to look at the oxy_url and oxy_base-uri functions.

Regards,
Gabriel


[1] - https://www.oxygenxml.com/doc/versions/ ... tions.html

Re: Webapp customReferencesResolver

Posted: Tue Jun 14, 2016 7:19 pm
by Konstantin
Ok, thanks !!!

Re: Webapp customReferencesResolver

Posted: Mon Jul 04, 2016 11:01 am
by Konstantin
Hello.
Could you say how can I set path to jar file which keep in plugin, something like:

Code: Select all

<field name="classpath">
<String-array>
<String>${framework}/dita.jar</String>
<String>${plugins}/ditaworks-workspace-access-1.0/lib/ditaworks-workspace-access-1.0.jar</String>
<String>${framework}/resources/</String>
<String>${framework}/i18n/</String>
<String>${framework}/reuse/</String>
<String>${framework}/styleguide/</String>
</String-array>
</field>
Cause of this.
I have context map resolving and I need keep some KeyDefinitionManager for each exemplar of editor (diferent editors on diferent tabs)

Code: Select all


public class WorkspacePluginExtension implements WorkspaceAccessPluginExtension {

@Override
public void applicationStarted(final StandalonePluginWorkspace workspace) {

WSEditorChangeListener wsEditorChangeListener = new WSEditorChangeListener(){

@Override
public void editorAboutToBeOpened(URL url) {

final String conKeys = Connection.sendAction(url, "getConKeys", null);
final DITAWorksKeyDefinitionManager keyDefManager = DITAWorksKeyDefinitionManager.createManager(conKeys, url);

final String editorUID = Util.getEditorUID(url.toString());
final EditorReference webappEditor = EditorReferenceManager.init(editorUID);
webappEditor.setKeyDefinitionManager(keyDefManager);
}
};

workspace.addEditorChangeListener(wsEditorChangeListener, PluginWorkspace.MAIN_EDITING_AREA);

}
I create KeyDefinitionManager when open editor in WorkspaceAccessPluginExtension
Then I try keep this KeyDefinitionManager in
static HashMap<MyEditorClass>
Then I need use these KeyDefinitionManager's in AuthorReferenceResolver

My problem in that I keep these classes WorkspaceAccessPluginExtension (crating and keeping Manager. Keep in plugin) and AuthorReferenceResolver(using Manager. Keep in my jar which I keep in framework: <String>${framework}/DITAReferenceResolver.jar</String>) in different jar files and they do not see each other and my EditorReferenceManager.

My solution is keep all class in one jar but I can't find how do it (specify path to AuthorReferenceResolver thru plugin)

Maybe you know another solution.

Re: Webapp customReferencesResolver

Posted: Mon Jul 04, 2016 3:57 pm
by Gabriel Titerlea
Hello,

You can add a parentClassLoaderID field to you .framework file. [1]
This will make both the framework and your plugin share the same class-loader. Thus allowing the classes to see each other.

Code: Select all


<field name="classpath">
<String-array>
<String>${framework}/dita.jar</String>
<String>${framework}/resources/</String>
<String>${framework}/i18n/</String>
<String>${framework}/reuse/</String>
<String>${framework}/styleguide/</String>
</String-array>
</field>
<field name="parentClassLoaderID">
<String>YOUR_PLUGIN_ID</String>
</field>
[1] - https://www.oxygenxml.com/doc/versions/ ... and-plugin


Regards,
Gabriel

Re: Webapp customReferencesResolver

Posted: Mon Jul 04, 2016 4:49 pm
by Konstantin
Thanks, it works.

Re: Webapp customReferencesResolver

Posted: Wed Sep 28, 2016 4:16 pm
by Konstantin
Gabriel Titerlea wrote:Hi Konstantin,

There seems to be a bug at the moment and setting MIXED_CONTENT is not working. We have recorded the issue and it will be fixed in the next version.

As a workaround you will have to use custom css functions [1] and modify your frameworks CSS.
You might want to look at the oxy_url and oxy_base-uri functions.

Regards,
Gabriel
Hi !!!
Could you say is this bug fixed ?
We already use Webapp 18.0.0.6 and it does not works.

We changed CSS to resolve images:

Code: Select all

image[href] {
content: oxy_url("", oxy_concat(oxy_base-uri(), "&destDocPath=", attr(href)));
}
but I can't resolve images from Conref, for this I need StyleFilter

Re: Webapp customReferencesResolver

Posted: Thu Sep 29, 2016 11:02 am
by Gabriel Titerlea
Konstantin wrote: Could you say is this bug fixed ?
We already use Webapp 18.0.0.6 and it does not works.
Hello,

I'm sorry for the confusion. The bug is fixed in the next version, meaning version 18.1.
Version 18.0.0.6 is a minor, maintenance, version.

The next sdk version (18.1) is scheduled for release around 17th October. If you want you can test the beta version of the release right now by following these steps:
  • - follow the "Creating a Startup Project Sample From Command Line" step from [http://www.oxygenxml.com/oxygen_sdk_maven.html]
    - change the value of the oxygen.sdk.version property in the pom.xml file of the main project from 18.0.x to 18.1-SNAPSHOT.
    - configure Maven to use oXygen SDK repository. You can do this by adding the following snippet pom.xml file in the <repositories> element:

Code: Select all

<repository>
<id>oxygenxml-beta</id>
<name>oXygen XML SDK Maven SNAPSHOT Repository</name>
<url>http://mirror.oxygenxml.com/maven/</url>
</repository>
  • - add the file with licensing details in /oxygen-sample-webapp/src/main/webapp/WEB-INF/license.properties.
Note: every time you want to get the SNAPSHOT version of the oXygen artifacts, you need to delete the com/oxygenxml/ folder in your local Maven repository.

Best,
Gabriel