Define file type for .env files - netbeans

As far as I know NetBeans IDE does not support or have a plugin that supports .env files (typically used to implement Store config in the environment) but I've found that Ini files support is good enough for my use case (I get syntax highlighting and Toggle Comment command. However, I'm unable to set the file type for a file that starts with a dot. I works fine for foo.env but not .env (it's handled as plain text).
I found a related question (how to set file type for foo.blade.php) and I'm able to bypass the GUI restriction (you cannot enter a file extension with a dot) with a custom user-defined-mime-resolver.xml file. I've tried two variations:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.1//EN" "http://www.netbeans.org/dtds/mime-resolver-1_1.dtd">
<MIME-resolver>
<file>
<ext name=".env"/>
<ext name="env"/>
<resolver mime="text/x-ini"/>
</file>
</MIME-resolver>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.1//EN" "http://www.netbeans.org/dtds/mime-resolver-1_1.dtd">
<MIME-resolver>
<file>
<ext name="env"/>
<name name=".env" substring="true"/>
<resolver mime="text/x-ini"/>
</file>
</MIME-resolver>
Can you figure out a trick or workaround or spot something I've missed? (Im using build NetBeans IDE Dev Build 201804200002 if that matters.)

Related

VSCode resolve variable cannot be resolved error in editor for *.xsl

I am using VSCode application to develop *.xsl files.
I am using an *.xsl file holding global variables which I use accross the project and include it in other files. However these parameters/variables are highlighted by VSCode as missing reference when imported indirectly only at runtime.
Can this be resolved in VSCode editor to include other files in a project setup when looking for references?
Example:
fileA
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:include href="./fileB.xsl"/>
<xsl:include href="./fileC.xsl"/>
<xsl:variable name="varA">Variable directly defined in file A</xsl:variable>
<xsl:value-of select="$varA"/> <!-- directly available -->
<xsl:value-of select="$varB"/> <!-- include works at runtime at in UI -->
<xsl:value-of select="$varC"/> <!-- include works at runtime at in UI -->
</xsl:stylesheet>
fileB
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:variable name="varB">Variable defined in other file B</xsl:variable>
<xsl:value-of select="$varB"/> <!-- directly available -->
<xsl:value-of select="$varC"/> <!-- include works at runtime, but error in UI -->
</xsl:stylesheet>
fileC
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:variable name="varC">Variable defined in other file C</xsl:variable>
<xsl:value-of select="$varC"/> <!-- directly available -->
</xsl:stylesheet>
sub/fileD
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:variable name="varD">Variable defined in other file D in sub dir</xsl:variable>
<xsl:value-of select="$varD"/> <!-- directly available -->
</xsl:stylesheet>
fileA
defines varA
includes files B and C
does not include file D
can resolve own variable varA and the ones from included files varB and varC at runtime and in UI
fileB
defines varB
can resolve own variable varB
does not include file C (explicitly)
can resolve varC at runtime since included by fileA, but not in UI (warning)
fileC
defines varC
can resolve own variable varC
sub/fileC
defines varD
can resolve own variable varD
So fileA includes files B+C and can resolve all variables at runtime and without warning in UI. The sub/fileD is not included directly, but can be found in sub-directory, hence UI warns about "XPath: The variable/parameter ... cannot be resolved here, but it may be defined in an external module"
FileB tries to resolve varC, but does no include fileC. At runtime it is resolved by fileA including fileB and fileC, so no error at runtime. UI however cannot find varC and flags it as "XPath: The variable/parameter $varA cannot be resolved"
You might be asking why not simply include fileC in fileB to resolve it!? Reason is, that I am supporting different languages. Hence the root *.xsl file imports different files, depending on the langugage settings. Each langugage *.xsl defines the same variables in the given langugage. The templates use the common variables to display texts in the given language. Hence I rely on the root import at runtime.
Can I tell the UI somehow, that these variables exist, even though the file is no included? Like adding it to a project setup or such?
Here I'm assuming you're using DeltaXML's XSLT/XPath extension for VSCode (which I maintain):
In your examples, fileA.xsl and fileB.xsl and fileC.xsl are the only files (XSLT modules) that reference externally defined variables. So we can safely ignore sub/fileD.xsl.
The current behaviour:
If you open fileB.xsl first:
the references to $varB and $varC are not resolved because it's defined in fileA.xsl
If you open fileA.xsl first:
the external references to $varB and $varC are resolved because the xsl:include instructions cause VSCode to load all symbols defined in fileB.xsl and fileC.xsl
If you open fileB.xsl after opening fileA.xsl:
the external references to $varB and $varC are resolved - the information that fileB.xsl and fileC.xsl are included by fileA.xsl was stored when you opened fileA.xsl
The Answer:
To get the behaviour you need (resolve $varC from fileB.xsl), you just need to go back and open fileA.xsl if you've opened fileB.xsl first.
Note: you may need to 'refresh' fileB.xsl in VSCode after this by closing/reopening it.
VSCode with Peek References invoked from the $varC reference in fileB.xsl:
A final point:
This behaviour is admittedly not seamless, but it does mean there is no need to have a proprietary project setup that would need to be maintained and shared with others. It may be of interest that there is a 'main-module' proposal for XSLT 4.0 that seeks to address this issue.

Eclipse Maven Update cleans jaxb generated classes and Regenerates them without taking the class name tag into account

I have troubles with eclipse / maven in Netbeans it's working as expected.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
jxb:extensionBindingPrefixes="xjc"
version="2.1">
<jxb:bindings schemaLocation="http://myserver/schemas/CustomerOrder_v1.7.xsd" node="/xsd:schema">
<jxb:bindings node="//xsd:element[#name='customerOrder']">
<jxb:class name="ElectronicCustomerOrder"/>
</jxb:bindings>
<jxb:bindings node="//xsd:element[#name='deliveryDate']" multiple="true">
<xjc:javaType adapter="com.prodega.xml.JodaTimeDateAdapter" name="org.joda.time.LocalDate" />
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>
if i do a maven update in eclipse (photon or mars) it generates a class called CustomerOrder into the target:
image
But i'm expecting a class named ElectronicCustomerOrder. As soon i make a change in the xjb file and save it, it renames the class in the target folder. But then the building workspace part is done and it didn't find the class ElectronicCustomerOrder. Can someone Tell me what's happening here since it's anoying to build on commandline and then do a refresh in eclipse.
A normal mvn clean install command will work also properly.

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">

Joomla 3.1.4 ,JInstaller: :Install: Cannot find Joomla XML setup file,error

I have setup already joomla 3.1.4 and I tried to install a plugin,But Im getting this error:
JInstaller: :Install: Cannot find Joomla XML setup file
This is my xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.5/template-install.dtd">
<extension version="3.1" type="plugin" group="content" client="myjoomlasite">
<name>plg_content_helloworld</name>
<author>Tahsin Çetin</author>
<creationDate>July 27th,2013</creationDate>
<copyright>Tahsin Çetin</copyright>
<licence>GNU General Public License</licence>
<authorEmail>tcetin#yandex.com</authorEmail>
<authorUrl>http://tahsincetin.com</authorUrl>
<version>1.1.0</version>
<description>Simple Hello World plugin</description>
<files>
<filename plugin="helloworld">helloworld.php</filename>
<filename>index.html</filename>
<filename>helloworld.xml</filename>
</files>
</extension>
You do not need to specify "helloworld.xml" in your xml file.Remove file and install again.This will be your final xml file-
<?xml version="1.0" encoding="UTF-8"?>
<extension version="3.1" type="plugin" group="content" client="myjoomlasite">
<name>plg_content_helloworld</name>
<author>Tahsin Çetin</author>
<creationDate>July 27th,2013</creationDate>
<copyright>Tahsin Çetin</copyright>
<licence>GNU General Public License</licence>
<authorEmail>tcetin#yandex.com</authorEmail>
<authorUrl>http://tahsincetin.com</authorUrl>
<version>1.1.0</version>
<description>Simple Hello World plugin</description>
<files>
<filename plugin="helloworld">helloworld.php</filename>
<filename>index.html</filename>
</files>
</extension>
Hope this will help.
The "Cannot find Joomla XML setup file" usually means you are trying to install an extension that wasn't designed for the version of Joomla you are installing to.
Read more here
In your opening <extension> tag, you do not need to specify a client attribute.
Where is the XML file in relation to your ZIP package? If it isn't at the top level of the ZIP, it won't be found.
Generally when this happens something is wrong with the XML file. If you have made any changes, try to think where those changes were and find a problem with the XML file.
Problems could be:
No opening or closing tag. Closing tags are easy to miss. Count them, make sure there's an opening and a closing tag.
Duplicated tags. It's easy to add two labels or showons for example, especially if you are copying and pasting.
Space before the opening XML tag
No closing fieldset tag
No closing extension or config tag. Easily deleted if you are replacing the file
You can easily use a tool like this:
https://www.w3schools.com/xml/xml_validator.asp
Which will help you to find issues such as missing opening and closing tags.

How to Configure Rock Star Apps plugin in Eclipse for Concatenating and Compressing Javascripts

I am using the rockstarapps plugin for concatenating and compressing/minifying .js files with Google Closure.
I chose the option to rebuild files when a dependency changes but now I would like to change the dependencies, output file, etc... How do I do that?
What does the 'Add to Auto-Building' option do?
thank you,
DM
In the root of your project is an ant build file called .rockstarapps.
This is Xml and human readable.
The output file is specified near the top: <file name="path/to/file.js">
Auto Building: I assume this adds the file to the build section of .rockstarapps
The autobuilding option will only be activated if the files change, to add a new dependency, go to the .rockstarapps file and add up the line necessary, after saving just change some line into any of the dependencies and the file should be compiled with your new dependencies.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rockstarapps>
<file name="WebContent/js/extlib.core.all.js">
<min>false</min>
<comp>false</comp>
<closureCompiler>false</closureCompiler>
<gZip>false</gZip>
<resolveImports>false</resolveImports>
<urlRewriting>false</urlRewriting>
<autoBuild>true</autoBuild>
<lineLength>-1</lineLength>
<autoTimestamps>false</autoTimestamps>
<removeLogs>false</removeLogs>
<oldFileNames>false</oldFileNames>
<dependencies>
<file>WebContent/ExtLib/core/modernizr.tdm.js</file>
<file>WebContent/ExtLib/core/jquery-1.8.3.js</file>
<file>WebContent/ExtLib/core/custom-tdm-jqm.js</file>
<file>WebContent/ExtLib/core/jquery.mobile-1.3.0.js</file>
<file>WebContent/ExtLib/template/knockout-2.2.1.js</file>
</dependencies>
<properties/>
</file>
</rockstarapps>