How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
shreya
Posts: 29
Joined: Mon Jun 27, 2022 9:09 pm

How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by shreya »

Hi,
I want to edit the "Insert Special Characters" action dialog in the toolbar. I understand that it is coming from the plugin UTF-8 Char Picker v24.1. I just want to know that how can I access the code of that plugin to make certain changes to the dialog to use it in my toolbar? Kindly let me know if there is any way to do that.
Below are the action dialog box and the plugin I'm referring to:
tempsnip.png
tempsnip.png (158.52 KiB) Viewed 1656 times
admin_page.PNG
admin_page.PNG (51.81 KiB) Viewed 1656 times
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by cristi_talau »

Hello,

The source code of the plugin is available here: https://github.com/oxygenxml/web-author ... ker-plugin . The build might use some tools that are not public.

We are also open to feature requests for this plugin. So, if you want a feature that we think might benefit more users, we may implement it ourselves. So, it would be great if you want to share your use-case.

Best,
Cristian
shreya
Posts: 29
Joined: Mon Jun 27, 2022 9:09 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by shreya »

Hi,
I am trying to build the plugin but I keep getting the following error:
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack (wa-war-js) on project web-author-charpicker-plugin: Unable to find artifact. com.oxygenxml:oxygen-webapp:jar:24.1.0.1 was not found in http://www.oxygenxml.com/maven during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of public has elapsed or updates are forced

Is there any way to fix the issue?

I have also made some changes to the pom.xml to fix some errors I was getting. Here is the pom.xml.

Code: Select all

<?xml version="1.0"?>
<project
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>custom</groupId>
  <version>24.1.0.1</version>
  <artifactId>web-author-charpicker-plugin</artifactId>
  <name>Web Author Charpicker Plugin</name>
  <description>A plugin for oXygen XML Web Author that adds support for inserting special UTF-8 characters</description>

  <licenses>
    <license>
      <url>http://www.oxygenxml.com/sdk_agreement.html</url>
    </license>
  </licenses>
  
  <developers>
    <developer>
      <name>Andrei Popa</name>
      <email>andrei_popa@sync.ro</email>
      <roles>
        <role>manager</role>
      </roles>
    </developer>
  </developers>

  <properties>
    <sonar.sources>src/main/java,web,resources</sonar.sources>
    <sonar.exclusions>resources/closure-library/**</sonar.exclusions>
  </properties>
  
  <repositories>
    <repository>
      <id>public</id>
      <name>oXygen public artifacts</name>
      <url>http://www.oxygenxml.com/maven</url>
    </repository>
  </repositories>
  
  <dependencies>
    <dependency>
      <groupId>com.oxygenxml</groupId>
      <artifactId>oxygen-webapp</artifactId>
      <classifier>classes</classifier>
      <version>24.1.0.1</version>
      <scope>provided</scope>
    </dependency>
     <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.22</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.9.1</version>
        <configuration>
          <nodeVersion>v10.16.3</nodeVersion>
          <npmVersion>6.9.0</npmVersion>
          <nodeDownloadRoot>${node.download.root}</nodeDownloadRoot>
          <npmDownloadRoot>${npm.download.root}</npmDownloadRoot>
          <installDirectory>target</installDirectory>
        </configuration>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <phase>generate-resources</phase>
          </execution>
          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>generate-resources</phase>
          </execution>
          <execution>
            <id>gulp build</id>
            <goals>
              <goal>gulp</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
              <arguments>prepare-package</arguments>
            </configuration>
          </execution>
          <execution>
            <id>tests</id>
            <goals>
              <goal>karma</goal>
            </goals>
            <configuration>
              <karmaConfPath>web-tests/karma.conf.js</karmaConfPath>
            </configuration>
          </execution> 
        </executions>
      </plugin>
       <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/lib</outputDirectory>
              <includeScope>runtime</includeScope>
            </configuration>
          </execution>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <id>wa-war-js</id>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.oxygenxml</groupId>
                  <artifactId>oxygen-webapp</artifactId>
                  <version>24.1.0.1</version>
                  <type>jar</type>
                  <outputDirectory>${project.build.directory}/war/</outputDirectory>
                  <includes>app/**/*.js</includes>
                  <excludes>app/text-page-*.js,app/admin-custom-*.js</excludes><!-- TODO -->
                  <overWrite>true</overWrite>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <archiveBaseDirectory>${project.basedir}</archiveBaseDirectory>
              <descriptors>
                <descriptor>assembly.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
Last edited by shreya on Sat Sep 17, 2022 1:12 am, edited 1 time in total.
shreya
Posts: 29
Joined: Mon Jun 27, 2022 9:09 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by shreya »

Hi, can anyone help with the issue I mentioned?
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by cristi_talau »

Hello,
The error you received was in a step that was required for running JS tests. I deleted that step and made a couple of other fixes. This pom.xml file seems to work:

Code: Select all

<?xml version="1.0"?>
<project
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>custom</groupId>
  <version>24.1.0.1</version>
  <artifactId>web-author-charpicker-plugin</artifactId>
  <name>Web Author Charpicker Plugin</name>
  <description>A plugin for oXygen XML Web Author that adds support for inserting special UTF-8 characters</description>

  <licenses>
    <license>
      <url>http://www.oxygenxml.com/sdk_agreement.html</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Andrei Popa</name>
      <email>andrei_popa@sync.ro</email>
      <roles>
        <role>manager</role>
      </roles>
    </developer>
  </developers>

  <properties>
    <sonar.sources>src/main/java,web,resources</sonar.sources>
    <sonar.exclusions>resources/closure-library/**</sonar.exclusions>
             <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <repositories>
    <repository>
      <id>public</id>
      <name>oXygen public artifacts</name>
      <url>http://www.oxygenxml.com/maven</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>com.oxygenxml</groupId>
      <artifactId>oxygen-sdk</artifactId>
      <version>24.1.0.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.oxygenxml</groupId>
      <artifactId>oxygen-webapp</artifactId>
      <classifier>classes</classifier>
      <version>24.1.0.1</version>
      <scope>provided</scope>
    </dependency>
     <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.22</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.9.1</version>
        <configuration>
          <nodeVersion>v10.16.3</nodeVersion>
          <npmVersion>6.9.0</npmVersion>
          <nodeDownloadRoot>${node.download.root}</nodeDownloadRoot>
          <npmDownloadRoot>${npm.download.root}</npmDownloadRoot>
          <installDirectory>target</installDirectory>
        </configuration>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <phase>generate-resources</phase>
          </execution>
          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>generate-resources</phase>
          </execution>
          <execution>
            <id>gulp build</id>
            <goals>
              <goal>gulp</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
              <arguments>prepare-package</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
       <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/lib</outputDirectory>
              <includeScope>runtime</includeScope>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <archiveBaseDirectory>${project.basedir}</archiveBaseDirectory>
              <descriptors>
                <descriptor>assembly.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
Best,
Cristian
shreya
Posts: 29
Joined: Mon Jun 27, 2022 9:09 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by shreya »

Hi, I am trying to include the Char Picker code from the mentioned github link in my project so that I can run it from local to make some changes there but I am facing a lot of errors so I am not able to run it properly. Currently I am facing this following attatched error in the browser.

Image

PluginsOptions doesn't have the values it's trying to fetch in the code like: sync.options.PluginsOptions.getClientOption('charp.remove_categories'); or sync.options.PluginsOptions.getClientOption('charp.recently.used.characters').

How should I proceed?
Attachments
Screenshot (35).png
Screenshot (35).png (228.31 KiB) Viewed 1353 times
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by cristi_talau »

Hello,

The PluginOptions.getClientOption() API is used to read options configured in the Administration Page (or the defaults for those options).
This error happens probably because you did not configure these settings to appear in the Admin Page [1].

I would recommend that instead of copying code from this plugin inside yours, to make a fork of this plugin and make changes to adapt it for your requirements.

Best,
Cristian
[1] https://github.com/oxygenxml/web-author ... in.xml#L20
shreya
Posts: 29
Joined: Mon Jun 27, 2022 9:09 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by shreya »

Hi,
I am trying to build the charpicker plugin separately as a different plugin and upload it but it is giving a license issue. And even if I agree nothing is happening. Is it possible to upload it so I can make some changes to it separately?

This is the license issue I'm getting:

Image
Attachments
Capture12.PNG
Capture12.PNG (177.04 KiB) Viewed 1277 times
Bogdan Dumitru
Site Admin
Posts: 142
Joined: Tue Mar 20, 2018 5:28 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by Bogdan Dumitru »

Hello Shreya,

So the problem is that you click "Apply" but nothing happens and the dialog is still presented, right?
If yes, could you please share the plugin with us so that we can reproduce the problem and find a solution? You can send it via the form from here: https://www.oxygenxml.com/techSupport.html
Bogdan Dumitru
http://www.oxygenxml.com
shreya
Posts: 29
Joined: Mon Jun 27, 2022 9:09 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by shreya »

Hi,

I am able to resolve the previous issue. I want to know that while making changes if I want to GET all the symbols and display at the same time, what is the api that I should call? Also if I want to add some new symbols how should I do that?
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by cristi_talau »

Hello,

I understand you want to display all the Unicode chars in one view such that the user can choose from them. Unfortunately this is not how the plugin was designed to work. It is based on a widget from Google Closure library. You may be able to modify it to add this functionality, but I do not have a specific advice for you.

Regarding your second request about adding new symbols, do you want to add them to "quick insert" table, or in one of the categories that appear when you choose "More symbols..."?

Best,
Cristian
shreya
Posts: 29
Joined: Mon Jun 27, 2022 9:09 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by shreya »

I want to add in the categories. Can i add my own set of categories and sub sets under that? Is there any way to customise?
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to configure or update some changes to UTF-8 Char Picker v24.1 plugin?

Post by cristi_talau »

Hello,

First of all, if you can share what chars you want to add, and if it makes sense to add them by default, we can add them in the official plugin and leave you will less differences in your fork.

To add a new category, you can add the following lines in the resources/main.js file (https://github.com/oxygenxml/web-author ... ain.js#L42):

Code: Select all

var charPickerData = new goog.i18n.CharPickerData();

// Add a custom category.
var charList = [
 ["\u20ac", "\u00a3", "\u00a5", "\u00a2", "\u00a9", "\u00ae", "\u2122", "\u03b1", "\u03b2", "\u03c0", "\u03bc"],
 ["\u03a3", "\u03a9", "\u2264", "\u2265", "\u2260", "\u221e", "\u00b1", "\u00f7", "\u00d7", "\u21d2"]
];
charPickerData = addCategory(charPickerData, 'custom category', ['subcategory one', 'subcategory two'], charList, 5);
...
Best,
Cristian
Post Reply