Upgrade fontawesome from 4.7 to 5.13 in my XPages app, some questions - xpages

In my XPages application I want to upgrade the fontawesome version from 4.7 (current) to 5.13 (latest?)
So I added the resources and added to my themes design element:
<resource>
<content-type>text/css</content-type>
<href>font-awesome/5.13.0/css/solid.css</href>
</resource>
<resource>
<content-type>text/css</content-type>
<href>font-awesome/5.13.0/css/v4-shims.css</href>
</resource>
<resource>
<content-type>application/x-javascript</content-type>
<href>font-awesome/5.13.0/js/solid.js</href>
</resource>
<resource>
<content-type>application/x-javascript</content-type>
<href>font-awesome/5.13.0/js/v4-shims.js</href>
</resource>
I have not updated the font-references and when I reload a page oddly all current icons are displayed somehow "Italic", should that be the case?
I have also defined some css pseudo-elements e.g.:
label.required:after {
margin-left: 5px;
font-family: "FontAwesome";
content: "\f069";
color: #d9534f;
font-weight: normal;
font-size: 14px;
}
but here the asterix icon i no longer displayed. How should i handle this?
Finally (for this post) I get 2 errors in the console:
GET http://dev.acme.org/xsp/.ibmxspres/.extlib/responsive/dijit/dbootstrap-0.1.1/theme/dbootstrap/font/fontawesome-webfont.woff net::ERR_ABORTED 404 (Not Found)
http://dev.acme.org/xsp/.ibmxspres/.extlib/responsive/dijit/dbootstrap-0.1.1/theme/dbootstrap/font/fontawesome-webfont.ttf net::ERR_ABORTED 404 (Not Found)
What have I forgotten?
P.s. If I choose to use a kit instead of hosting the files myself the problem with the pseudo classes and the italic display do not occur. But I still have the 2 missing files errors

Update your css into:
label.required:after {
margin-left: 5px;
font-family: "Font Awesome 5 Free";
content: "\f069";
color: #d9534f;
font-weight: normal;
font-size: 14px;
}
Might solve your asterix issue?

What if you would load both versions?
<resource>
<content-type>text/css</content-type>
<href>font-awesome/4.7.0/css/font-awesome.css</href>
</resource>
<resource>
<content-type>text/css</content-type>
<href>font-awesome/5.13.0/css/solid.css</href>
</resource>
<resource>
<content-type>text/css</content-type>
<href>font-awesome/5.13.0/css/v4-shims.css</href>
</resource>
<resource>
<content-type>application/x-javascript</content-type>
<href>font-awesome/5.13.0/js/solid.js</href>
</resource>
<resource>
<content-type>application/x-javascript</content-type>
<href>font-awesome/5.13.0/js/v4-shims.js</href>
</resource>
fontawesome 5 does not use the fontawesome-webfont so it must be a reference in the theme you are using (bootstrap-flat?) if so try the bootstrap_blank option https://wiki.openntf.org/display/EXTLIB/How+to+use+the+Bootstrap3_blank.theme+in+XPages
it is previously discussed in this topic Why am I getting multipleDefine Error on my web Xpages but no real examples are given. good luck!

Try load the style sheet via the headtag example:
<xp:headTag tagName="link">
<xp:this.attributes>
<xp:parameter
name="rel"
value="stylesheet">
</xp:parameter>
<xp:parameter
name="type"
value="text/css">
</xp:parameter>
<xp:parameter
name="href"
value="font-awesome-5.13.0/css/all.css">
</xp:parameter>
</xp:this.attributes>
</xp:headTag>

Related

Maven - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project XXX: Fatal error compiling

I have looked for other solutions in similiar threads, but they did not help me. I am working with IntelliJ and want to deploy an app on Azure. Before my trials to add the azure dependencies, it worked all fine.
The problem was I had the wrong configuration of jdk in the XML.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<fork>true</fork>
<executable>C:\Program Files\Java\jdk-14.0.2\bin\javac.exe</executable>
<source>1.8</source>
<target>1.8</target>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
</plugin>
Before it was the jdk-8.x.x_XXX, which was never installed on my machine.

Maven: how to set thread count for testng

I'm using testng to run tests in parallel. Xml file contains thread-count parameter.
<suite name="Lalala" parallel="tests" thread-count="3" preserve-order="true">
But I want to set the thread-count value from POM file. I tried
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.3.1</version>
</dependency>
and
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<parallel>classes</parallel>
<threadCount>10</threadCount>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/${suite}.xml</suiteXmlFile>
</suiteXmlFiles>
<workingDirectory>target/</workingDirectory>
</configuration>
</plugin>
But thread count still equals 1
Is there some way to add thread-count from Pom file??
You may need to remove thread-count from your suite definition in your XML file as it will override any -threadcount parameter that Maven Surefire is passing to TestNG (see Command Line Parameters under Running TestNG).
From local testing it appears that threadCount and suiteXmlFiles aren't compatible and from the Maven Surefire Plugin documentation for suiteXmlFiles is states:
Note that suiteXmlFiles is incompatible with several other parameters of this plugin, like includes/excludes.
I believe that threadCount is another of the incompatible "other parameters".
Some of the same options available in TestNG XML files are also available when configuring the Maven Surefire Plugin so it looks like you will have to "port" your TestNG XML to Maven Surefire Plugin Configuration XML.
In my local testing I found that I could simply omit suiteXmlFiles and the plugin found and ran my tests with the specified threadCount. Depending on your TestNG XML your solution might take a bit more work.
I dont try to do this, but this configuration should work.
I'm not sure, but to use this you should use surefire plugin with version 2.19+. Also I recommend to not use surefire-specific element names in section (like <parallel>, <threadCount>, <groups> etc) when you use TestNG. The better choose is to use <properties> section with set of <property> values. Those values will be passed to testNG command line. Behavior for such properties are clearly described in TestNG documentation
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>2.19</version>
</dependency>
</dependencies>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>suites/my-suite.xml</suiteXmlFile>
</suiteXmlFiles>
<!-- DONT USE THIS
<parallel>methods</parallel>
<threadCount>5</threadCount>
-->
<properties>
<property>
<name>parallel</name>
<value>methods</value>
</property>
<property>
<name>threadcount</name>
<value>5</value>
</property>
<property>
<name>dataproviderthreadcount</name>
<value>3</value>
</property>
</properties>
</plugin>

Using maven jaxb2 plugin, modular compilation using episode and catalog throws Malformed URL error

My project contains A.xsd which imports schema as follows from B.xsd which is part of another project:
<xsd:import namespace="http://com.test.schema/common/Context" schemaLocation="http://com.test.schema/common/Context/B.xsd"/>
I am trying to use the episode from the project which contains B.xsd so that classes related to B.xsd do not get re-generated when A.xsd is parsed. So I referred this and this to come up with the following configuration:
Here is the pom.xml
<dependencies>
<dependency>
<groupId>com.bar.foo</groupId>
<artifactId>schema-b</artifactId>
<version>1.2</version>
</dependency>
<dependencies>
.
.
.
.
.
<build>
<plugins>
<dependency>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.13.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<extension>true</extension>
<episodes>
<episode>
<groupId>com.bar.foo</groupId>
<artifactId>schema-b</artifactId>
</episode>
</episodes>
<catalog>src/main/resources/catalog.cat</catalog>
<schemas>
<schema>
<fileset>
<directory>${basedir}/src/main/schemas</directory>
<includes>
<include>A.xsd</include>
<include>...</include>
<include>...</include>
</includes>
</fileset>
</schema>
</schemas>
<bindingDirectory>${basedir}/src/main/schemas</bindingDirectory>
<bindingIncludes>
<include>*.xjb</include>
</bindingIncludes>
<args>
<arg>-Xannotate</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.6.0</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>0.6.0</version>
</plugin>
</plugins>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Here is the catalog file:
PUBLIC "http://com.test.schema/common/Context" "maven:com.bar.foo:schema-a:jar::1.2!"
There is some configuration in the xjb file to make sure that XmlRootElement is written into some generated classes:
<jxb:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
jxb:version="2.1" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:annox="http://annox.dev.java.net" extensionBindingPrefixes="xjc">
<jxb:globalBindings>
<xjc:simple />
</jxb:globalBindings>
<jxb:bindings
schemaLocation="A.xsd">
<jxb:bindings node="//xsd:complexType[#name='ADataType']">
<jxb:class name="AData" />
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="AData" />
</annox:annotate>
</jxb:bindings>
</jxb:bindings>
Inspite of providing the episode to the xjc execution and the location of the schema for B.xsd in the catalog file, the classes for B.xsd is getting generated.
The issue is that the maven artifact referred to by the catalog file is not being picked up. I see the following error in the maven build logs:
Malformed URL on system identifier: maven:com.bar.foo:schema-b:jar::1.2!
PUBLIC: http://com.test.schema/common/Context
maven:com.bar.foo:schema-a:jar::1.2!
Can anyone help tell me why am I hitting this malformed URL error for the artifact that contains B.xsd? Any help will be really appreciated.
Disclaimer: I'm the author of the maven-jaxb2-plugin.
First, you're probably mixing A and B here. You're saying A imports B but then you're using the schema-a artifact as episode. If B is imported, you should use schema-b as episode to not regenerate B stuff when compiling A.
But I think this is probably just a minor mistake in the question.
You have two aspects here - episodes and catalogs.
Episodes allow you to skip generation of classes you've generated somewhere else already. So if you use schema-b artifact when compiling schema-a then XJC should not generate classes for schema-b. You don't need catalogs for that, it's independent.
Sometimes XJC still generates few leftovers - even if you use an episode. I often get ObjectFactory and maybe some enums or top-level-elements generated. I believe this is an issue in XJC, there's nothing I can do in the maven-jaxb2-plugin about it.
So as a workaround I just use maven-antrun-plugin to delete unnecessary generated things.
If you get all of the B stuff generated then you should check if schema-b artifact really have the episode file generated. Check if you have META-INF/sun-jaxb.episode inside the JAR. See this answer for some trivia on the episode file.
So if you correctly configure the correct episode artifact you should not get B things generated, you don't need catalogs for this.
What you need the catalog for is to avoid downloading http://com.test.schema/common/Context/B.xsd when compiling. You can use catalogs to point to anothe location. I think your problem here is that you refer http://com.test.schema/common/Context to maven:com.bar.foo:schema-a:jar::1.2! which obviously does not point to the schema resource.
If you have an import like
<xsd:import namespace="http://com.test.schema/common/Context" schemaLocation="http://com.test.schema/common/Context/B.xsd"/>
Then you should probably rewrite it as follows:
PUBLIC "http://com.test.schema/common/Context" "maven:com.bar.foo:schema-b:jar::1.2!/common/Context/B.xsd"
Assuming schema-b artifact contains your schema under /common/Context/B.xsd. Note that it maps namespace, not schema location.
You can also use REWRITE_SYSTEM to rewrite schema location. For example:
REWRITE_SYSTEM "http://com.test.schema" "maven:com.bar.foo:schema-b:jar::1.2!"
If you have an URL like http://com.test.schema/common/Context/B.xsd, it will be rewritten to maven:com.bar.foo:schema-b:jar::1.2!/common/Context/B.xsd. This will point to the resource /common/Context/B.xsd inside your schema-b JAR.
Another hint - if you use schema-b as dependency in your project, you can omit the version.
Here's an example of catalog from a real world project:
https://github.com/highsource/ogc-schemas/blob/master/schemas/src/main/resources/ogc/catalog.cat
It contains rewrites like:
REWRITE_SYSTEM "http://schemas.opengis.net" "maven:org.jvnet.ogc:ogc-schemas:jar::!/ogc"

GWT compiler behaves differently in Linux and Windows

We have a GWT application. Using Maven 3 we build and run the GWT application.
The application runs fine when we build and run on Windows 7 and test on IE on Windows. However, when we compile and run the application on Linux and then test on IE on Windows, the application looks differently.
To rule out client problems: we test on exactly the same client - Internet Explorer on Windows 7.
Further investigation revealed the Javascript on the Linux-server is differently from the Javascript on the Windows-server.
Does anyone know why GWT behaves differently on Linux and Windows? What can we do have GWT behave the same on both Windows and Linux.
We use Maven 3 to compile and run gwt.
Here's the plugin configuration of GWT:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>MyApplication.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>nl.my.app.client.Messages</i18nMessagesBundle>
<inplace>true</inplace>
</configuration>
</plugin>
and here's the module configuration:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to=&apos;MyApplication&apos;>
<inherits name=&apos;com.google.gwt.user.User&apos; />
<inherits name="com.google.gwt.i18n.I18N" />
<inherits name=&apos;nl.my.module&apos; />
<inherits name="com.sencha.gxt.ui.GXT" />
<inherits name="com.google.common.collect.Collect" />
<inherits name=&apos;com.google.gwt.user.Debug&apos; />
<inherits name=&apos;nl.my.othermodule&apos; />
<entry-point class=&apos;nl.my.MYApplication&apos; />
<source path=&apos;client&apos; />
<source path=&apos;shared&apos; />
<set-configuration-property name="UiBinder.useSafeHtmlTemplates" value="true" />
<extend-property name="locale" values="nl_NL" />
</module>
The application is build and run using the following command:
mvn gwt:run
You probably have different JDKs on the two different systems. Ensure the JDK being used by maven is the same.
We found the problem - compatibility mode: as stated in the question the problem only occurred in Internet Explorer (IE). The compatibility mode of IE was enabled automatically when we'd access the application via a non-local address. In compatibility mode IE behaves slightly different. That's why, when we did access the application via localhost - on our development workstation - compatibility mode was not enabled by IE and the application looked like it should.
Problem was solved by adding the following in the head section of the application's single html file:
<meta http-equiv="X-UA-Compatible" content="IE=edge" >

appassembler maven plugin doesn't set "execute" permissions on generated script

The AppAssembler Maven plugin does a great job of generating distribution for me. One last problem is that the generated Shell script does not have execution permissions so I need to set them manually.
I am on Linux RedHat
Does anybody know of a clean way to set them automatically?
The only way to do this is to process the file with another maven plugin like Antrun or Assembly after running AppAssembler.
This issue (see link below) has been brought up on the AppAssembler project issue tracker and it was rejected as Won't Fix.
Issue: MAPPASM-54
I think it can be set in your assembly.xml, in the fileSet tag:
<fileSets>
<fileSet>
<directory>src/resources/bin</directory>
<lineEnding>keep</lineEnding>
<useDefaultExcludes>true</useDefaultExcludes>
<outputDirectory>bin</outputDirectory>
<includes>
<include>*.bat</include>
<include>*.sh</include>
</includes>
<fileMode>744</fileMode>
</fileSet>
...
Since Maven 3.0.3 all plugins are executed in the order they are in your pom.xml. So setting the executeable flag in a platform independet manner is as easy as using the maven-enforcer-plugin right after your appassembler plugin.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce-beanshell</id>
<phase>package</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<evaluateBeanshell>
<condition>
import java.io.File;
print("set executable for file ${basedir}/dist/bin/mql");
new File("${basedir}/dist/bin/mql").setExecutable(true,false);
true;
</condition>
</evaluateBeanshell>
</rules>
<fail>false</fail>
</configuration>
</execution>
</executions>
</plugin>

Resources