Columns is not generating during code-generation in records - jooq

Sample XML file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.17.0.xsd">
<!-- Configure the database connection here -->
<jdbc>
<driver>com.mysql.cj.jdbc.Driver</driver>
<url></url>
<user></user>
<password></password>
</jdbc>
<!-- onError SILENT can be used with MYSQLDatabase for Memsql -->
<!-- <onError>SILENT</onError> -->
<generator>
<generate>
<records>true</records>
<instanceFields>true</instanceFields>
<generatedAnnotation>true</generatedAnnotation>
<generatedAnnotationType>DETECT_FROM_JDK</generatedAnnotationType>
</generate>
Earlier this file generated jOOQ code with records, and had columns. Now code generated but jooq-columns are not present

This looks like a regression in the MemSQLDatabase, probably introduced with jOOQ 3.16's support for computed columns: https://github.com/jOOQ/jOOQ/issues/13854

Related

How to output xml file as text in u-sql?

I've a XML file that I need to output as text, how can I do that? What is the best and efficient way to get text output via u-sql?
INPUT XML:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>abstract.xml</title>
<link>download.wikimedia.org/enwiki/20171103</link>
<description>Wikimedia dump updates for enwiki</description>
<item>
<title>download.wikimedia.org/enwiki/20171103</title>
<link>download.wikimedia.org/enwiki/20171103</link>
<description>
<a href="download.wikimedia.org/enwiki/20171103/…" />
</description>
<pubDate>Sun, 05 Nov 2017 21:11:20 GMT</pubDate>
</item>
</channel>
</rss>
This is my xml and I'm trying with below code to retrieve its data.
REFERENCE ASSEMBLY [Microsoft.Analytics.Samples.Formats];
#wiki = EXTRACT title string,
link string //abst string
FROM #input
USING new Microsoft.Analytics.Samples.Formats.Xml.XmlExtractor(
"doc",
new SQL.MAP<string,string> {
{"title","title" },
{"link","link" }
}
);
There is a great example from Microsoft showed here:
https://github.com/Azure/usql/tree/master/Examples/DataFormats/Microsoft.Analytics.Samples.Formats
You can just bind the .DLL file and refer to it in your u-sql project.
I've used it a lot in the past for extracting and outputting both json and xml.

Does any XSD edge case allow XML element content inside a text node?

Does any XSD edge case allow (unescaped) XML element content inside a text node? E.g. can you put a CDATA element inside a tag defined as xs:string and have it validate (without declaring mixed content)?
If you have an element that contains a string i.e.
<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid Studio 2018 (https://www.liquid-technologies.com)-->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Root" type="xs:string" />
</xs:schema>
Then that can contain CDATA i.e.
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Studio 2018 (https://www.liquid-technologies.com) -->
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Temp\XSDFile2.xsd">
Optional Text
<![CDATA[
<someXmlData></someXmlData>
]]>
Optional Text
</Root>
As this passes though some parsers it may get escaped back to this, but both are valid and equivalent.
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Studio 2018 (https://www.liquid-technologies.com) -->
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XSDFile2.xsd">
Optional Text
<someXmlData></someXmlData>
Optional Text
</Root>

How to set Consistency Level in Spring Data Cassandra XML config

I am using Spring-Data-Cassandra 1.2.2. I am using XML config as below. I read that the default ConsistencyLevel is ONE, I want to set it to QUORUM. How do I configure it in the XML?
I can upgrade my Spring-Data-Cassandra version if required.
<?xml version='1.0'?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cassandra="http://www.springframework.org/schema/data/cassandra"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/cql http://www.springframework.org/schema/cql/spring-cql.xsd
http://www.springframework.org/schema/data/cassandra http://www.springframework.org/schema/data/cassandra/spring-cassandra.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- Loads the properties into the Spring Context and uses them to fill in placeholders in the bean definitions -->
<context:property-placeholder location="classpath:resources.properties" />
<!-- REQUIRED: The Cassandra Cluster -->
<cassandra:cluster contact-points="${cassandra.contactpoints}" port="${cassandra.port}" />
<!-- REQUIRED: The Cassandra Session, built from the Cluster, and attaching to a keyspace -->
<cassandra:session keyspace-name="${cassandra.keyspace}" schema-action="CREATE" />
<!-- REQUIRED: The Default Cassandra Mapping Context used by CassandraConverter -->
<cassandra:mapping />
<!-- REQUIRED: The Default Cassandra Converter used by CassandraTemplate -->
<cassandra:converter />
<!-- REQUIRED: The Cassandra Template is the building block of all Spring Data Cassandra -->
<cassandra:template />
<!-- OPTIONAL: If you are using Spring Data Cassandra Repositories, add your base packages to scan here -->
<cassandra:repositories base-package="com.my.package.cassandrarepository" />
</beans>
Seems JavaConfig is the only solution. Upgrading from 1.2.2 to 1.5 was proving to be a bit complicated cos of other spring-data(mongo & JPA) dependencies in my proj. So I used the following config in 1.2.2 version: com.datastax.driver.core.Cluster.builder().withQueryOptions(‌​new QueryOptions().setConsistencyLevel(ConsistencyLevel.QUORUM))

Sharepoint 2k7 - Custom WebPart not loading

First off i am a big fat NOOB in regards to Sharepoint 2007 webpart development but i am working at it.
Now for the real problem, so i develop this webpart and follow the 'Loose' advise from various sites on how to setup the features.xml, .xml, manifest.xml, solution.ddf and solution.build files. Basically, i have a all-in-one solution where i build the webpart and then in post-build event compile all the source files into the WSP deployment package.
Problem i am having is that I can add the solution to the sharepoint site but when i go to Deploy it through CA-Operations-Solution management i get this great error:
Error as reported from Sharepoint
Failed to instantiate file "ChartPartWP.webpart" from module "ChartPartWP": Source path "ChartPartWP\ChartPartWP.webpart" not found.
When i looked at the file-system the folder ChartPart is present in TEMPLATE\FEATURES with the ChartPartWP.webpart and other support files.
What is not happening that i need to resolve.
Edit: 10/24/2011 # 11:36PM
Solution.ddf
.OPTION EXPLICIT
.Set CabinetNameTemplate=ChartPartWP.wsp
.Set DiskDirectoryTemplate=CDROM
.Set DiskDirectory1=Package
.Set CompressionType=MSZIP
.Set UniqueFiles="ON"
.Set Cabinet=On
.Set SourceDir="\\<fileserver>\common share\Software_Development\MPT\Sharepoint2007\ChartPart\"
Manifest.xml manifest.xml
; binary
bin\release\TCBOE.ChartPart.dll TCBOE.ChartPart.dll
; feature files
TEMPLATE\FEATURES\ChartPartWP\ChartPartWP.xml ChartPartWP\ChartPartWP.xml
TEMPLATE\FEATURES\ChartPartWP\feature.xml ChartPartWP\Feature.xml
; web part files
TEMPLATE\FEATURES\ChartPartWP\ChartPartWP.webpart ChartPartWP\ChartPartWP.webpart
TEMPLATE\FEATURES\ChartPartWP\LockedChartPartWP.webpart ChartPartWP\LockedChartPartWP.webpart
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/"
SolutionId="{0C32EA7F-78C2-4814-A4C9-88256E49E371}">
<FeatureManifests>
<FeatureManifest Location="ChartPartWP\feature.xml" />
</FeatureManifests>
<Assemblies>
<Assembly Location="TCBOE.ChartPart.dll"
DeploymentTarget="GlobalAssemblyCache" />
</Assemblies>
</Solution>
ChartPartWP.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="ChartPartWP"
List="113" Url="_catalogs/wp"
Path="ChartPartWP"
RootWebOnly="True">
<File Url="ChartPartWP.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="ChartParts" />
</File>
<File Url="LockedChartPartWP.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="ChartParts" />
</File>
</Module>
</Elements>
feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="47D62F5E-B0E0-4f93-BCD1-081CA794527C" Version="3.5.1.0"
Title="TCBOE ChartPart"
Description="Provides a Chart Web object to be used in Sharepoint 2007."
AutoActivateInCentralAdmin="TRUE"
Scope="Site">
<ElementManifests>
<ElementManifest Location="ChartPartWP.xml" />
<ElementFile Location="ChartPartWP.webpart" />
<ElementFile Location="LockedChartPartWP.webpart"/>
</ElementManifests>
</Feature>
Would there be any receivers/handlers i need make are implemented for the installation to take hold? I didnt read anything about it but read something about a FeatureReceiver for a purpose, but cant remember for the life-of-it, why you need the FeatureReceiver (SPFeatureReceiver)
SPFeatureDefinition.AutoActivateInCentralAdmin Property
Gets a value that specifies whether the Feature is activated on the central administrative Web site, site collection, or Web application upon installation.
Without testing your entire samples, using this property sounds off to me. Try removing that.
update: you should post your .webpart also (it is a xml).
Try these configs: Feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="47D62F5E-B0E0-4f93-BCD1-081CA794527C" Version="3.5.1.0" Title="TCBOE ChartPart" Description="Provides a Chart Web object to be used in Sharepoint 2007." Scope="Site">
<ElementManifests>
<ElementManifest Location="ChartPartWP\ChartPartWP.xml" />
<ElementFile Location="ChartPartWP\ChartPartWP.webpart" />
<ElementFile Location="ChartPartWP\LockedChartPartWP.webpart"/>
</ElementManifests>
</Feature>
webpart.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="ChartPartWP" List="113" Url="_catalogs/wp">
<File Path="ChartPartWP.webpart" Url="ChartPartWP.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="ChartParts" />
</File>
<File Path="ChartPartWP.webpart" Url="LockedChartPartWP.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="ChartParts" />
</File>
</Module>
</Elements>
If nothing works, I would recommend installing and using the VSeWSS 1.3 from Microsoft, create a new webpart, hit F5, test it. If you can see it in the "Add Web Parts" dialog, move your files over. This is the closest you will get to the SharePoint 2010 experience (which is terribly improved).
Having to fiddle with these files, even more to a beginner, should not be your burden.

Is FeatureUpgrading supposed to use the latest Property values?

The 1.0.0.0 version of my Feature's Template.xml file looked like this:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
<Properties>
<Property Key="AvailableWebTemplates" Value="MPS#0;MPS#1;MPS#2;MPS#3;MPS#4" />
</Properties>
</Feature>
The new version 1.1.0.0 is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
<UpgradeActions>
<VersionRange BeginVersion="1.0.0.0" EndVersion="1.1.0.0">
<CustomUpgradeAction Name="UpgradeTo1v1"/>
</VersionRange>
</UpgradeActions>
<Properties>
<Property Key="AvailableWebTemplates" Value="MPS#0;MPS#1;MPS#2;MPS#3;MPS#4;STS#2" />
</Properties>
</Feature>
The value of templates is still MPS#0;MPS#1;MPS#2;MPS#3;MPS#4, when the following code runs in FeatureUpgrading:
SPFeatureProperty property = properties.Feature.Properties["AvailableWebTemplates"];
string templates = property.Value;
Why am I not getting the updated property value? Is this the way it is supposed to be?
This is indeed the way it is supposed to be:
A feature has 1 definition and n instances. The code in FeatureUpgrading is used to upgrade the instances.
The property in your xml updates the feature definition and not the running instances.
properties.Feature.Properties["MyProp"] gets the property value of the running instance properties.Definition.Properties["MyProp"] gets the value of the property in the feature definition.

Resources