Geoserver SLD Style - Space in propertyName - postgis

I'm trying to set up an sld style in Geoserver which references a column in a PostGIS view "Route Type". I'd like to have spaces in my column names as my goal is to create user friendly views for all my spatial data. With the sld below I get an error. I've tried a substituting the space for   as well as <![CDATA[Property Name]]>
None of these resolve the issue.
Is it possible to have spaces in propertyName?
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<Name>Truck Routes and Restrictions</Name>
<UserStyle>
<Title>Truck Routes and Restrictions</Title>
<FeatureTypeStyle>
<Rule>
<Name>Designated Municipal Truck Route</Name>
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
<ogc:PropertyName>Route Type</ogc:PropertyName>
<ogc:Literal>*Designated Municipal Truck Route*</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#006600</CssParameter>
<CssParameter name="stroke-width">3</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

As I read here PropertyName should be able to be retrieved by Web Feature Service. And next I read How to request WFS propertyName containing parentheses, where I read all this kind of elements must match XML element naming, which don't allows any spaces.
So you can't use space in PropertyName. You should use "my column names" in way that will be not able to see for yours users.

Related

How to use .env file data in a .xml file in React

I am using React and would like to use the data within the .env file and insert it into my .xml file.
Is this achievable somehow, could not find anything useful on the net?
The file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp">
<!--IMPORTANT! Id must be unique for each add-in. If you copy this manifest ensure that you change this id to your own GUID. -->
<Id>c6890c26-5bbb-40ed-a321-37f07909a2f0</Id>
<Version>1.0</Version>
<ProviderName>Contoso, Ltd</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Northwind Traders Excel" />
<Description DefaultValue="Search Northwind Traders data from Excel"/>
<SupportUrl DefaultValue="[Insert the URL of a page that provides support information for the app]" />
<AppDomains>
<AppDomain>https://www.northwindtraders.com</AppDomain>
</AppDomains>
<DefaultSettings>
<SourceLocation DefaultValue="https://www.contoso.com/search_app/Default.aspx" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
</OfficeApp>
And instead of the lets say Id property i would like to have some preset value from .env.

IBM Watson Dialog API: detailed <entityRules> documentation

The IBM Watson Dialog API documentation on the following page refers to an entityRules node for expert dialog designers to extract the system-programmed entities but does not say anything else about the node:
http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/dialog/reference_nodes.shtml#reference_entityRules
Is there more detailed documentation on how this node can be used?
You can use entities to create your own data type. So in the doc, we see the example
<entities>
<entity name="currency" entityExample="dollar" entityType="GENERIC">
<value name="USD" value="USD">
<grammar>
<item>dollar </item>
<item>buck</item>
</grammar>
</value>
<value name="EUR" value="EUR">
<grammar>
<item>euro</item>
<item>eur</item>
<item>european buck</item>
</grammar>
</value>
<entityRules></entityRules>
</entity>
</entities>
This "currency" entity has a couple of value types (USD and EUR) but it could be extended to have more rows with more examples of each value. We could also add more values (say YEN, AUD etc or Japanese Yen, Australia Dollar etc).
The next thing would be to utilize the entity in a variation. So you could add a variation in an Input node, example:
I want to convert (currency) to (currency) tomorrow!
You can use any entities in a variation by simply including brackets around it.
You can also assign entity info into a profile variable so you can later access it and utilize it in your Dialog logic. Example variation:
I want to convert (currency)={CURRENCY1} to (currency)={CURRENCY2} tomorrow!
In this example, CURRENCY1 and CURRENCY2 are profile variables, that at run time, contain the entity match info.
Hope this helps.

Amazon MWS: getting error 99019 for XML productFeeds (SubmitFeed of type _POST_PRODUCT_DATA_)

When I try to add a product (via a SubmitFeed of type "_POST_PRODUCT_DATA_") to the Amazon Market via the Amazon MWS API I get the following error:
[Marketplace : Amazon.de] A valid value is required in either the
"quantity" or "fulfillment_center_id" field.
But there is no "quantity" or "fulfillment_center_id" field in my Product.xsd nor in the official documentation. Also the exact same feed does work without an error on my Amazon MWS sandbox account. What am I missing?
Complete XML:
<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope>
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>XXX</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>123456</SKU>
<StandardProductID>
<Type>EAN</Type>
<Value>767715012826</Value>
</StandardProductID>
<ProductTaxCode>A_GEN_TAX</ProductTaxCode>
<Condition>
<ConditionType>New</ConditionType>
<ConditionNote>Zustand/condition: neu OVP</ConditionNote>
</Condition>
<DescriptionData>
<Title>Bellydance for Fitness and Fun</Title>
<Manufacturer>New World 2011</Manufacturer>
</DescriptionData>
<ProductData>
<Music>
<ProductType>
<MusicPopular>
<MediaType>audioCD</MediaType>
<NumberOfDiscs>1</NumberOfDiscs>
<Genre>New Age</Genre>
</MusicPopular>
</ProductType>
</Music>
</ProductData>
</Product>
</Message>
</AmazonEnvelope>
Make sure that you use the correct "Merchant Token" (NOT merchant id) in the tag "MerchantIdentifier" inside your feed (this isn't well documented).
<MerchantIdentifier>YOUR_MERCHANT_TOKEN</MerchantIdentifier>
You should see your Merchant Token by navigating to Sellercentral > Settings > Account Info and clicking on Your Merchant Token inside the box Business Information. If the Merchant Token isn't there (which was a common error in the past), contact the Seller Support and ask for the correct Merchant Token: Please send me my Merchant Token (NOT merchant id) for use with 3rd party software.
Try to omit additional tags describing the product, especially the whole <ProductData> section inside the <Product> element. Whenever i specified the <ProductData> section I got error 99019.
The field names in MWS error messages do not match the XML structure. I'm assuming they match the flat file (CSV) columns, but haven't actually checked.
You stated "I try to add a product", while I'm guessing that above error happened when subitting an inventory feed, which is why you won't find the anything of that sort in Product.xsd.
The corresponding XML elements are Quantity and FulfillmentCenterID, both defined in Inventory.xsd.

SSRS ReportViewer problems with XML embedded data source

I have C# (WPF) application where I want to display a SSRS report in the ReportViewer control. The local report file has XML datasource embedded in it. The report is displayed correctly when running from SQL Server Business Intelligence Development Studio. But when I run with my app I get the following error:
A data source instance has not been supplied for the data source '...'.
So here is what I'm doing:
I have defined embedded XML data, as explained in this tutorial Defining a Report Dataset from Embedded XML Data. I have a data source called XmlDataSource_TopCustomers and a data set called XmlDataSet_TopCustomers, using that data source. I have referred the data set in a table and a chart. Overall, the RDL looks like this (just the essential, of course):
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body>
<ReportItems>
<Tablix Name="Tablix1">
<DataSetName>XmlDataSet_TopCustomers</DataSetName>
</Tablix>
<Chart Name="Chart1">
<DataSetName>XmlDataSet_TopCustomers</DataSetName>
</Chart>
</ReportItems>
</Body>
<DataSources>
<DataSource Name="XmlDataSource_TopCustomers">
<ConnectionProperties>
<DataProvider>XML</DataProvider>
<ConnectString />
</ConnectionProperties>
<rd:SecurityType>None</rd:SecurityType>
<rd:DataSourceID>47833b52-231f-4634-8af4-3c63272b02a7</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="XmlDataSet_TopCustomers">
<Query>
<DataSourceName>XmlDataSource_TopCustomers</DataSourceName>
<CommandText><Query>
<ElementPath>Root /CustomerOrder {#CustomerNo, #CustomerName, #OrdersCount (Integer), #Total(Float), #AveragePerOrder(Float)}</ElementPath>
<XmlData>
<Root>
<CustomerOrder CustomerNo="10001" CustomerName="Name 1" OrdersCount="2" Total="5.446740000000000e+003" AveragePerOrder="2.723370000000000e+003" />
<CustomerOrder CustomerNo="10894" CustomerName="Name 2" OrdersCount="5" Total="3.334750000000000e+003" AveragePerOrder="6.669500000000001e+002" />
<CustomerOrder CustomerNo="12980" CustomerName="Name 3" OrdersCount="2" Total="2.003290000000000e+003" AveragePerOrder="1.001645000000000e+003" />
</Root>
</XmlData>
</Query></CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>...
</DataSets>
<rd:ReportUnitType>Inch</rd:ReportUnitType>
<rd:ReportID>02172db8-2a1d-4c35-9555-b37ee6193544</rd:ReportID>
</Report>
At this point everything works fine from the IDE.
In my C# application, I have a ReportViewer and the following code:
Viewer.LocalReport.ReportPath = #"<actualpath>\TopCustomers.rdl"; // actual path is OK
Viewer.RefreshReport();
And then I get that
A data source instance has not been supplied for the data source 'XmlDataSet_TopCustomers'.
I've seen others having the same problem, but in most of the cases the problem is multiple datasources, which is not the case here, as you can see from the RDL snippet above.
Any suggestions?
The answer to my question can also be found here When to use RDLC over RDL reports? and here http://www.gotreportviewer.com/. It's basically this:
Unlike the Report Server the ReportViewer control does not connect to
databases or execute queries. Also, in local mode the only export
formats available are Excel, Word and PDF. (In remote mode all formats
supported by the Report Server are available.) The ReportViewer
control cannot be extended by adding custom renderers or custom report
items.
More information can be found here http://msdn.microsoft.com/en-us/library/ms252109(v=vs.80).aspx.
The ReportViewer control, which processes .rdlc files, ignores the
element of RDL. If a report definition contains a query, the
control will not process it.
and
When converting a .rdl file to .rdlc format, you must manually replace
the data source and query information in the report definition with
data constructs provided in your application
So you have to fetch the data explicitly and provided for the ReportViewer as a ReportDataSource having the exact same name as the dataset in the RDL file.
I have a small command line app that does something similar, but between defining the report path and doing anything with the report viewer I'm setting a data source for the report to be run against:
report.DataSources.Add(new ReportDataSource("DataSet_for_Distribution", table));
...table is a DataTable.
After that I have no problems programmatically calling the report Render method.
Can you set a break before the render and see what data sources the report actually has?
Another thing to try, and it may just be that you formatted (or stack formatted ) it to post it here, but when I embed an XML data set in a report it is all using a format like this:
<CommandText><Query>
<ElementPath>Root /S {#OrderDate (Date), #TotalDue (Decimal)} /C {#LastName} </ElementPath>
<XmlData>
<Root>
<S OrderDate="2003-07-01T00:00:00" SalesOrderNumber="SO51131" TotalDue="247913.9138">
<C FirstName="Shu" LastName="Ito" />
</S>
<S OrderDate="2003-10-01T00:00:00" SalesOrderNumber="SO55282" TotalDue="227737.7215">
<C FirstName="Shu" LastName="Ito" />
</S>
<S OrderDate="2002-07-01T00:00:00" SalesOrderNumber="SO46616" TotalDue="207058.3754">
<C FirstName="Jae" LastName="Pak" />
</S>
<S OrderDate="2002-08-01T00:00:00" SalesOrderNumber="SO46981" TotalDue="201490.4144">
<C FirstName="Ranjit" LastName="Varkey Chudukatil" />
</S>
<S OrderDate="2002-09-01T00:00:00" SalesOrderNumber="SO47395" TotalDue="198628.3054">
<C FirstName="Michael" LastName="Blythe" />
</S>
</Root>
</XmlData>
</Query></CommandText>
I am not sure from what you have stated if the data source has specified credentials.
This part here:
<ConnectionProperties>
<DataProvider>XML</DataProvider>
<ConnectString />
</ConnectionProperties>
Generally speaking with SQL data sources when reports fail to view for others or from applications it is due to the hosting server assuming a different credential than your IDE building the application. It does not know if my name is Brett, that my credentials are running it when calling it remotely. When you specify the credentials on the server hosting the report you can usually get around this. You go into the server hosting the report, I assume you are doing this as you have an 'rdl' report versus an rdlc report. Find the datasource, click properties, change setting to be 'use these credentials'. Supply credentials that you know work.
This may fix the issue. I am not certain with Sharepoint connections and XML connections but this is common with viewing issues with SQL Server connections.

iBatis - Why is sqlMapConfig.xml unable to find the sql maps defined in it?

I have a sqlMapConfig.xml that has three SQLMaps defined in it.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<!-- Statement namespaces are required for Ibator -->
<settings enhancementEnabled="true" useStatementNamespaces="true"/>
<!-- Setup the transaction manager and data source that are
appropriate for your environment
-->
<transactionManager type="JDBC">
<dataSource type="SIMPLE" >
<property name="JDBC.Driver"
value="com.mysql.jdbc.Driver"/>
<property name="JDBC.ConnectionURL"
value="jdbc:mysql://localhost:3306/sug"/>
<property name="JDBC.Username"
value="root"/>
<property name="JDBC.Password"
value="admin"/>
</dataSource>
</transactionManager>
<!-- SQL Map XML files should be listed here -->
<sqlMap resource="com/tatakelabs/dbmaps/categories_SqlMap.xml" />
<sqlMap resource="com/tatakelabs/dbmaps/pro_SqlMap.xml" />
<sqlMap resource="com/tatakelabs/dbmaps/pro_category_SqlMap.xml" />
</sqlMapConfig>
I get a runtime error - Cause: java.io.IOException: Could not find resource com/tatakelabs/dbmaps/categories_SqlMap.xml
categories_SqlMap.xml is present in that location. I tried changing the location of the map xml, but that did not help. sqlMapConfig.xml validates against the DTD. categories_SqlMap.xml also validates against the right DTD. I am at my wits end trying to figure out why it can't find the resource. The sqlMap files are generated by iBator.
This was happening because the sqlmap file location was not getting copied to target. Added a copy goal and that fixed it.
I had the same problem. It appears the problem lies with the location of the config file. Thus, its in relation of the project resource structure.
I moved the config file in the same package as the mapper classes and it worked. In this case try moving all the resources to this package and update the resource attributes to:
<sqlMap resource="categories_SqlMap.xml" />
<sqlMap resource="pro_SqlMap.xml" />
<sqlMap resource="pro_category_SqlMap.xml" />
Solved it.
I moved the xml file to where the Pojo was located and provided the path as follows:
<sqlMap resource="com/heena/ibatis/model/jsr/jsr.xml" />
And it worked.
place it ...src\java\abc.xml under the Source Packages directory.
If you are using Spring, you can use a SqlMapClientFactoryBean specifying property "mappingLocations". In this property you can specify a generic path, such as "com/tatakelabs/dbmaps/*_SqlMap.xml" or with a variable such as ${mapfiles}, that will be resolved by Spring as an array of file names. This lets you omit sqlMap element in sqlMapConfig. This technique will run with iBatis 2.3.4 on. However sql-map-config-2.dtd is also contained inside iBatis.jar, so you can experience some parsing errors, as /com/ibatis/sqlmap/engine/builder/xml/sql-map-config-2.dtd may have a bug. In this case you may want to replace it inside the jar with the one from the URL:
http://ibatis.apache.org/dtd/sql-map-config-2.dtd.

Resources