PMML: I can get the probability of a random forest class prediction, but why can i not get the confidence score? - random-forest

Below is a short snippet (excerpt) of my random forest in PMML format
<Segmentation multipleModelMethod="majorityVote">
<Segment id="0">
<True/>
<TreeModel functionName="classification" algorithmName="mtree" missingValueStrategy="lastPrediction" modelName="train">
<Node score="0" recordCount="450655">
<True/>
<ScoreDistribution value="0" recordCount="450291" confidence="0.9991" probability="0.99919"/>
<ScoreDistribution value="1" recordCount="364" confidence="7.3E-4" probability="8.1E-4"/>
<Node score="0" recordCount="44603">
<SimplePredicate operator="greaterThan" field="IDVAR_EUR" value="1112"/>
<ScoreDistribution value="0" recordCount="44239" confidence="0.99096" probability="0.99184"/>
<ScoreDistribution value="1" recordCount="364" confidence="0.00737" probability="0.00816"/>
When I have the following global Output specification I can get the predicted value and the probability of each class label:
<p:Output xmlns:p="http://www.dmg.org/PMML-4_3">
<p:OutputField name="probability1" optype="continuous" datatype="double" feature="probability" value="1"/>
<p:OutputField name="probability0" optype="continuous" datatype="double" feature="probability" value="0"/>
But when I add additional lines for confidence score output, then I get now result at all!
<p:Output xmlns:p="http://www.dmg.org/PMML-4_3">
<p:OutputField name="probability1" optype="continuous" datatype="double" feature="probability" value="1"/>
<p:OutputField name="probability0" optype="continuous" datatype="double" feature="probability" value="0"/>
<p:OutputField name="confidence1" optype="continuous" datatype="double" feature="confidence" value="1"/>
<p:OutputField name="confidence0" optype="continuous" datatype="double" feature="confidence" value="0"/>
</p:Output>
What am I missing?

Related

The function import is missing in the metadata of odata (odata created via CDS)

I want to create a function import in odata for use in sapui5 application. I create CDS view, add BOPF, create action SEND_MAIL, add annotation to odata. But function import tag is still missing in the metadata, i dont know why. And Exporting type in action inactive. Determination working, action not. What i do wrong?
СDS View:
#AbapCatalog.sqlViewName: 'ZGUT_FIORY_VW'
#AbapCatalog.compiler.compareFilter: true
#VDM.viewType: #COMPOSITE
#AbapCatalog.preserveKey: true
#AccessControl.authorizationCheck: #CHECK
#EndUserText.label: 'Test cds fiori list report'
// BOPF CRUD
#Metadata.allowExtensions: true
#ObjectModel:{
modelCategory: #BUSINESS_OBJECT,
compositionRoot: true,
transactionalProcessingEnabled: true,
createEnabled: true,
updateEnabled: true,
deleteEnabled: true,
writeActivePersistence: 'ZGUT_TEST_UI5',
semanticKey: ['id'],
representativeKey: 'id'
}
#OData:{
publish:true
}
#UI.headerInfo: {
typeName : 'Тестовое приложение fiori', // Заголовок списка
typeNamePlural: 'Тестовое приложение fiori' ,
title.value: 'Title', // Заголовок детальной страницы
description.value: 'bukrs_txt'
}
#Search.searchable: true
define view ZGUT_CDS_FIORY as select from zgut_test_ui5
association [1..1] to t001 as _bukrs on zgut_test_ui5.bukrs = _bukrs.bukrs
association [0..*] to ZGUT_CHART_AMOUNT as _chartamount on zgut_test_ui5.curr = _chartamount.Curr
association [1..1] to ZGUT_CHART_AMOUNT as _chartamount2 on zgut_test_ui5.id = _chartamount2.Ids
{
#UI.lineItem:[
{position: 30},
{ type: #FOR_ACTION, dataAction: 'BOPF:SEND_MAIL', position: 1, label: 'Send mail' }
]
#ObjectModel.mandatory: true
key id as Id,
// Another fields
}
BOPF:
Action:
Action class:
Metadata (i dont see here any function import, i dont know why) /sap/opu/odata/sap/ZGUT_CDS_FIORY_CDS/$metadata:
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData" Version="1.0">
<edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="http://host:50000/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_COMMON',Version='0001',SAP__Origin='LOCAL')/$value">
<edmx:Include Namespace="com.sap.vocabularies.Common.v1" Alias="Common"/>
</edmx:Reference>
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="ZGUT_CDS_FIORY_CDS" xml:lang="ru" sap:schema-version="1">
<EntityType Name="ZGUT_CDS_FIORYType" sap:label="Test cds fiori list report" sap:content-version="1">
<Key>
<PropertyRef Name="Id"/>
</Key>
<Property Name="Send_mail_ac" Type="Edm.Boolean" sap:label="Dyn. Action Control" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Id" Type="Edm.String" Nullable="false" MaxLength="6" sap:display-format="NonNegative" sap:label="Номер"/>
<Property Name="Descr" Type="Edm.String" sap:label="Описание"/>
<Property Name="target_amount" Type="Edm.String" MaxLength="6" sap:display-format="NonNegative" sap:label="Количество"/>
<Property Name="Title" Type="Edm.String" MaxLength="255" sap:label="Заголовок"/>
<Property Name="Bukrs" Type="Edm.String" MaxLength="4" sap:display-format="UpperCase" sap:label="БЕ"/>
<Property Name="bukrs_txt" Type="Edm.String" MaxLength="25" sap:label="Название фирмы" sap:creatable="false" sap:updatable="false"/>
<Property Name="Ab" Type="Edm.DateTime" Precision="0" sap:display-format="Date" sap:label="Дата начала"/>
<Property Name="Bis" Type="Edm.DateTime" Precision="0" sap:display-format="Date" sap:label="Дата конца"/>
<Property Name="Price" Type="Edm.Decimal" Precision="11" Scale="3" sap:label="Цена"/>
<Property Name="Curr" Type="Edm.String" MaxLength="3" sap:display-format="UpperCase" sap:label="Валюта"/>
<Property Name="Amount" Type="Edm.String" MaxLength="6" sap:display-format="NonNegative" sap:label="Количество"/>
<NavigationProperty Name="to_chartamount" Relationship="ZGUT_CDS_FIORY_CDS.assoc_17D58845CCECEF801599D15F5569B65F" FromRole="FromRole_assoc_17D58845CCECEF801599D15F5569B65F" ToRole="ToRole_assoc_17D58845CCECEF801599D15F5569B65F"/>
<NavigationProperty Name="to_chartamount2" Relationship="ZGUT_CDS_FIORY_CDS.assoc_84AF2B5FF9693A0A2F011CFC2072B09A" FromRole="FromRole_assoc_84AF2B5FF9693A0A2F011CFC2072B09A" ToRole="ToRole_assoc_84AF2B5FF9693A0A2F011CFC2072B09A"/>
</EntityType>
<EntityType Name="ZGUT_CHART_AMOUNTType" sap:semantics="aggregate" sap:label="ZGUT_CHART_AMOUNT" sap:content-version="1">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.String" Nullable="false"/>
<Property Name="Ids" Type="Edm.String" MaxLength="6" sap:aggregation-role="dimension" sap:display-format="NonNegative" sap:label="Номер"/>
<Property Name="Amounts" Type="Edm.String" MaxLength="6" sap:aggregation-role="measure" sap:display-format="NonNegative" sap:label="Количество" sap:filterable="false"/>
<Property Name="target_amount" Type="Edm.String" MaxLength="6" sap:aggregation-role="dimension" sap:display-format="NonNegative" sap:label="Количество"/>
<Property Name="Price" Type="Edm.Decimal" Precision="11" Scale="3" sap:aggregation-role="dimension" sap:label="Цена"/>
<Property Name="Curr" Type="Edm.String" MaxLength="3" sap:aggregation-role="dimension" sap:display-format="UpperCase" sap:label="Валюта"/>
</EntityType>
<Association Name="assoc_84AF2B5FF9693A0A2F011CFC2072B09A" sap:content-version="1">
<End Type="ZGUT_CDS_FIORY_CDS.ZGUT_CDS_FIORYType" Multiplicity="1" Role="FromRole_assoc_84AF2B5FF9693A0A2F011CFC2072B09A"/>
<End Type="ZGUT_CDS_FIORY_CDS.ZGUT_CHART_AMOUNTType" Multiplicity="1" Role="ToRole_assoc_84AF2B5FF9693A0A2F011CFC2072B09A"/>
</Association>
<Association Name="assoc_17D58845CCECEF801599D15F5569B65F" sap:content-version="1">
<End Type="ZGUT_CDS_FIORY_CDS.ZGUT_CDS_FIORYType" Multiplicity="1" Role="FromRole_assoc_17D58845CCECEF801599D15F5569B65F"/>
<End Type="ZGUT_CDS_FIORY_CDS.ZGUT_CHART_AMOUNTType" Multiplicity="*" Role="ToRole_assoc_17D58845CCECEF801599D15F5569B65F"/>
</Association>
<EntityContainer Name="ZGUT_CDS_FIORY_CDS_Entities" m:IsDefaultEntityContainer="true" sap:supported-formats="atom json xlsx">
<EntitySet Name="ZGUT_CDS_FIORY" EntityType="ZGUT_CDS_FIORY_CDS.ZGUT_CDS_FIORYType" sap:searchable="true" sap:content-version="1"/>
<EntitySet Name="ZGUT_CHART_AMOUNT" EntityType="ZGUT_CDS_FIORY_CDS.ZGUT_CHART_AMOUNTType" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1"/>
<AssociationSet Name="assoc_17D58845CCECEF801599D15F5569B65F" Association="ZGUT_CDS_FIORY_CDS.assoc_17D58845CCECEF801599D15F5569B65F" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
<End EntitySet="ZGUT_CDS_FIORY" Role="FromRole_assoc_17D58845CCECEF801599D15F5569B65F"/>
<End EntitySet="ZGUT_CHART_AMOUNT" Role="ToRole_assoc_17D58845CCECEF801599D15F5569B65F"/>
</AssociationSet>
<AssociationSet Name="assoc_84AF2B5FF9693A0A2F011CFC2072B09A" Association="ZGUT_CDS_FIORY_CDS.assoc_84AF2B5FF9693A0A2F011CFC2072B09A" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:content-version="1">
<End EntitySet="ZGUT_CDS_FIORY" Role="FromRole_assoc_84AF2B5FF9693A0A2F011CFC2072B09A"/>
<End EntitySet="ZGUT_CHART_AMOUNT" Role="ToRole_assoc_84AF2B5FF9693A0A2F011CFC2072B09A"/>
</AssociationSet>
</EntityContainer>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self" href="http://host:50000/sap/opu/odata/sap/ZGUT_CDS_FIORY_CDS/$metadata"/>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="latest-version" href="http://host:50000/sap/opu/odata/sap/ZGUT_CDS_FIORY_CDS/$metadata"/>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
I solved the issue by choosing the exporting type in the actions list and reactivate the bopf

xslt - for-each-group challenge

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>

Cytoskape xgmml edge.color and edge weight is not getting applied, how should I change this?

I made an .xgmml file to load into cytoscape. In the .xgmml I have different weights and colours for the edges (See bottom for the .xgmml file). However, when I load the .xgmml file into cytoscape and apply layout, the edges have the same weights and colour.
How can I apply the .xgmml edge weights and colours to the network?
<?xml version="1.0" encoding="UTF-8" ?>
<graph label="Depression" directed="0" xmlns="http://www.cs.rpi.edu/XGMML" schemaLocation="http://www.cs.rpi.edu/~puninj/XGMML/xgmml.xsd">
<node id="A" label="A">
<graphics type="rectangle" fill="#F8FF00"/>
<att name="description" value="A"/>
</node>
<node id="B" label="B">
<graphics type="triangle" fill="#CC51FF"/>
<att name="description" value="B"/>
</node>
<node id="C" label="C">
<graphics type="triangle" fill="#CC51FF"/>
<att name="description" value="C"/>
</node>
<edge id="rs2" label="TRANS" source="A" target="B" weight="10">
<att name="edge.shape" value="circle"/>
<att name="edge.color" value="51,153,25"/>
</edge>
<edge id="rs1" label="CIS" source="A" target="C" weight="1">
<att name="edge.shape" value="circle"/>
<att name="edge.color" value="0,153,0"/>
</edge>
</graph>
We don't use those properties. For color and width, we encode them as attributes in the graphic line:
<edge id="732" label="YDR412W (pp) YPR119W" source="386" target="382" cy:directed="1">
<att name="shared name" value="YDR412W (pp) YPR119W" type="string" cy:type="String"/>
<att name="shared interaction" value="pp" type="string" cy:type="String"/>
<att name="name" value="YDR412W (pp) YPR119W" type="string" cy:type="String"/>
<att name="selected" value="1" type="boolean" cy:type="Boolean"/>
<att name="interaction" value="pp" type="string" cy:type="String"/>
<att name="EdgeBetweenness" value="18040.0" type="real" cy:type="Double"/>
<att name="isInPath" value="0" type="boolean" cy:type="Boolean" cy:hidden="1"/>
<graphics width="5.0" fill="#FF00FF">
<att name="EDGE_STROKE_SELECTED_PAINT" value="#FF0000" type="string" cy:type="String"/>
<att name="EDGE_SELECTED" value="true" type="string" cy:type="String"/>
<att name="EDGE_TOOLTIP" value="" type="string" cy:type="String"/>
<att name="EDGE_LABEL_COLOR" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_BEND" value="" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_UNSELECTED_PAINT" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SELECTED_PAINT" value="#FFFF00" type="string" cy:type="String"/>
<att name="EDGE_LABEL" value="" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SIZE" value="6.0" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SIZE" value="6.0" type="string" cy:type="String"/>
<att name="EDGE_CURVED" value="true" type="string" cy:type="String"/>
<att name="EDGE_VISIBLE" value="true" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SELECTED_PAINT" value="#FFFF00" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SHAPE" value="NONE" type="string" cy:type="String"/>
<att name="EDGE_LABEL_TRANSPARENCY" value="255" type="string" cy:type="String"/>
<att name="EDGE_TRANSPARENCY" value="170" type="string" cy:type="String"/>
<att name="EDGE_LINE_TYPE" value="SOLID" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_UNSELECTED_PAINT" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_LABEL_FONT_FACE" value="Dialog.plain,plain,10" type="string" cy:type="String"/>
<att name="EDGE_LABEL_FONT_SIZE" value="10" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SHAPE" value="NONE" type="string" cy:type="String"/>
<att name="EDGE_LABEL_WIDTH" value="200.0" type="string" cy:type="String"/>
</graphics>
</edge>
This results in a magenta edge of width 5.
-- scooter

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.

"An item with the same key has already been added" error when calling Context AddObject

Can somebody please help me with this error. I have an ASP.NET WebApp, within the Entity Model I have an entity called tb_AdminUser, with a UserID property as GUID. This is also the Entity Key. The entity is not in any relationship with any other entity. I get the error when calling the AddObject() function.
In my code I call the following...
SQL2008R2_824852_leapdbEntities temp = new SQL2008R2_824852_leapdbEntities();
tb_AdminUser au = new tb_AdminUser();
au.UserID = Guid.NewGuid();
au.Username = "TEST";
au.Password = "pete#webinspired.net";
au.LockedOut = false;
au.Surname = "Feehan";
au.Forename = "Pete";
temp.tb_AdminUser.AddObject(au); //error occurs here
temp.SaveChanges();
The EDMX XML Code is as follows
<EntityType Name="tb_AdminUser">
<Key>
<PropertyRef Name="UserID" />
</Key>
<Property Name="UserID" Type="uniqueidentifier" Nullable="false" />
<Property Name="Forename" Type="nvarchar" Nullable="false" MaxLength="50" />
<Property Name="Surname" Type="nvarchar" Nullable="false" MaxLength="50" />
<Property Name="Username" Type="nvarchar" Nullable="false" MaxLength="50" />
<Property Name="Password" Type="nvarchar" Nullable="false" MaxLength="50" />
<Property Name="LockedOut" Type="bit" Nullable="false" />
</EntityType>

Resources