xslt - for-each-group challenge - xslt-2.0

My challenge is that I have to group everything in the values ​​/ value tags. I have to group every tag <Value ID="0" AttributeID="att_X">0 - AAAAA</Value> when there is a value with AAAAA in it.
The values ​​0 - AAAAA, 23 - AAAAA B, 12 - AAAAA C must come together in the output message, What is the best way to do this?
I have tried to group it
<xsl:for-each-group select="Entity/Values/Value[#AttributeID='att_PVPP']" group-by="substring-before(substring-after(Entity/Values/Value[#AttributeID='att_X'], '- '), ' ') ='AAAAA'">
also tried
<xsl:for-each-group select="Entity/Values/Value[#AttributeID='att_PVPP']" group-by="matches(Entity/Values/Value[#AttributeID='att_X'], 'AAAAA')">
and
<xsl:for-each select="matches(Entity/Values/Value[#AttributeID='att_X'], 'AAAAA')">
I have the following input xml:
<Entities>
<Entity Referenced="true" Selected="false" ParentID="P" UserTypeID="V" ID="PVP-1">
<Name>123456 - 0</Name>
<Values>
<Value AttributeID="att_PVPS">2020-10-06</Value>
<Value AttributeID="att_PVPP">123456</Value>
<Value ID="0" AttributeID="att_X">0 - AAAAA</Value>
<Value AttributeID="att_PVPEi">2020-10-06</Value>
<Value UnitID="Y.unit." AttributeID="C">10</Value>
<Value ID="2" AttributeID="att_Z">A</Value>
</Values>
</Entity>
<Entity Referenced="true" Selected="false" ParentID="W" UserTypeID="V" ID="PVP-2">
<Name>789012 - 200</Name>
<Values>
<Value AttributeID="att_PVPS">2020-09-16</Value>
<Value AttributeID="att_PVPP">789012</Value>
<Value ID="200" AttributeID="att_X">200 - BBBBB</Value>
<Value AttributeID="att_PVPEi">2020-10-22</Value>
<Value UnitID="Y.unit." AttributeID="C">200</Value>
<Value ID="2" AttributeID="att_Z">A</Value>
</Values>
</Entity>
<Entity Referenced="true" Selected="false" ParentID="W" UserTypeID="V" ID="PVP-3">
<Name>123456 - 0</Name>
<Values>
<Value AttributeID="att_PVPS">2020-10-07</Value>
<Value AttributeID="att_PVPP">123456</Value>
<Value ID="0" AttributeID="att_X">0 - BBBBB</Value>
<Value AttributeID="att_PVPEi">2020-10-13</Value>
<Value UnitID="Y.unit." AttributeID="C">1</Value>
<Value ID="2" AttributeID="att_Z">A</Value>
</Values>
</Entity>
<Entity Referenced="true" Selected="false" ParentID="W" UserTypeID="V" ID="PVP-4">
<Name>123456 - 23</Name>
<Values>
<Value AttributeID="att_PVPS">2020-10-16</Value>
<Value AttributeID="att_PVPP">123456</Value>
<Value ID="23" AttributeID="att_X">23 - AAAAA B</Value>
<Value AttributeID="att_PVPEi">2020-10-21</Value>
<Value UnitID="Y.unit." AttributeID="C">1</Value>
<Value ID="3" AttributeID="att_Z">C</Value>
</Values>
</Entity>
<Entity Referenced="true" Selected="false" ParentID="W" UserTypeID="V" ID="PVP-5">
<Name>123456 - 12</Name>
<Values>
<Value AttributeID="att_PVPS">2020-10-14</Value>
<Value AttributeID="att_PVPP">123456</Value>
<Value ID="12" AttributeID="att_X">12 - AAAAA C</Value>
<Value AttributeID="att_PVPEi">2020-10-16</Value>
<Value UnitID="Y.unit." AttributeID="C">15</Value>
<Value ID="2" AttributeID="att_Z">A</Value>
</Values>
</Entity>
</Entities>
The output must be:
<test>
<test1>
<value-ID-att_X-att_X>0</value-ID-att_X>
<lines>
<line>
<att_PVPS>2020-10-06</att_PVPS>
<AttributeID-C>10</AttributeID-C>
<value-ID-att_Z>2</value-ID-att_Z>
</line>
</lines>
</test1>
<test1>
<value-ID-att_X>23</value-ID-att_X>
<lines>
<line>
<att_PVPS>2020-10-16</att_PVPS>
<AttributeID-C>1</AttributeID-C>
<value-ID-att_Z>3</value-ID-att_Z>
</line>
</lines>
</test1>
<test1>
<value-ID-att_X>12</value-ID-att_X>
<lines>
<line>
<att_PVPS>2020-10-14</att_PVPS>
<AttributeID-C>15</AttributeID-C>
<value-ID-att_Z>2</value-ID-att_Z>
</line>
</lines>
</test1>
</test>

Related

Unable to manually set the intervals for Y axis

I have a HTML5 column chart in my jasper report. I need to configure the y axis and be able to set the intervals manually
I have used,
<property name="net.sf.jasperreports.chart.range.axis.tick.count" value="false"/>
<property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="2"/>
It has no effect on the chart
The source code is as follows
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="customizechart" pageWidth="1000" pageHeight="1000" columnWidth="960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="23a00417-b19d-4f98-aa59-dc6422d51386">
<property name="net.sf.jasperreports.chart.range.axis.tick.count" value="false"/>
<property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="2"/>
<queryString>
<![CDATA[Select * from some_table]]>
</queryString>
<field name="Name" class="java.lang.String"/>
<field name="AppliedQuantity" class="java.lang.Float"/>
<summary>
<band height="959" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="960" height="500" uuid="774dd6b9-b5b9-4d3c-b518-6f7c7ca40043"/>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="Column">
<hc:chartSetting name="default">
<hc:chartProperty name="chart.zoomType">
<hc:propertyExpression><![CDATA["xy"]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.enabled">
<hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.href">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="yAxis.title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset/>
<dataAxis axis="Rows">
<axisLevel name="Name">
<labelExpression><![CDATA["Level Label expression"]]></labelExpression>
<axisLevelBucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Name}]]></bucketExpression>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns"/>
<multiAxisMeasure name="Measure1" class="java.lang.Integer" calculation="Nothing">
<labelExpression><![CDATA["f"]]></labelExpression>
<valueExpression><![CDATA[$F{AppliedQuantity}]]></valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Measure1"/>
</hc:chart>
</componentElement>
</band>
</summary>
</jasperReport>
Any ideas on this?
net.sf.jasperreports.chart.* properties apply to the charts built into the community/open source JasperReports library (which are based on JFreeChart).
For HTML5 charts - part of JasperReports Professional - what you have to do is set the yAxis.tickInterval property in the chart:
<hc:chartProperty name="yAxis.tickInterval">
<hc:propertyExpression><![CDATA[500]]></hc:propertyExpression>
</hc:chartProperty>

How can I get repeatable field values of a Liferay Dynamic Data List via API

I try to make a service for reading from Liferay 6.2 DDL.
Here is DDL structure :
<root available-locales="en_US" default-locale="en_US">
<dynamic-element dataType="string" indexType="text" localizable="false" name="Course_ID" readOnly="false" repeatable="false" required="true" showLabel="true" type="text" width="medium">
<dynamic-element dataType="boolean" indexType="keyword" localizable="true" name="Active" readOnly="false" repeatable="true" required="false" showLabel="true" type="checkbox" width="">
<dynamic-element dataType="string" indexType="keyword" localizable="true" multiple="false" name="Language" readOnly="false" repeatable="false" required="false" showLabel="true" type="select" width="">
<dynamic-element name="option22436" type="option" value="en">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[English]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option22437" type="option" value="fr">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[French]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element name="option22438" type="option" value="de">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Deutsch]]>
</entry>
</meta-data>
</dynamic-element>
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Language]]>
</entry>
<entry name="predefinedValue">
<![CDATA[[""]]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element dataType="string" indexType="keyword" localizable="true" name="Guest_URL" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Guest URL]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element dataType="string" indexType="keyword" localizable="true" name="Registered_URL" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Registered URL]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Active]]>
</entry>
<entry name="predefinedValue">
<![CDATA[true]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<dynamic-element dataType="document-library" fieldNamespace="ddm" indexType="keyword" localizable="true" name="Documents_and_Media8331" readOnly="false" repeatable="false" required="false" showLabel="true" type="ddm-documentlibrary" width="">
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Documents and Media]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
<meta-data locale="en_US">
<entry name="label">
<![CDATA[Course ID]]>
</entry>
<entry name="predefinedValue">
<![CDATA[]]>
</entry>
<entry name="tip">
<![CDATA[]]>
</entry>
</meta-data>
</dynamic-element>
</root>
As you can see I have a repeatable checkbox container, who have 3 more element inside
structure view
I can get and iterate records list, but no idea how can I get a list with all checkboxes and iterate for their elements inside
DynamicQuery getRecordsetIdQuery = DDLRecordSetLocalServiceUtil.dynamicQuery()
.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("recordSetId")))
.add(RestrictionsFactoryUtil.ilike("name", courseSetName));
DynamicQuery getDdlRecordListQuery = DDLRecordLocalServiceUtil.dynamicQuery()
.add(PropertyFactoryUtil.forName("recordSetId").in(getRecordsetIdQuery));
JSONArray courseList = JSONFactoryUtil.createJSONArray();
List ddlRecordList = DDLRecordLocalServiceUtil.dynamicQuery(getDdlRecordListQuery);
if (ddlRecordList != null && ddlRecordList.size() > 0) {
int ddlRecordListSize = ddlRecordList.size();
for (int i = 0; i < ddlRecordListSize; i++) {
DDLRecord ddlRec = (DDLRecord) ddlRecordList.get(i);
Field active = ddlRec.getField("Active");
...
Do you can help me with some ideas please ?
I have three fields. solution for how to get repeated Field in portlet.
1.LanguageName (Parent and Repeated Field)
2. DocumentLinkLabel (Repeated Field)
3. DocumentLink (Child Field)
for (JournalArticle journalArticle : journalArticleList) {
Document docxml;
try {
docxml = SAXReaderUtil.read(journalArticle.getContent());
Node root = docxml.getRootElement();
List<Node> languageList = root.selectNodes("/root/dynamic-
element[#name='LanguageName']");
for (int i = 0; i < languageList.size(); i++)
{
Node languageNode = languageList.get(i);
String languageName =languageNode.selectNodes("/root/dynamic-
element[#name='LanguageName']/dynamic-content[#language-
id='en_US']").get(i).getText();
System.out.println("language Name : "+ languageName);
List<Node> documentLinkLabelList =languageNode.selectNodes("dynamic-element[#name='DocumentLinkLabel']/dynamic-element[#name='DocumentLink']");
for (int j = 0; j < documentLinkLabelList.size(); j++) {
Node languageNode1 = documentLinkLabelList.get(j);
String documentLinkName =languageNode.selectNodes("dynamic-
element[#name='DocumentLinkLabel']/dynamic-content[#language-id='en_US']").get(j).getText();
System.out.println(" document Link Lable Name : "+ documentLinkName);
String linkNameList=languageNode1.selectNodes("//dynamic-
element[#name='LanguageName']["+(i+1)+"]/dynamic-
element[#name='DocumentLinkLabel']/dynamic-element[#name='DocumentLink']/dynamic-content[#language-id='en_US']").get(j).getText();
System.out.println(" linkNameList : "+ linkNameList);
}
}
} catch (DocumentException e) {
e.printStackTrace();
}
}
You can't explicitly access DDList content in code. You have to get the xml of the record from the database and use SAXParserUtil and XPath expressions to read the values.

SharePoint Online BCS OData External Content Can't Update, View or Delete

Using Visual Studio 2013, I created an Entity Model over an existing database. Each table has a GUID for it's primary key. I created an MVC Web API project with related OData Bindings and Controllers.
Here is how I create the OData Binding;
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet<HRPosition>("HRPositions").EntityType.HasKey(p=>p.HTPositionGuid);
Here is a sample controller for the HRPositions Entity.
public class HRPositionsController : ODataController
{
private EFSEntities db = new EFSEntities();
// GET: odata/HRPositions
[EnableQuery]
public IQueryable<HRPosition> GetHRPositions()
{
return db.HRPositions;
}
// GET: odata/HRPositions(5)
[EnableQuery]
public SingleResult<HRPosition> GetHRPosition([FromODataUri] Guid key)
{
return SingleResult.Create(db.HRPositions.Where(hRPosition => hRPosition.HTPositionGuid == key));
}
// PUT: odata/HRPositions(5)
public async Task<IHttpActionResult> Put([FromODataUri] Guid key, Delta<HRPosition> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
HRPosition hRPosition = await db.HRPositions.FindAsync(key);
if (hRPosition == null)
{
return NotFound();
}
patch.Put(hRPosition);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!HRPositionExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(hRPosition);
}
// POST: odata/HRPositions
public async Task<IHttpActionResult> Post(HRPosition hRPosition)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
db.HRPositions.Add(hRPosition);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateException)
{
if (HRPositionExists(hRPosition.HTPositionGuid))
{
return Conflict();
}
else
{
throw;
}
}
return Created(hRPosition);
}
// PATCH: odata/HRPositions(5)
[AcceptVerbs("PATCH", "MERGE")]
public async Task<IHttpActionResult> Patch([FromODataUri] Guid key, Delta<HRPosition> patch)
{
Validate(patch.GetEntity());
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
HRPosition hRPosition = await db.HRPositions.FindAsync(key);
if (hRPosition == null)
{
return NotFound();
}
patch.Patch(hRPosition);
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!HRPositionExists(key))
{
return NotFound();
}
else
{
throw;
}
}
return Updated(hRPosition);
}
// DELETE: odata/HRPositions(5)
public async Task<IHttpActionResult> Delete([FromODataUri] Guid key)
{
HRPosition hRPosition = await db.HRPositions.FindAsync(key);
if (hRPosition == null)
{
return NotFound();
}
db.HRPositions.Remove(hRPosition);
await db.SaveChangesAsync();
return StatusCode(HttpStatusCode.NoContent);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
private bool HRPositionExists(Guid key)
{
return db.HRPositions.Count(e => e.HTPositionGuid == key) > 0;
}
}
Once the OData Service is deployed and using Fiddler I am able to query the Service endpoints and retrieve the full list of data as well as single entity data.
I then created a SharePoint App in which I create an External Content Type by referencing the OData service. This creates the ECT Model definitions for each endpoint.
Here is the ECT for HRPositions;
<?xml version="1.0" encoding="utf-16"?>
<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="EFSData" xmlns="http://schemas.microsoft.com/windows/2007/BusinessDataCatalog">
<LobSystems>
<LobSystem Name="EFSODATA" Type="OData">
<Properties>
<Property Name="ODataServiceMetadataUrl" Type="System.String">https://efsodataapi.azurewebsites.net/OData/$metadata</Property>
<Property Name="ODataServiceMetadataAuthenticationMode" Type="System.String">PassThrough</Property>
<Property Name="ODataServicesVersion" Type="System.String">2.0</Property>
</Properties>
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
<LobSystemInstances>
<LobSystemInstance Name="EFSODATA">
<Properties>
<Property Name="ODataServiceUrl" Type="System.String">https://efsodataapi.azurewebsites.net/OData</Property>
<Property Name="ODataServiceAuthenticationMode" Type="System.String">PassThrough</Property>
<Property Name="ODataFormat" Type="System.String">application/atom+xml</Property>
<Property Name="HttpHeaderSetAcceptLanguage" Type="System.Boolean">true</Property>
</Properties>
</LobSystemInstance>
</LobSystemInstances>
<Entities>
<Entity Name="HRPositions" DefaultDisplayName="HRPositions" Namespace="EFSData" Version="1.0.0.0" EstimatedInstanceCount="2000">
<Properties>
<Property Name="ExcludeFromOfflineClientForList" Type="System.String">False</Property>
</Properties>
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
<Identifiers>
<Identifier Name="HTPositionGuid" TypeName="System.Guid" />
</Identifiers>
<Methods>
<Method Name="CreateHRPosition" DefaultDisplayName="Create HRPosition" IsStatic="false">
<Properties>
<Property Name="ODataEntityUrl" Type="System.String">/HRPositions</Property>
</Properties>
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
<Parameters>
<Parameter Name="#HTPositionGuid" Direction="In">
<TypeDescriptor Name="HTPositionGuid" DefaultDisplayName="HTPositionGuid" TypeName="System.Guid" IdentifierName="HTPositionGuid" CreatorField="true" />
</Parameter>
<Parameter Name="#PosistionCode" Direction="In">
<TypeDescriptor Name="PosistionCode" DefaultDisplayName="PosistionCode" TypeName="System.String" CreatorField="true" />
</Parameter>
<Parameter Name="#PositionName" Direction="In">
<TypeDescriptor Name="PositionName" DefaultDisplayName="PositionName" TypeName="System.String" CreatorField="true" />
</Parameter>
<Parameter Name="#Description" Direction="In">
<TypeDescriptor Name="Description" DefaultDisplayName="Description" TypeName="System.String" CreatorField="true" />
</Parameter>
<Parameter Name="#CreateHRPosition" Direction="Return">
<TypeDescriptor Name="CreateHRPosition" DefaultDisplayName="CreateHRPosition" TypeName="Microsoft.BusinessData.Runtime.DynamicType">
<TypeDescriptors>
<TypeDescriptor Name="HTPositionGuid" DefaultDisplayName="HTPositionGuid" TypeName="System.Guid" IdentifierName="HTPositionGuid" ReadOnly="true" />
<TypeDescriptor Name="PosistionCode" DefaultDisplayName="PosistionCode" TypeName="System.String" />
<TypeDescriptor Name="PositionName" DefaultDisplayName="PositionName" TypeName="System.String" />
<TypeDescriptor Name="Description" DefaultDisplayName="Description" TypeName="System.String" />
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="CreateHRPosition" Type="Creator" ReturnParameterName="#CreateHRPosition" ReturnTypeDescriptorPath="CreateHRPosition">
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
</MethodInstance>
</MethodInstances>
</Method>
<Method Name="ReadSpecificHRPosition" DefaultDisplayName="Read Specific HRPosition" IsStatic="false">
<Properties>
<Property Name="ODataEntityUrl" Type="System.String">/HRPositions(HTPositionGuid=guid'#HTPositionGuid')</Property>
</Properties>
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
<Parameters>
<Parameter Name="#HTPositionGuid" Direction="In">
<TypeDescriptor Name="HTPositionGuid" DefaultDisplayName="HTPositionGuid" TypeName="System.Guid" IdentifierName="HTPositionGuid" />
</Parameter>
<Parameter Name="#HRPosition" Direction="Return">
<TypeDescriptor Name="HRPosition" DefaultDisplayName="HRPosition" TypeName="Microsoft.BusinessData.Runtime.DynamicType">
<TypeDescriptors>
<TypeDescriptor Name="HTPositionGuid" DefaultDisplayName="HTPositionGuid" TypeName="System.Guid" IdentifierName="HTPositionGuid" ReadOnly="true" />
<TypeDescriptor Name="PosistionCode" DefaultDisplayName="PosistionCode" TypeName="System.String" />
<TypeDescriptor Name="PositionName" DefaultDisplayName="PositionName" TypeName="System.String" />
<TypeDescriptor Name="Description" DefaultDisplayName="Description" TypeName="System.String" />
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadSpecificHRPosition" Type="SpecificFinder" Default="true" ReturnParameterName="#HRPosition" ReturnTypeDescriptorPath="HRPosition">
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
</MethodInstance>
</MethodInstances>
</Method>
<Method Name="ReadAllHRPosition" DefaultDisplayName="Read All HRPosition" IsStatic="false">
<Properties>
<Property Name="ODataEntityUrl" Type="System.String">/HRPositions?$top=#LimitHRPositionss</Property>
</Properties>
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
<FilterDescriptors>
<FilterDescriptor Name="LimitFilter" DefaultDisplayName="LimitFilter" Type="Limit" />
</FilterDescriptors>
<Parameters>
<Parameter Name="#LimitHRPositionss" Direction="In">
<TypeDescriptor Name="LimitHRPositionss" DefaultDisplayName="LimitHRPositionss" TypeName="System.Int32" AssociatedFilter="LimitFilter">
<Properties>
<Property Name="LogicalOperatorWithPrevious" Type="System.String">None</Property>
<Property Name="Order" Type="System.String">0</Property>
</Properties>
<DefaultValues>
<DefaultValue MethodInstanceName="ReadAllHRPosition" Type="System.Int32">100</DefaultValue>
</DefaultValues>
</TypeDescriptor>
</Parameter>
<Parameter Name="#HRPositions" Direction="Return">
<TypeDescriptor Name="HRPositions" DefaultDisplayName="HRPositions" TypeName="Microsoft.BusinessData.Runtime.IDynamicTypeEnumerator" IsCollection="true">
<TypeDescriptors>
<TypeDescriptor Name="HRPosition" DefaultDisplayName="HRPosition" TypeName="Microsoft.BusinessData.Runtime.DynamicType">
<TypeDescriptors>
<TypeDescriptor Name="HTPositionGuid" DefaultDisplayName="HTPositionGuid" TypeName="System.Guid" IdentifierName="HTPositionGuid" ReadOnly="true" />
<TypeDescriptor Name="PosistionCode" DefaultDisplayName="PosistionCode" TypeName="System.String" />
<TypeDescriptor Name="PositionName" DefaultDisplayName="PositionName" TypeName="System.String" />
<TypeDescriptor Name="Description" DefaultDisplayName="Description" TypeName="System.String" />
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="ReadAllHRPosition" Type="Finder" Default="true" ReturnParameterName="#HRPositions" ReturnTypeDescriptorPath="HRPositions">
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
</MethodInstance>
</MethodInstances>
</Method>
<Method Name="UpdateHRPosition" DefaultDisplayName="Update HRPosition" IsStatic="false">
<Properties>
<Property Name="ODataEntityUrl" Type="System.String">/HRPositions(HTPositionGuid=guid'#HTPositionGuid')</Property>
</Properties>
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
<Parameters>
<Parameter Name="#HTPositionGuid" Direction="In">
<TypeDescriptor Name="HTPositionGuid" DefaultDisplayName="HTPositionGuid" TypeName="System.Guid" IdentifierName="HTPositionGuid" UpdaterField="true" />
</Parameter>
<Parameter Name="#PosistionCode" Direction="In">
<TypeDescriptor Name="PosistionCode" DefaultDisplayName="PosistionCode" TypeName="System.String" UpdaterField="true" />
</Parameter>
<Parameter Name="#PositionName" Direction="In">
<TypeDescriptor Name="PositionName" DefaultDisplayName="PositionName" TypeName="System.String" UpdaterField="true" />
</Parameter>
<Parameter Name="#Description" Direction="In">
<TypeDescriptor Name="Description" DefaultDisplayName="Description" TypeName="System.String" UpdaterField="true" />
</Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="UpdateHRPosition" Type="Updater">
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
</MethodInstance>
</MethodInstances>
</Method>
<Method Name="DeleteHRPosition" DefaultDisplayName="Delete HRPosition" IsStatic="false">
<Properties>
<Property Name="ODataEntityUrl" Type="System.String">/HRPositions(HTPositionGuid=guid'#HTPositionGuid')</Property>
</Properties>
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
<Parameters>
<Parameter Name="#HTPositionGuid" Direction="In">
<TypeDescriptor Name="HTPositionGuid" DefaultDisplayName="HTPositionGuid" TypeName="System.Guid" IdentifierName="HTPositionGuid" />
</Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="DeleteHRPosition" Type="Deleter">
<AccessControlList>
<AccessControlEntry Principal="STS|SecurityTokenService|http://sharepoint.microsoft.com/claims/2009/08/isauthenticated|true|http://www.w3.org/2001/XMLSchema#string">
<Right BdcRight="Edit" />
<Right BdcRight="Execute" />
<Right BdcRight="SelectableInClients" />
<Right BdcRight="SetPermissions" />
</AccessControlEntry>
</AccessControlList>
</MethodInstance>
</MethodInstances>
</Method>
</Methods>
</Entity>
</Entities>
</LobSystem>
</LobSystems>
</Model>
I uploaded the ECT into SharePoint Online BCS and all looks fine;
From there I create an external list and reference the HRPositions ECT, which creates and SP List but is missing the primary key (which is the GUID).
This view shows the proper data;
I am able to add a new item to the list;
And it shows in the read all view;
But I can't edit, delete or view any list item as I get this error for each operation;
I attached to the OData Web Service and could see why the issue is occurring. Turns out the Auto-Generated External Control Types (ECT) within Visual Studio that were reflected off the OData Service have an issue in that for some reason it is formulating the request as /HRPositions(HTPositionGuid=guid'#HTPositionGuid');
It should really only be /HRPositions(guid'#HTPositionGuid');
Can anyone tell me why it's including the HTPositionGuid= within the Parameter list?
I can manually edit the code-generated ECT files for each entity but that seems silly.

Infinite Loop when parse XML File to Flat Flie. Bug SpringBatch or Not

I tried to parse an xml file to flatefile. All worked fine except at the end. In debug Mode the cause of the infinite loop is due to the method moveCursorToNextFragment( reader) in org.springframework.batch.item.xml.StaxEventItemRe ader.class.
More precisily in this part of method
while (reader.peek() != null && !reader.peek().isStartElement()) {
reader.nextEvent();
}
it seems that these conditions are not sufficient to recognize the end of the document.
I replace this part of code by this code to be sure the end of the document test
while (reader.peek() != null && !reader.peek().isStartElement() && !reader.peek().isEndDocument()) {
reader.nextEvent();
}
if (reader.peek() == null || reader.peek().isEndDocument()) {
return false;
}
below my context file and the link for an INSEE xmlfile : http://lei-france.insee.fr/Telechargement.do
I always taked the full file.
Here is my context file
<?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:batch="http://www.springframework.org/schema/batch"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/batch
http://www.springframework.org/schema/batch/spring-batch-2.2.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
p:dataSource-ref="dataSource"/>
<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"
p:jobRepository-ref="jobRepository"
p:taskExecutor-ref="taskExecutor" />
<bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"
p:dataSource-ref="dataSource"
p:transactionManager-ref="transactionManager" />
<bean id="taskExecutor" class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
<!-- DATASOURCE -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
<property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver" />
<property name="url"
value="jdbc:oracle:thin:#gulli:1521:OPE" />
<property name="username" value="xxxxxx" />
<property name="password" value="xxx" />
</bean>
<!-- ITEM READER -->
<bean id="itemReader" scope="step" class="org.springframework.batch.item.xml.StaxEventItemReader"
p:resource="insee/lei.xml"
p:fragmentRootElementName="LEIRecord"
p:unmarshaller-ref="inseeMarshaller" />
<bean id="inseeMarshaller" class="org.springframework.oxm.xstream.XStreamMarshaller"
p:autodetectAnnotations="true" p:encoding="UTF-8">
<property name="aliases">
<props>
<prop key="LEIDirectory">fr.cdn.dtc.etudes.emir.insee.LEIDirectory</prop>
<prop key="LEIRecord">fr.cdn.dtc.etudes.emir.insee.LEIRecord</prop>
<prop key="LegalEntity">fr.cdn.dtc.etudes.emir.insee.LegalEntity</prop>
<prop key="OtherIdentifiers">fr.cdn.dtc.etudes.emir.insee.OtherIdentifiers</prop>
<prop key="OtherNames">fr.cdn.dtc.etudes.emir.insee.OtherNames</prop>
<prop key="RelatedLEI">fr.cdn.dtc.etudes.emir.insee.RelatedLEI</prop>
<prop key="Event">fr.cdn.dtc.etudes.emir.insee.Event</prop>
<prop key="OtherAddresses">fr.cdn.dtc.etudes.emir.insee.OtherAddresses</prop>
</props>
</property>
</bean>
<!-- ITEM WRITER DELIMETED LENGTH-->
<bean id="itemWriterFile" class="org.springframework.batch.item.file.FlatFileItemWriter"
p:resource-ref="outputDelimitedResource"
p:lineAggregator-ref="lineAggregator"
p:shouldDeleteIfExists="true"
/>
<bean id="outputDelimitedResource" class="org.springframework.core.io.FileSystemResource">
<constructor-arg value="target/outputs/inseeOutput.txt" />
</bean>
<bean id="lineAggregator" class="org.springframework.batch.item.file.transform.DelimitedLineAggregator"
p:delimiter=";"
p:fieldExtractor-ref="fieldExtractor" />
<bean id="fieldExtractor" class="org.springframework.batch.item.file.transform.BeanWrapperFieldExtractor"
p:names="le" />
<batch:job id="inseeJob" job-repository="jobRepository" >
<batch:step id="inseeStep">
<batch:tasklet>
<batch:chunk reader="itemReader" writer="itemWriterFile" commit-interval="10" />
<batch:transaction-attributes isolation="DEFAULT" propagation="REQUIRED" timeout="30"/>
</batch:tasklet>
</batch:step>
</batch:job>
</beans>
Best Regards
Clément

How can I change granularity in highcharts?

Is it possible to change granularity on graphics? I have such schedule:
How can I change granularity? That data would be displayed not on days but on months. For example: Sep, Oct, Dec etc.
Code report:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 -->
<!-- 2016-01-31T20:54:38 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4_Landscape" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a0a85c1c-ef3e-4a4d-bca5-2569e695b407">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="ireport.jasperserver.report.resource" value="/public/Blank_A4_Landscape_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/public/Blank_A4_Landscape"/>
<subDataset name="Dataset1" uuid="7d75e5f3-311c-4d74-8f4f-13af8f33cc78">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
<queryString>
<![CDATA[SELECT top 100 * FROM Orders --WHERE "ORDERS"."SHIPPEDDATE" > NOW() - INTERVAL 30 DAY;]]>
</queryString>
<field name="ORDERID" class="java.lang.Integer"/>
<field name="CUSTOMERID" class="java.lang.String"/>
<field name="EMPLOYEEID" class="java.lang.Integer"/>
<field name="ORDERDATE" class="java.sql.Timestamp"/>
<field name="REQUIREDDATE" class="java.sql.Timestamp"/>
<field name="SHIPPEDDATE" class="java.sql.Timestamp"/>
<field name="SHIPVIA" class="java.lang.Integer"/>
<field name="FREIGHT" class="java.math.BigDecimal"/>
<field name="SHIPNAME" class="java.lang.String"/>
<field name="SHIPADDRESS" class="java.lang.String"/>
<field name="SHIPCITY" class="java.lang.String"/>
<field name="SHIPREGION" class="java.lang.String"/>
<field name="SHIPPOSTALCODE" class="java.lang.String"/>
<field name="SHIPCOUNTRY" class="java.lang.String"/>
</subDataset>
<queryString>
<![CDATA[Select * From Orders]]>
</queryString>
<field name="ORDERID" class="java.lang.Integer"/>
<field name="CUSTOMERID" class="java.lang.String"/>
<field name="EMPLOYEEID" class="java.lang.Integer"/>
<field name="ORDERDATE" class="java.sql.Timestamp"/>
<field name="REQUIREDDATE" class="java.sql.Timestamp"/>
<field name="SHIPPEDDATE" class="java.sql.Timestamp"/>
<field name="SHIPVIA" class="java.lang.Integer"/>
<field name="FREIGHT" class="java.math.BigDecimal"/>
<field name="SHIPNAME" class="java.lang.String"/>
<field name="SHIPADDRESS" class="java.lang.String"/>
<field name="SHIPCITY" class="java.lang.String"/>
<field name="SHIPREGION" class="java.lang.String"/>
<field name="SHIPPOSTALCODE" class="java.lang.String"/>
<field name="SHIPCOUNTRY" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="533" splitType="Stretch">
<componentElement>
<reportElement x="0" y="80" width="791" height="295" uuid="d836a1b4-c816-4f45-b0f8-0c3ac80a37a0"/>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="StackedColumn">
<hc:chartSetting name="default">
<hc:chartProperty name="chart.zoomType">
<hc:propertyExpression><![CDATA["xy"]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.enabled">
<hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.href">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="plotOptions.pie.showInLegend" value="true"/>
<hc:chartProperty name="title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="yAxis.title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.backgroundColor">
<hc:propertyExpression><![CDATA[new java.awt.Color(-16777216)]]></hc:propertyExpression>
</hc:chartProperty>
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset>
<dataset>
<datasetRun subDataset="Dataset1" uuid="a05e665b-8ead-41d2-a6e8-3ebad99d8c4d"/>
</dataset>
</multiAxisDataset>
<dataAxis axis="Rows">
<axisLevel name="Level1">
<labelExpression><![CDATA["Level Label expression"]]></labelExpression>
<axisLevelBucket class="java.lang.String">
<bucketExpression><![CDATA[$F{SHIPPEDDATE}]]></bucketExpression>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns"/>
<multiAxisMeasure name="Measure1" class="java.lang.Integer" calculation="DistinctCount">
<labelExpression><![CDATA["Total Orders"]]></labelExpression>
<valueExpression><![CDATA[$F{ORDERID}]]></valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Measure1"/>
</hc:chart>
</componentElement>
</band>
</title>
</jasperReport>
Change your query to group and count data on month
Example (mysql syntax)
SELECT DATE_FORMAT(SHIPPEDDATE,'%y %M') as LABEL, COUNT(ORDERID) AS CNT_ORDERID
FROM Orders
GROUP BY YEAR(SHIPPEDDATE), MONTH(SHIPPEDDATE)
ORDER BY SHIPPEDDATE
Note: this will change your fields in Dataset1 (just 2, LABEL and CNT_ORDERID) and bucketExpression, valueExpression will point to the new fields.

Resources