JCR Node imported as nt:file when using content-package-maven-plugin - aem

I created an OSGI config JCR node in XML within my Adobe CQ project under /apps/myproject/config/org.apache.sling.commons.log.LogManager.factory.config-MYPROJECT.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
org.apache.sling.commons.log.level="Trace"
org.apache.sling.commons.log.file="logs/myproject.log"
org.apache.sling.commons.log.file.number="5"
org.apache.sling.commons.log.file.size="5MB"
org.apache.sling.commons.log.pattern="\{0,date,HH:mm:ss.SSS} *{4}* {3} {5}"
org.apache.sling.commons.log.names="[com.mycompany.myproject]" />
Problem is that when it gets imported into the JCR, it is showing up as an nt:file instead of what it should be according to its jcr:primaryType so that it look like this in CRXDE
when it should look like this

So my XML markup starts EXACTLY as follows:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
...
What I had done originally was to create a new xml file and put in my config. There are 2 other ways I know to create nodes
By doing it in CRXDE and then using vault to export
By doing it in Eclipse using the AEM developer tools (Eclipse plugin for Apache Sling)
In the case of a vault export, the XML starts like this:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" ...
and in the case of the plugin, it starts like this
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
...
but wait, you can't see it here, the plugin actually adds a friggin blank space right after jcr:root.
So whatever XML parser is acting on these XML files to create nodes in the JRC, it behaves oddly if there is no space right after the root node name. I'm on Windows, using Maven 3.2.3, using version 0.0.20 of content-package-maven-plugin, and AEM 5.6.1.

Please check your filter definition of the content-package-maven-plugin. If your filter root is set to
<filter>
<root>
/apps/myproject/config/org.apache.sling.commons.log.LogManager.factory.config-MYPROJECT.xml
</root>
</filter>
instead of
<filter>
<root>
/apps/myproject/config/org.apache.sling.commons.log.LogManager.factory.config-MYPROJECT
</root>
</filter>
then it will likely just put the file into your repository instead of creating the configuration node.
The latter one without .xml file extension is correct.

You need to add jcr:mixinTypes="[]" type as a property to your logger. So Your configuration will be like :
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:mixinTypes="[]"
jcr:primaryType="sling:OsgiConfig"
org.apache.sling.commons.log.level="Trace"
org.apache.sling.commons.log.file="logs/myproject.log"
org.apache.sling.commons.log.file.number="5"
org.apache.sling.commons.log.file.size="5MB"
org.apache.sling.commons.log.pattern="\{0,date,HH:mm:ss.SSS} *{4}* {3} {5}"
org.apache.sling.commons.log.names="[com.mycompany.myproject]" />
Hope this will help.

Related

In dita-ot is it possible to integrate into a feature extension for a specific transtype only?

Specifically, I have a custom dita-ot xhtml plugin which uses the <feature extension="dita.xsl.xhtml" file="xsl/header.xsl"/> to integrate into the xhtml pipeline. But this extension is used by the default xhtml output as well. I don't want this. Is there a way to run my extensions only for my own plugin?
A small example (brandheader example from the dita-ot documentation) which demonstrates the described behavior:
plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<plugin id="com.example.brandheader">
<feature extension="ant.import" file="build.xml" />
<feature extension="dita.xsl.xhtml" file="xsl/header.xsl"/>
<transtype name="xhtml-extension" />
</plugin>
build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="com.example.xhtml.extension" basedir=".">
<target name="dita2xhtml-extension" depends="dita2xhtml"/>
</project>
header.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="gen-user-header">
<div>
<img src="https://www.dita-ot.org/images/dita-ot-logo.svg" alt="Example Company Banner"/>
</div>
</xsl:template>
</xsl:stylesheet>
The customized header appears for the xhtml transtype as well as for the xhtml-extension transtype.
I searched on stackoverflow for a similar question and I read the dita-ot developer documentation. But I couldn't find an option to enable the extension only for my plugin.
I am happy about any input.
Another option is to override the main XSLT used for processing in your custom XHTML plugin's build file:
<target name="dita2xhtml-custom"
depends="dita2xhtml-custom.init,
dita2xhtml"/>
<target name="dita2xhtml-custom.init">
<property name="args.xsl"
location="${dita.plugin.com.example.xhtml-custom.dir}/custom-main.xsl"/>
</target>
and your custom-main.xsl would import the xhtml XSLT stylesheet like:
<xsl:import href="plugin:org.dita.xhtml:xsl/dita2xhtml.xsl"/>
and add your own templates to the custom-main.xsl to override templates in the dita2xhtml.xsl.
Your "header.xsl" XSLT stylesheet will indeed be taken into account for any transformation type extended from the base XHTML one.
But what you could do would be to define in your plugin.xml an extension point with the name dita.conductor.xhtml.param:
https://www.dita-ot.org/dev/extension-points/all-extension-points.html#all-extension-points__dita.conductor.xhtml.param
Something like this:
<feature extension="dita.conductor.xhtml.param" value="params.xml" type="file"/>
and the params.xml file could contain:
Then in your XSLT stylesheet you define a global xsl:param named "TRANSTYPE" and you should receive on it the value of the transtype from the DITA OT build files, making it possible to take decisions in the custom XSLT templates based on the current transformation type.

Neo4j plugin missing in Gephi 0.9.1 version

I am pretty new to neo4j. In my graph, there are more than 5k nodes and neo4j browser doesnt show all the nodes, as there seems to be a limit and picture is messy as well.
So i was trying to gephi 0.9 and installed the same.
But I am unable to find the neo4j database plugin. I checked under
Tools --> plugins --> available plugins section
Please let me know, if I am missing something here.
Plugin screenshot
Thanks in advance.
You don't actually need the Neo4j plugin for Gephi, as you can use neo4j-shell-tools instead to do a GraphML export, and open that in Gephi.
Beware that the option parsing of export-graphml is a bit buggy (and I should open an issue about it); if you want to use the -t or -r flags, they have to be specified before -o, like this:
export-graphml -r -o out.graphml match ...
I also had to add some metadata description to the GraphML file so Gephi finds more data (and I should also open an issue about that, at least for the generic metadata). The beginning of the file looks like
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph id="G" edgedefault="directed">
which I changed to
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key attr.name="label" attr.type="string" for="node" id="labels"/>
<key attr.name="label" attr.type="string" for="edge" id="label"/>
<key attr.name="someProperty" attr.type="boolean" for="node" id="someProperty"/>
<!-- more descriptions of node properties -->
<graph id="G" edgedefault="directed">

cvc-complex-type.3.2.2: Attribute 'jaxb:extensionBindingPrefixes' is not allowed to appear in element 'jaxb:bindings'

I've checkoud one project... and trying solve some problems in Eclipse Luna 4.4.0. In one of the maven project I have following xjb file:
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings
version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
jaxb:extensionBindingPrefixes="xjc"
xmlns:xjc= "http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xsi:schemaLocation="
http://java.sun.com/xml/ns/jaxb
http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd
">
...
...
but Eclipse reporting me Problem >
cvc-complex-type.3.2.2: Attribute 'jaxb:extensionBindingPrefixes' is not allowed to appear in element 'jaxb:bindings'
does anybody know why?
The bindingschema_2_0.xsd seems to be inadequate. It declares the extensionBindingPrefixes attribute, but does not to use it in the global bindings element.
The use of jaxb:extensionBindingPrefixes attribute in the code you posted looks correct to me.
Me personaly, I have never used used xsi:location in binding files. You can safely remove it.

Alfresco activiti workflow deploy

I have a bit of a problem.
I have created a workflow with the Activiti plugin in Eclipse.
I have a model, context file and the bpmn20.xml file.
Everything is deployed in shared/alfresco/extension but:
If I deploy the workflow deleting the entire following tag in the bpmn20.xml file
<bpmndi:BPMNDiagram id="BPMNDiagram_activitiCustomWorkflow">
(so basically without the workflow diagram), everything works fine but I can't see the workflow diagram in the Workflow details page in Alfresco Share .
If I leave that tag (so what Eclipse created in the beginning with the Activiti project),
Alfresco is not starting. (Connection rejected in browser)
Log is not telling me nothing, and Tomcat cannot be stopped normally (I have to delete the catalina.pid and the tomcat temp folder manually).
My bpmn20.xml file header is:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://activiti.org/bpmn20">
Am I missing something? Or maybe Eclipse doesn't create the correct bpmn file?
Ah, Alfresco 4.0.d and Ubuntu server 10.04 LTS x64
I am using Activiti engine, and the jBPM engine is turned off.
Thanks in advance.
You might need to turn up the logging in webapps/alfresco/WEB-INF/classes/log4j.properties.
log4j.logger.org.alfresco.repo.workflow=debug
I've also got that set in webapps/share/WEB-INF/classes/log4j.properties
my Eclipse (activity designer) generates header like this
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="Onlio">
<process id="OnlioWFAdhocMultiNonEsc" name="WF name/description" isExecutable="true">
But I've had also a problem with that, so I'm using this (and this works for me :) ), so you can try it ..
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://alfresco.org">
<process id="WFID" name="WF name/description" isExecutable="true">
(there's different in targetNameSpace only)
So, good luck :)
Btw for deploy you will need a context file or workflow console :) (there should be also way how to deploy through data dictionary- I'm not sure how :) )
OT btw2 - for logging I'm setting these 2 params:
(in ..\tomcat\webapps\alfresco\WEB-INF\classes\log4j.properties)
log4j.logger.org.alfresco.repo.jscript=debug
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug

adding a new namespace declaration to a spring config using Spring IDE

I have a Spring configuration file spring-idol.xml with the following namespace declaration:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
....
</beans>
I want to add the namespace declaration for AOP
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
...
</beans>
Is there a way to do it using Spring IDE? Right now, the only way I can think of is by making a new spring configuration file with the aop namespace declaration and then copy and pasting the declaration from there to the configuration file where my beans are.
Open with -> Spring Config Editor provides you with a tabbed view. One of the tabs is the namespaces tab, where you can add additional namespaces. There you can choose versioned or non-versioned schema files for aop, context, util, batch etc
btw. if you want to add non-spring namespaces (e.g. for apache cxf) use Open with -> XML Editor and do edit namespaces on the root element