What is wrong with my layer.xml from netbeans? - netbeans

I try to create a new palette in netbeans 10, but the following 2 errors don't allow me to compile the project:
Document root element "folder", must match DOCTYPE root "JavaPalette". [3]
The markup in the document following the root element must be well-formed. [11]
My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<folder name="JavaPalette">
<folder name="Items">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
<file name="Item.xml" url="resources/Item.xml">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
</file>
</folder>
</folder>
<filesystem/>
I have no clue what both error messages mean, but i did exactly what is said in the tutorial.
Online validation of the xml file also shows that error.
https://platform.netbeans.org/tutorials/nbm-palette-api2.html

I didn´t followed the tutorial, but as far as i can tell, your filesystem tag is not valid. If you take a look at the DTD you can see that the element filesystem isn´t declared as EMPTY (for more information you can read more about it here). So you have to provide a start and end tag. In your posted example you are only using <filesystem/> which isn´t allowed.
You have to change the xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
<folder name="JavaPalette">
<folder name="Items">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
<file name="Item.xml" url="resources/Item.xml">
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.javasourcefilepalette.Bundle"/>
</file>
</folder>
</folder>
</filesystem>

Related

Deploying communities using package.xml

I am trying to retrieve Salesforce communities names 'XXX Community' from one org into VS Code and subsequently want to deploy it into another org.
However, when I use the sfdx force:source:retrieve -u DemoMaster -x ./package.xml command, for the below package.xml file, I get the following error:
Entity of type 'CustomSite' named 'XXX_Community_Test' cannot be found
Entity of type 'SiteDotCom' named 'XXX_Community_Test1' cannot be found
Only the network and network branding elements got retrieved.
The package.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>XXX Community</members>
<name>Network</name>
</types>
<types>
<members>XXX_Community_Test</members>
<name>CustomSite</name>
</types>
<types>
<members>XXX Community_Test1</members>
<name>SiteDotCom</name>
</types>
<types>
<members>cbXXX_Community</members>
<name>NetworkBranding</name>
</types>
<version>48.0</version>
</Package>
Any help appreciated!
D

How to read xml value with Powershell

<?xml version="1.0" encoding="utf-8"?>
<Foo>
<Tier Path="\\10.10.44.61\Case Study\" />
<Force Path="\\10.10.44.61\Orto Study" Atomic="False" />
</Foo>
How can I read in powershell Tier Path value?
I am expecting to get the value of \\10.10.44.61\Case Study\
$xml = '<?xml version="1.0" encoding="utf-8"?>
<Foo>
<Tier Path="\\10.10.44.61\Case Study\" />
<Force Path="\\10.10.44.61\Orto Study" Atomic="False" />
</Foo>'
([xml]$xml).Foo.Tier.Path
As long as you are using an xml type (which I do by casting) you can reference the path directly as members of the object.

How to include resources file in anjuta project

I'm trying to update a graphical project in vala, moving lot of code lines into an ui file.
I want to use template (available with glib-2.38 and GTK+3.8, something like that).
My project is managed with Anjuta and autoconf.
In the src directory there are
application.ui:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.8 -->
<template class="SpiWindow" parent="GtkApplicationWindow">
<property name="title" translatable="yes">Example Application</property>
<property name="default-width">600</property>
<property name="default-height">400</property>
<child>
<placeholder />
</child>
</template>
</interface>
resources.xml:
<?xml version="1.0" charset="UTF-8" ?>
<gresources>
<gresource prefix="/org/app/spi">
<file compressed="true" preprocess="xml-stripblanks">application.ui</file>
</gresource>
</gresources>
in src/Makefile.am I have append --gresources resources.xml to the spi_VALAFLAGS. And finally I declared The Gtk.ApplicationWindow like this
[GtkTemplate(ui = "/org/app/spi/application.ui")]
internal class SpiWindow : Gtk.ApplicationWindow {
// Constructor
public Window (Gtk.Application application) {
Object(application: application);
}
}
But when I compile and then run the application, there is the error message :
(spi:9749): Gtk-CRITICAL : Unable to load resource for composite template for type 'SpiWindow': The resource at '/org/app/spi/application.ui' does not exist
(spi:9749): Gtk-CRITICAL : gtk_widget_init_template: assertion 'template != NULL' failed
You still need to compile the resources and include them:
GLIB_COMPILE_RESOURCES=glib-compile-resources
resources.c: resources.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies resources.xml)
$(GLIB_COMPILE_RESOURCES) --target=$# --generate-source $<
and include resources.c as a source file in spi_SOURCES.

Namespace/Mymodule/Block/Item.php file code not accessible on frontend after adding through xml

i am working on a module e.g "Mymodule", in which i need to filter the results. i.e. for Partners i created Partner.php and for Community i created Community.php in
Mymodule/Block/Partner.php
Mymodule/Block/Community.php
Now i wanted to access their code in frontend through Mymodule.XML
<block type="mymodule/partner" ......................... />
but this doesn't work on LIVE SERVER, although it does work on local Wamp server :( ... Any idea ?
Although when i access the default Mymodule.php code in the same and add the code i placed in partner and community file, it does work.
Is there something i am missing ?
First, you have to define the blocks in your module's config.xml:
<config>
<global>
<blocks>
<mymodule>
<class>Namespace_Mymodule_Block</class>
</mymodule>
</blocks>
</global>
</config>
Second, you have to use the right block type in your layout XML:
<block type="mymodule/partner" ......................... />
You must not write ".php" in the block type. Note, that the term "mymodule" has to be the same in the config xml as well as in the block type.
Hope this helps!
I'm not strictly sure how your code would ever have worked. But assuming you haven't built a module before, you'll need a minimum of 3 files.
app/etc/modules/Sonassi_Module.xml
app/code/community/Sonassi/Module/etc/config.xml
app/code/community/Sonassi/Module/Block/Partner.php
In the first file ... app/etc/modules/Sonassi_Module.xml
<?xml version="1.0"?>
<config>
<modules>
<Sonassi_Module>
<active>true</active>
<codePool>community</codePool>
</Sonassi_Module>
</modules>
</config>
In the second file ... app/code/community/Sonassi/Module/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Sonassi_Module>
<version>0.1.0</version>
</Sonassi_Module>
</modules>
<frontend>
<routers>
<module>
<use>standard</use>
<args>
<module>Sonassi_Module</module>
<frontName>module</frontName>
</args>
</module>
</routers>
</frontend>
<global>
<blocks>
<module>
<class>Sonassi_Module_Block</class>
</module>
</blocks>
</global>
</config>
In the third file ... app/code/community/Sonassi/Module/Block/Partner.php
class Sonassi_Module_Block_Partner extends Core_Block_Template
{
}
Then finally, you can then use
<block type="module/partner" ......................... />

Reading values from property file through NANT

How can I read a value alone from the property file. For example, how can I read the values of build.home or temp.dir from the below example.
contents of env.properties
build.home=c:\build
temp.dir=c:\temp
Regards
Sarathy
We do this in a slightly different format for Nant.
In your build file:
<include buildfile="./env.properties" failonerror="true"/>
env.properties:
<?xml version="1.0" ?>
<project>
<property name="build.home" value="c:/build"/>
<property name="temp.dir" value="c:/temp"/>
</project>