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

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

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

How do I get an attribute using the 'amazon-ecs' gem?

I am using Amazon Product Advertising API (amazon-ecs) gem, but I am using the item_lookup method instead of item_search, which is the only one documented.
I am looking to return the item TradeInValue but I am confused as to how to do that. It is clearly being returned, but I am not sure how to parse it.
This is the call:
Amazon::Ecs.item_lookup('9780521153348', :response_group => 'ItemAttributes', :id_type => 'ISBN', :search_index => 'Books')
And this is the return, which I am not sure what to do with. The methods in amazon-ecs don't seem to work for item_lookup and XPath isn't working either:
#<Amazon::Ecs::Response:0x007ff3325250d0 #doc=#<Nokogiri::XML::Document:0x3ff9992927a0 name="document" children=[#<Nokogiri::XML::Element:0x3ff997067414 name="ItemLookupResponse" children=[#<Nokogiri::XML::Element:0x3ff99706b924 name="OperationRequest" children=[#<Nokogiri::XML::Element:0x3ff99706b474 name="HTTPHeaders" children=[#<Nokogiri::XML::Element:0x3ff99706f470 name="Header" attributes=[#<Nokogiri::XML::Attr:0x3ff99706f0ec name="Name" value="UserAgent">, #<Nokogiri::XML::Attr:0x3ff99706f074 name="Value" value="Ruby">]>]>, #<Nokogiri::XML::Element:0x3ff9970760cc name="RequestId" children=[#<Nokogiri::XML::Text:0x3ff999296468 "053626d3-e3cd-47d2-bc8b-7ac6a0c5f6d2">]>, #<Nokogiri::XML::Element:0x3ff99929f6f8 name="Arguments" children=[#<Nokogiri::XML::Element:0x3ff9992a3bb8 name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992a3960 name="Name" value="Operation">, #<Nokogiri::XML::Attr:0x3ff9992a3938 name="Value" value="ItemLookup">]>, #<Nokogiri::XML::Element:0x3ff9992a73f8 name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992a7204 name="Name" value="Signature">, #<Nokogiri::XML::Attr:0x3ff9992a7010 name="Value" value="IMd3D0DGgAcaLR6XcuObzdAgFbOya7mbIRtZFbNijVA=">]>, #<Nokogiri::XML::Element:0x3ff9992ab41c name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992ab2dc name="Name" value="AssociateTag">, #<Nokogiri::XML::Attr:0x3ff9992ab2c8 name="Value" value="textscom-20">]>, #<Nokogiri::XML::Element:0x3ff9992af774 name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992af6ac name="Name" value="ItemId">, #<Nokogiri::XML::Attr:0x3ff9992af698 name="Value" value="9780521153348">]>, #<Nokogiri::XML::Element:0x3ff9992b0c3c name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992b0b4c name="Name" value="IdType">, #<Nokogiri::XML::Attr:0x3ff9992b0b10 name="Value" value="ISBN">]>, #<Nokogiri::XML::Element:0x3ff9992b7794 name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992b7578 name="Name" value="AWSAccessKeyId">, #<Nokogiri::XML::Attr:0x3ff9992b7550 name="Value" value="AKIAJLOCEGWTFXZKXLEQ">]>, #<Nokogiri::XML::Element:0x3ff9992b2244 name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992b208c name="Name" value="Timestamp">, #<Nokogiri::XML::Attr:0x3ff9992b2064 name="Value" value="2013-05-07T17:46:35Z">]>, #<Nokogiri::XML::Element:0x3ff9992bffc0 name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992bff20 name="Name" value="ResponseGroup">, #<Nokogiri::XML::Attr:0x3ff9992bff0c name="Value" value="ItemAttributes">]>, #<Nokogiri::XML::Element:0x3ff9992be1e8 name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992c38c8 name="Name" value="SearchIndex">, #<Nokogiri::XML::Attr:0x3ff9992c3a30 name="Value" value="Books">]>, #<Nokogiri::XML::Element:0x3ff9992ca95c name="Argument" attributes=[#<Nokogiri::XML::Attr:0x3ff9992ca344 name="Name" value="Service">, #<Nokogiri::XML::Attr:0x3ff9992ca2a4 name="Value" value="AWSECommerceService">]>]>, #<Nokogiri::XML::Element:0x3ff9992d3d7c name="RequestProcessingTime" children=[#<Nokogiri::XML::Text:0x3ff9992d382c "0.0289960000000000">]>]>, #<Nokogiri::XML::Element:0x3ff9992d7eb8 name="Items" children=[#<Nokogiri::XML::Element:0x3ff9992d7148 name="Request" children=[#<Nokogiri::XML::Element:0x3ff9992d6900 name="IsValid" children=[#<Nokogiri::XML::Text:0x3ff9992dae10 "True">]>, #<Nokogiri::XML::Element:0x3ff9992da758 name="ItemLookupRequest" children=[#<Nokogiri::XML::Element:0x3ff9992df884 name="IdType" children=[#<Nokogiri::XML::Text:0x3ff9992df014 "ISBN">]>, #<Nokogiri::XML::Element:0x3ff9992de678 name="ItemId" children=[#<Nokogiri::XML::Text:0x3ff9992e2e1c "9780521153348">]>, #<Nokogiri::XML::Element:0x3ff9983a5580 name="ResponseGroup" children=[#<Nokogiri::XML::Text:0x3ff9983a59b8 "ItemAttributes">]>, #<Nokogiri::XML::Element:0x3ff9983a510c name="SearchIndex" children=[#<Nokogiri::XML::Text:0x3ff9983a43c4 "Books">]>, #<Nokogiri::XML::Element:0x3ff9983a925c name="VariationPage" children=[#<Nokogiri::XML::Text:0x3ff9983a8d0c "All">]>]>]>, #<Nokogiri::XML::Element:0x3ff9983a8244 name="Item" children=[#<Nokogiri::XML::Element:0x3ff9983add70 name="ASIN" children=[#<Nokogiri::XML::Text:0x3ff9983ad6f4 "0521153344">]>, #<Nokogiri::XML::Element:0x3ff9983acc04 name="DetailPageURL" children=[#<Nokogiri::XML::Text:0x3ff9983ac4d4 "http://www.amazon.com/Turgot-Progress-Sociology-Economics-Philosophical/dp/0521153344%3FSubscriptionId%3DAKIAJLOCEGWTFXZKXLEQ%26tag%3Dtextscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0521153344">]>, #<Nokogiri::XML::Element:0x3ff9983b1768 name="ItemLinks" children=[#<Nokogiri::XML::Element:0x3ff9983b1024 name="ItemLink" children=[#<Nokogiri::XML::Element:0x3ff9983b0a20 name="Description" children=[#<Nokogiri::XML::Text:0x3ff9983b028c "Technical Details">]>, #<Nokogiri::XML::Element:0x3ff9983b5b60 name="URL" children=[#<Nokogiri::XML::Text:0x3ff9983b5638 "http://www.amazon.com/Turgot-Progress-Sociology-Economics-Philosophical/dp/tech-data/0521153344%3FSubscriptionId%3DAKIAJLOCEGWTFXZKXLEQ%26tag%3Dtextscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0521153344">]>]>, #<Nokogiri::XML::Element:0x3ff9983b5034 name="ItemLink" children=[#<Nokogiri::XML::Element:0x3ff9983b4a58 name="Description" children=[#<Nokogiri::XML::Text:0x3ff9983b46d4 "Add To Baby Registry">]>, #<Nokogiri::XML::Element:0x3ff9983b406c name="URL" children=[#<Nokogiri::XML::Text:0x3ff9983b9ad0 "http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D0521153344%26SubscriptionId%3DAKIAJLOCEGWTFXZKXLEQ%26tag%3Dtextscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0521153344">]>]>, #<Nokogiri::XML::Element:0x3ff9983b95d0 name="ItemLink" children=[#<Nokogiri::XML::Element:0x3ff9983b9080 name="Description" children=[#<Nokogiri::XML::Text:0x3ff9983b8cd4 "Add To Wedding Registry">]>, #<Nokogiri::XML::Element:0x3ff9983b8a2c name="URL" children=[#<Nokogiri::XML::Text:0x3ff9983b834c "http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D0521153344%26SubscriptionId%3DAKIAJLOCEGWTFXZKXLEQ%26tag%3Dtextscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0521153344">]>]>, #<Nokogiri::XML::Element:0x3ff9983bcff0 name="ItemLink" children=[#<Nokogiri::XML::Element:0x3ff9983bc49c name="Description" children=[#<Nokogiri::XML::Text:0x3ff9983bc0f0 "Add To Wishlist">]>, #<Nokogiri::XML::Element:0x3ff9983c1b40 name="URL" children=[#<Nokogiri::XML::Text:0x3ff9983c158c "http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D0521153344%26SubscriptionId%3DAKIAJLOCEGWTFXZKXLEQ%26tag%3Dtextscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0521153344">]>]>, #<Nokogiri::XML::Element:0x3ff9983c01dc name="ItemLink" children=[#<Nokogiri::XML::Element:0x3ff9983c5da8 name="Description" children=[#<Nokogiri::XML::Text:0x3ff9983c595c "Tell A Friend">]>, #<Nokogiri::XML::Element:0x3ff9983c5358 name="URL" children=[#<Nokogiri::XML::Text:0x3ff9983c4674 "http://www.amazon.com/gp/pdp/taf/0521153344%3FSubscriptionId%3DAKIAJLOCEGWTFXZKXLEQ%26tag%3Dtextscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0521153344">]>]>, #<Nokogiri::XML::Element:0x3ff9983c9750 name="ItemLink" children=[#<Nokogiri::XML::Element:0x3ff9983c8828 name="Description" children=[#<Nokogiri::XML::Text:0x3ff9983cc888 "All Customer Reviews">]>, #<Nokogiri::XML::Element:0x3ff9983d1f18 name="URL" children=[#<Nokogiri::XML::Text:0x3ff9983d19c8 "http://www.amazon.com/review/product/0521153344%3FSubscriptionId%3DAKIAJLOCEGWTFXZKXLEQ%26tag%3Dtextscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0521153344">]>]>, #<Nokogiri::XML::Element:0x3ff9983d152c name="ItemLink" children=[#<Nokogiri::XML::Element:0x3ff9983d107c name="Description" children=[#<Nokogiri::XML::Text:0x3ff9983d02d0 "All Offers">]>, #<Nokogiri::XML::Element:0x3ff9983d5730 name="URL" children=[#<Nokogiri::XML::Text:0x3ff9983d4e48 "http://www.amazon.com/gp/offer-listing/0521153344%3FSubscriptionId%3DAKIAJLOCEGWTFXZKXLEQ%26tag%3Dtextscom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D0521153344">]>]>]>, #<Nokogiri::XML::Element:0x3ff9983dd00c name="ItemAttributes" children=[#<Nokogiri::XML::Element:0x3ff9983dc33c name="Author" children=[#<Nokogiri::XML::Text:0x3ff9983e1364 "Ronald L. Meek">]>, #<Nokogiri::XML::Element:0x3ff9983e0af4 name="Binding" children=[#<Nokogiri::XML::Text:0x3ff9983e04a0 "Paperback">]>, #<Nokogiri::XML::Element:0x3ff9983e0068 name="EAN" children=[#<Nokogiri::XML::Text:0x3ff9983e5c34 "9780521153348">]>, #<Nokogiri::XML::Element:0x3ff9983e5270 name="EANList" children=[#<Nokogiri::XML::Element:0x3ff9983e4424 name="EANListElement" children=[#<Nokogiri::XML::Text:0x3ff9983d7c60 "9780521153348">]>]>, #<Nokogiri::XML::Element:0x3ff9983d7724 name="ISBN" children=[#<Nokogiri::XML::Text:0x3ff9983d7120 "0521153344">]>, #<Nokogiri::XML::Element:0x3ff9983d6cc0 name="IsEligibleForTradeIn" children=[#<Nokogiri::XML::Text:0x3ff9983d6130 "1">]>, #<Nokogiri::XML::Element:0x3ff9983d99c0 name="ItemDimensions" children=[#<Nokogiri::XML::Element:0x3ff9983d963c name="Height" attributes=[#<Nokogiri::XML::Attr:0x3ff9983d959c name="Units" value="hundredths-inches">] children=[#<Nokogiri::XML::Text:0x3ff9983d83cc "902">]>, #<Nokogiri::XML::Element:0x3ff9983ed7a4 name="Length" attributes=[#<Nokogiri::XML::Attr:0x3ff9983ed448 name="Units" value="hundredths-inches">] children=[#<Nokogiri::XML::Text:0x3ff9983f3244 "598">]>, #<Nokogiri::XML::Element:0x3ff9983f290c name="Weight" attributes=[#<Nokogiri::XML::Attr:0x3ff9983f26f0 name="Units" value="hundredths-pounds">] children=[#<Nokogiri::XML::Text:0x3ff9983e93c0 "64">]>, #<Nokogiri::XML::Element:0x3ff9983e8f38 name="Width" attributes=[#<Nokogiri::XML::Attr:0x3ff9983e8e34 name="Units" value="hundredths-inches">] children=[#<Nokogiri::XML::Text:0x3ff9983efa2c "43">]>]>, #<Nokogiri::XML::Element:0x3ff9983ef144 name="Label" children=[#<Nokogiri::XML::Text:0x3ff9983eecbc "Cambridge University Press">]>, #<Nokogiri::XML::Element:0x3ff9983ee988 name="Languages" children=[#<Nokogiri::XML::Element:0x3ff9983ee410 name="Language" children=[#<Nokogiri::XML::Element:0x3ff99a80009c name="Name" children=[#<Nokogiri::XML::Text:0x3ff99a801a14 "English">]>, #<Nokogiri::XML::Element:0x3ff99a8010f0 name="Type" children=[#<Nokogiri::XML::Text:0x3ff99a800948 "Unknown">]>]>, #<Nokogiri::XML::Element:0x3ff99a800574 name="Language" children=[#<Nokogiri::XML::Element:0x3ff99a8002b8 name="Name" children=[#<Nokogiri::XML::Text:0x3ff99a80419c "English">]>, #<Nokogiri::XML::Element:0x3ff99a805484 name="Type" children=[#<Nokogiri::XML::Text:0x3ff99a804b10 "Original Language">]>]>, #<Nokogiri::XML::Element:0x3ff99a804070 name="Language" children=[#<Nokogiri::XML::Element:0x3ff99a808d64 name="Name" children=[#<Nokogiri::XML::Text:0x3ff99a80d6d4 "English">]>, #<Nokogiri::XML::Element:0x3ff99a80c680 name="Type" children=[#<Nokogiri::XML::Text:0x3ff99a8110a4 "Published">]>]>]>, #<Nokogiri::XML::Element:0x3ff99a8157a8 name="ListPrice" children=[#<Nokogiri::XML::Element:0x3ff99a8142cc name="Amount" children=[#<Nokogiri::XML::Text:0x3ff99a819358 "2899">]>, #<Nokogiri::XML::Element:0x3ff99a818d04 name="CurrencyCode" children=[#<Nokogiri::XML::Text:0x3ff99a818764 "USD">]>, #<Nokogiri::XML::Element:0x3ff99a81c8a0 name="FormattedPrice" children=[#<Nokogiri::XML::Text:0x3ff99a81d534 "$28.99">]>]>, #<Nokogiri::XML::Element:0x3ff99a81ccb0 name="Manufacturer" children=[#<Nokogiri::XML::Text:0x3ff99a81c648 "Cambridge University Press">]>, #<Nokogiri::XML::Element:0x3ff99a81c2d8 name="NumberOfItems" children=[#<Nokogiri::XML::Text:0x3ff99a821cec "1">]>, #<Nokogiri::XML::Element:0x3ff99a821580 name="NumberOfPages" children=[#<Nokogiri::XML::Text:0x3ff99a82043c "194">]>, #<Nokogiri::XML::Element:0x3ff99a825bbc name="PackageDimensions" children=[#<Nokogiri::XML::Element:0x3ff99a824cd0 name="Height" attributes=[#<Nokogiri::XML::Attr:0x3ff99a824b68 name="Units" value="hundredths-inches">] children=[#<Nokogiri::XML::Text:0x3ff99a824168 "63">]>, #<Nokogiri::XML::Element:0x3ff99a829d98 name="Length" attributes=[#<Nokogiri::XML::Attr:0x3ff99a829d20 name="Units" value="hundredths-inches">] children=[#<Nokogiri::XML::Text:0x3ff99a828eac "890">]>, #<Nokogiri::XML::Element:0x3ff99a828c68 name="Weight" attributes=[#<Nokogiri::XML::Attr:0x3ff99a828b8c name="Units" value="hundredths-pounds">] children=[#<Nokogiri::XML::Text:0x3ff99a828074 "66">]>, #<Nokogiri::XML::Element:0x3ff9983f69d0 name="Width" attributes=[#<Nokogiri::XML::Attr:0x3ff9983f68f4 name="Units" value="hundredths-inches">] children=[#<Nokogiri::XML::Text:0x3ff997c6340c "598">]>]>, #<Nokogiri::XML::Element:0x3ff997c62cf0 name="ProductGroup" children=[#<Nokogiri::XML::Text:0x3ff997c623b8 "Book">]>, #<Nokogiri::XML::Element:0x3ff9961e1d2c name="ProductTypeName" children=[#<Nokogiri::XML::Text:0x3ff9961e0e40 "ABIS_BOOK">]>, #<Nokogiri::XML::Element:0x3ff9961e0508 name="PublicationDate" children=[#<Nokogiri::XML::Text:0x3ff9961e7b28 "2010-06-10">]>, #<Nokogiri::XML::Element:0x3ff9961e75c4 name="Publisher" children=[#<Nokogiri::XML::Text:0x3ff9961e727c "Cambridge University Press">]>, #<Nokogiri::XML::Element:0x3ff9961e70b0 name="SKU" children=[#<Nokogiri::XML::Text:0x3ff9961e6bc4 "Y9780521153348">]>, #<Nokogiri::XML::Element:0x3ff9961e682c name="Studio" children=[#<Nokogiri::XML::Text:0x3ff9961ebc64 "Cambridge University Press">]>, #<Nokogiri::XML::Element:0x3ff9961ea120 name="Title" children=[#<Nokogiri::XML::Text:0x3ff996f67ac8 "Turgot on Progress, Sociology and Economics: A Philosophical Review of the Successive Advances of the Human Mind on Universal History Reflections on ... in the History and Theory of Politics)">]>, #<Nokogiri::XML::Element:0x3ff996f676cc name="TradeInValue" children=[#<Nokogiri::XML::Element:0x3ff996f67028 name="Amount" children=[#<Nokogiri::XML::Text:0x3ff996f66ca4 "310">]>, #<Nokogiri::XML::Element:0x3ff996f669d4 name="CurrencyCode" children=[#<Nokogiri::XML::Text:0x3ff996f663a8 "USD">]>, #<Nokogiri::XML::Element:0x3ff996fadbb8 name="FormattedPrice" children=[#<Nokogiri::XML::Text:0x3ff996fad014 "$3.10">]>]>]>]>]>]>]>>
Okay, I figured it out. I was trying to treat item_lookup as a single return value, rather than a hash the way search is returned.
item_lookup is basically the same as item_search:
res = Amazon::Ecs.item_lookup('9780521153348', :response_group => 'ItemAttributes', :id_type => 'ISBN', :search_index => 'Books')
res.items.each do |item|
puts item.get('ItemAttributes/TradeInValue/FormattedPrice')
end

<prefwindow> sizing itself to the wrong tab when browser.preferences.animateFadeIn == true

I've run into (yet another) bug with the preferences screen of my extension. When browser.preferences.animateFadeIn is set to true (as it is on Mac), the window size should change to fit the content exactly on switching panes. Instead it is sized to the largest pane when the window is opened, but it changes by as much as it should when switching panes. If that's not too clear, here is a screencast: http://files.droplr.com/files/22337488/4IVT.ScreenFlow.mov
Even after removing all <script> elements, and most of the panes, the error still happens:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>
<?xml-stylesheet href="chrome://nextplease/skin/nextpleasePreferences.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://nextplease/locale/nextplease.dtd">
<prefwindow id="nextpleaseprefs" title="&options.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="nextplease.images" label="&options.images.title;" image="chrome://nextplease/skin/Image.png">
<preferences>
<preference id="nextimages" name="nextplease.nextimage.expr0" type="unichar"/>
<preference id="previmages" name="nextplease.previmage.expr0" type="unichar"/>
<preference id="firstimages" name="nextplease.firstimage.expr0" type="unichar"/>
<preference id="lastimages" name="nextplease.lastimage.expr0" type="unichar"/>
</preferences>
<hbox flex="1">
<listbox width="80" onselect="nextplease.selectedPanelChanged(this);">
<listitem label="&options.next;" selected="true"/>
<listitem label="&options.prev;"/>
<listitem label="&options.first;"/>
<listitem label="&options.last;"/>
</listbox>
<separator class="groove" orient="vertical" style="opacity: 0.5; margin-top: 5px; margin-bottom: 5px;"/>
<vbox flex="1">
<deck flex="1">
<listbox id="Next_Image_list" seltype="multiple" flex="1"
onkeypress="nextplease.removeSelectedOnDelete(event, this);" onselect="nextplease.enableDisableRemoveButton(this);" onchange="nextplease.syncListboxToPref(this);"/>
<listbox id="Prev_Image_list" seltype="multiple" flex="1"
onkeypress="nextplease.removeSelectedOnDelete(event, this);" onselect="nextplease.enableDisableRemoveButton(this);" onchange="nextplease.syncListboxToPref(this);"/>
<listbox id="First_Image_list" seltype="multiple" flex="1"
onkeypress="nextplease.removeSelectedOnDelete(event, this);" onselect="nextplease.enableDisableRemoveButton(this);" onchange="nextplease.syncListboxToPref(this);"/>
<listbox id="Last_Image_list" seltype="multiple" flex="1"
onkeypress="nextplease.removeSelectedOnDelete(event, this);" onselect="nextplease.enableDisableRemoveButton(this);" onchange="nextplease.syncListboxToPref(this);"/>
</deck>
<hbox id="images_dummy_texts" collapsed="true">
<textbox id="Next_Image_dummy_text" preference="nextimages" onchange="nextplease.syncPrefToListbox(this);"/>
<textbox id="Prev_Image_dummy_text" preference="previmages" onchange="nextplease.syncPrefToListbox(this);"/>
<textbox id="First_Image_dummy_text" preference="firstimages" onchange="nextplease.syncPrefToListbox(this);"/>
<textbox id="Last_Image_dummy_text" preference="lastimages" onchange="nextplease.syncPrefToListbox(this);"/>
</hbox>
<separator class="thin"/>
<hbox align="stretch">
<textbox type="text" maxlength="256" onkeypress="nextplease.addOnReturn(event, this);"/>
<button label="&options.add;" style="margin-left: 0"
oncommand="nextplease.addToListbox(this);"/>
<spacer flex="1" minwidth="15"/>
<button label="&options.removeSelected;" disabled="true" style="margin-right: 2px"
oncommand="nextplease.removeSelectedFromListbox(this);"/>
<spacer flex="1" minwidth="40"/>
<button label="&options.restoreDefault;"
oncommand="nextplease.restoreDefaultListbox(this);"/>
</hbox>
</vbox>
</hbox>
</prefpane>
<prefpane id="nextplease.debug" label="&options.debug.title;" image="chrome://nextplease/skin/Settings.png">
<preferences>
<preference id="log" name="nextplease.log" type="bool"/>
<preference id="log.detailed" name="nextplease.log.detailed" type="bool"/>
<preference id="log.file" name="nextplease.log.file" type="bool"/>
<preference id="highlight" name="nextplease.highlight" type="bool"/>
<preference id="highlight.color" name="nextplease.highlight.color" type="string"/>
<preference id="highlight.prefetched" name="nextplease.highlight.prefetched" type="bool"/>
<preference id="highlight.prefetched.color" name="nextplease.highlight.prefetched.color" type="string"/>
</preferences>
<vbox>
<checkbox label="&options.log.normal;" preference="log"/>
<checkbox label="&options.log.detailed;" preference="log.detailed"/>
<!--<checkbox id="nextplease.log.file" label="&options.log.file;" preference="log.file/>-->
<separator/>
<hbox>
<checkbox label="&options.highlight;"
preference="highlight"
oncommand="nextplease.enableDisableHighlightColorPickers();"/>
<colorpicker type="button" preference="highlight.color"/>
</hbox>
<hbox>
<checkbox label="&options.highlight.prefetched;"
preference="highlight.prefetched"
oncommand="nextplease.enableDisableHighlightColorPickers();"/>
<colorpicker type="button" preference="highlight.prefetched.color"/>
</hbox>
</vbox>
</prefpane>
</prefwindow>
Yes, I'd agree that it's a bug. When the first pane loads, the prefwindow sizes itself to its content. In your case, this includes several "background" panes. Unfortunately the code to detect this gets bypassed in the animating case. The current code looks something like this:
if (animation) {
if (switching)
animate();
} else {
if (panes > 1)
fixHeight();
}
It should instead look something like this:
if (animation && switching)
animate();
else if (panes > 1)
fixHeight();
This would fix the height of the first pane even when animation was enabled. (If there is only one pane then there is nothing to do of course.)

Add child to existing parent record in entity framework

My relationship between the parent and child is that they are connected by an edge. It is similiar to a directed graph structure.
DAL:
public void SaveResource(Resource resource)
{
context.AddToResources(resource); //Should also add children.
context.SaveChanges();
}
public Resource GetResource(int resourceId)
{
var resource = (from r in context.Resources
.Include("ToEdges").Include("FromEdges")
where r.ResourceId == resourceId
select r).SingleOrDefault();
return resource;
}
Service:
public void AddChildResource(int parentResourceId, Resource childResource)
{
Resource parentResource = repository.GetResource(parentResourceId);
ResourceEdge inEdge = new ResourceEdge();
inEdge.ToResource = childResource;
parentResource.ToEdges.Add(inEdge);
repository.SaveResource(parentResource);
}
Error: An object with the same key already exists in the ObjectStateManager. The existing object is in the Unchanged state. An object can only be added to the ObjectStateManager again if it is in the added state.
Image:
I have been told this is the sequence in submitting a child to an already existing parent:
Get parent -> Attach Child to parent -> submit parent.
That is the sequence I used. The code above is extracted from an ASP.NET MVC 2 application using the repository pattern.
EDMX file:
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="XDbModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
<EntityContainer Name="XDbModelStoreContainer">
<EntitySet Name="Bundles" EntityType="XDbModel.Store.Bundles" store:Type="Tables" Schema="dbo" />
<EntitySet Name="CellProviders" EntityType="XDbModel.Store.CellProviders" store:Type="Tables" Schema="dbo" />
<EntitySet Name="Comments" EntityType="XDbModel.Store.Comments" store:Type="Tables" Schema="dbo" />
<EntitySet Name="LocationPoints" EntityType="XDbModel.Store.LocationPoints" store:Type="Tables" Schema="dbo" />
<EntitySet Name="Locations" EntityType="XDbModel.Store.Locations" store:Type="Tables" Schema="dbo" />
<EntitySet Name="Offers" EntityType="XDbModel.Store.Offers" store:Type="Tables" Schema="dbo" />
<EntitySet Name="PostBundleJunction" EntityType="XDbModel.Store.PostBundleJunction" store:Type="Tables" Schema="dbo" />
<EntitySet Name="PostMedia" EntityType="XDbModel.Store.PostMedia" store:Type="Tables" Schema="dbo" />
<EntitySet Name="Posts" EntityType="XDbModel.Store.Posts" store:Type="Tables" Schema="dbo" />
<EntitySet Name="ResourceEdges" EntityType="XDbModel.Store.ResourceEdges" store:Type="Tables" Schema="dbo" />
<EntitySet Name="ResourceNames" EntityType="XDbModel.Store.ResourceNames" store:Type="Tables" Schema="dbo" />
<EntitySet Name="Resources" EntityType="XDbModel.Store.Resources" store:Type="Tables" Schema="dbo" />
<EntitySet Name="sysdiagrams" EntityType="XDbModel.Store.sysdiagrams" store:Type="Tables" Schema="dbo" />
<EntitySet Name="Users" EntityType="XDbModel.Store.Users" store:Type="Tables" Schema="dbo" />
<EntitySet Name="Votes" EntityType="XDbModel.Store.Votes" store:Type="Tables" Schema="dbo" />
<AssociationSet Name="FK_Comments_Offers" Association="XDbModel.Store.FK_Comments_Offers">
<End Role="Offers" EntitySet="Offers" />
<End Role="Comments" EntitySet="Comments" />
</AssociationSet>
<AssociationSet Name="FK_Comments_Users" Association="XDbModel.Store.FK_Comments_Users">
<End Role="Users" EntitySet="Users" />
<End Role="Comments" EntitySet="Comments" />
</AssociationSet>
<AssociationSet Name="FK_LocationPoints_Locations" Association="XDbModel.Store.FK_LocationPoints_Locations">
<End Role="Locations" EntitySet="Locations" />
<End Role="LocationPoints" EntitySet="LocationPoints" />
</AssociationSet>
<AssociationSet Name="FK_PostBundleJunction_Bundles" Association="XDbModel.Store.FK_PostBundleJunction_Bundles">
<End Role="Bundles" EntitySet="Bundles" />
<End Role="PostBundleJunction" EntitySet="PostBundleJunction" />
</AssociationSet>
<AssociationSet Name="FK_PostBundleJunction_Posts" Association="XDbModel.Store.FK_PostBundleJunction_Posts">
<End Role="Posts" EntitySet="Posts" />
<End Role="PostBundleJunction" EntitySet="PostBundleJunction" />
</AssociationSet>
<AssociationSet Name="FK_Posts_Locations" Association="XDbModel.Store.FK_Posts_Locations">
<End Role="Locations" EntitySet="Locations" />
<End Role="Posts" EntitySet="Posts" />
</AssociationSet>
<AssociationSet Name="FK_Posts_ResourceNames" Association="XDbModel.Store.FK_Posts_ResourceNames">
<End Role="ResourceNames" EntitySet="ResourceNames" />
<End Role="Posts" EntitySet="Posts" />
</AssociationSet>
<AssociationSet Name="FK_Posts_Users" Association="XDbModel.Store.FK_Posts_Users">
<End Role="Users" EntitySet="Users" />
<End Role="Posts" EntitySet="Posts" />
</AssociationSet>
<AssociationSet Name="FK_ResourceEdges_Resources" Association="XDbModel.Store.FK_ResourceEdges_Resources">
<End Role="Resources" EntitySet="Resources" />
<End Role="ResourceEdges" EntitySet="ResourceEdges" />
</AssociationSet>
<AssociationSet Name="FK_ResourceEdges_Resources1" Association="XDbModel.Store.FK_ResourceEdges_Resources1">
<End Role="Resources" EntitySet="Resources" />
<End Role="ResourceEdges" EntitySet="ResourceEdges" />
</AssociationSet>
<AssociationSet Name="FK_ResourceNames_Resources" Association="XDbModel.Store.FK_ResourceNames_Resources">
<End Role="Resources" EntitySet="Resources" />
<End Role="ResourceNames" EntitySet="ResourceNames" />
</AssociationSet>
<AssociationSet Name="FK_Users_Locations" Association="XDbModel.Store.FK_Users_Locations">
<End Role="Locations" EntitySet="Locations" />
<End Role="Users" EntitySet="Users" />
</AssociationSet>
<AssociationSet Name="FK_Votes_Posts" Association="XDbModel.Store.FK_Votes_Posts">
<End Role="Posts" EntitySet="Posts" />
<End Role="Votes" EntitySet="Votes" />
</AssociationSet>
</EntityContainer>
<EntityType Name="Bundles">
<Key>
<PropertyRef Name="BundleId" />
</Key>
<Property Name="BundleId" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="CellProviders">
<Key>
<PropertyRef Name="CellProviderID" />
</Key>
<Property Name="CellProviderID" Type="uniqueidentifier" Nullable="false" />
</EntityType>
<EntityType Name="Comments">
<Key>
<PropertyRef Name="CommentID" />
</Key>
<Property Name="CommentID" Type="uniqueidentifier" Nullable="false" />
<Property Name="ParentPostID" Type="uniqueidentifier" />
<Property Name="OfferPostID" Type="uniqueidentifier" />
<Property Name="UserID" Type="uniqueidentifier" Nullable="false" />
</EntityType>
<EntityType Name="LocationPoints">
<Key>
<PropertyRef Name="LocationPointId" />
</Key>
<Property Name="LocationPointId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="Latitude" Type="float" Nullable="false" />
<Property Name="Longitude" Type="float" Nullable="false" />
<Property Name="Altitude" Type="float" Nullable="false" />
<Property Name="Count" Type="int" Nullable="false" />
<Property Name="LocationId" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="Locations">
<Key>
<PropertyRef Name="LocationId" />
</Key>
<Property Name="LocationId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="Address1" Type="nvarchar" Nullable="false" MaxLength="200" />
<Property Name="Address2" Type="nvarchar" MaxLength="200" />
<Property Name="Address3" Type="nvarchar" MaxLength="200" />
<Property Name="State" Type="nvarchar" Nullable="false" MaxLength="200" />
<Property Name="Country" Type="nvarchar" Nullable="false" MaxLength="200" />
</EntityType>
<EntityType Name="Offers">
<Key>
<PropertyRef Name="OfferID" />
</Key>
<Property Name="OfferID" Type="uniqueidentifier" Nullable="false" />
<Property Name="NeedOffer" Type="uniqueidentifier" Nullable="false" />
<Property Name="ProvisionOffer" Type="uniqueidentifier" Nullable="false" />
</EntityType>
<EntityType Name="PostBundleJunction">
<Key>
<PropertyRef Name="BundleId" />
<PropertyRef Name="PostId" />
</Key>
<Property Name="BundleId" Type="int" Nullable="false" />
<Property Name="PostId" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="PostMedia">
<Key>
<PropertyRef Name="MediaId" />
</Key>
<Property Name="MediaId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="MediaExt" Type="nvarchar" Nullable="false" MaxLength="5" />
<Property Name="PostId" Type="int" Nullable="false" />
<Property Name="SynthId" Type="uniqueidentifier" />
</EntityType>
<EntityType Name="Posts">
<Key>
<PropertyRef Name="PostId" />
</Key>
<Property Name="PostId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="PosterID" Type="uniqueidentifier" Nullable="false" />
<Property Name="BundleId" Type="int" Nullable="false" />
<Property Name="LocationId" Type="int" Nullable="false" />
<Property Name="Tags" Type="uniqueidentifier" />
<Property Name="Quanitity" Type="int" Nullable="false" />
<Property Name="Description" Type="text" Nullable="false" />
<Property Name="ResourceNameId" Type="int" Nullable="false" />
<Property Name="Date" Type="datetime" Nullable="false" />
</EntityType>
<EntityType Name="ResourceEdges">
<Key>
<PropertyRef Name="EdgeId" />
</Key>
<Property Name="Rank" Type="int" Nullable="false" />
<Property Name="EdgeId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="ToResourceId" Type="int" Nullable="false" />
<Property Name="FromResourrceId" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="ResourceNames">
<Key>
<PropertyRef Name="ResourceNameId" />
</Key>
<Property Name="ResourceNameId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="Name" Type="nvarchar" Nullable="false" MaxLength="100" />
<Property Name="ResourceId" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="Resources">
<Key>
<PropertyRef Name="ResourceId" />
</Key>
<Property Name="ResourceId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="Description" Type="nvarchar" MaxLength="50" />
</EntityType>
<EntityType Name="sysdiagrams">
<Key>
<PropertyRef Name="diagram_id" />
</Key>
<Property Name="name" Type="nvarchar" Nullable="false" MaxLength="128" />
<Property Name="principal_id" Type="int" Nullable="false" />
<Property Name="diagram_id" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="version" Type="int" />
<Property Name="definition" Type="varbinary(max)" />
</EntityType>
<EntityType Name="Users">
<Key>
<PropertyRef Name="UserID" />
</Key>
<Property Name="UserID" Type="uniqueidentifier" Nullable="false" />
<Property Name="LocationId" Type="int" />
</EntityType>
<EntityType Name="Votes">
<Key>
<PropertyRef Name="VoteId" />
</Key>
<Property Name="VoteId" Type="int" Nullable="false" />
<Property Name="VoterId" Type="uniqueidentifier" Nullable="false" />
<Property Name="VoteContent" Type="int" Nullable="false" />
<Property Name="PostId" Type="int" Nullable="false" />
</EntityType>
<Association Name="FK_Comments_Offers">
<End Role="Offers" Type="XDbModel.Store.Offers" Multiplicity="0..1" />
<End Role="Comments" Type="XDbModel.Store.Comments" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Offers">
<PropertyRef Name="OfferID" />
</Principal>
<Dependent Role="Comments">
<PropertyRef Name="OfferPostID" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Comments_Users">
<End Role="Users" Type="XDbModel.Store.Users" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="Comments" Type="XDbModel.Store.Comments" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Users">
<PropertyRef Name="UserID" />
</Principal>
<Dependent Role="Comments">
<PropertyRef Name="UserID" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_LocationPoints_Locations">
<End Role="Locations" Type="XDbModel.Store.Locations" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="LocationPoints" Type="XDbModel.Store.LocationPoints" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Locations">
<PropertyRef Name="LocationId" />
</Principal>
<Dependent Role="LocationPoints">
<PropertyRef Name="LocationId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_PostBundleJunction_Bundles">
<End Role="Bundles" Type="XDbModel.Store.Bundles" Multiplicity="1" />
<End Role="PostBundleJunction" Type="XDbModel.Store.PostBundleJunction" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Bundles">
<PropertyRef Name="BundleId" />
</Principal>
<Dependent Role="PostBundleJunction">
<PropertyRef Name="BundleId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_PostBundleJunction_Posts">
<End Role="Posts" Type="XDbModel.Store.Posts" Multiplicity="1" />
<End Role="PostBundleJunction" Type="XDbModel.Store.PostBundleJunction" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Posts">
<PropertyRef Name="PostId" />
</Principal>
<Dependent Role="PostBundleJunction">
<PropertyRef Name="PostId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Posts_Locations">
<End Role="Locations" Type="XDbModel.Store.Locations" Multiplicity="1" />
<End Role="Posts" Type="XDbModel.Store.Posts" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Locations">
<PropertyRef Name="LocationId" />
</Principal>
<Dependent Role="Posts">
<PropertyRef Name="LocationId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Posts_ResourceNames">
<End Role="ResourceNames" Type="XDbModel.Store.ResourceNames" Multiplicity="1" />
<End Role="Posts" Type="XDbModel.Store.Posts" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="ResourceNames">
<PropertyRef Name="ResourceNameId" />
</Principal>
<Dependent Role="Posts">
<PropertyRef Name="ResourceNameId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Posts_Users">
<End Role="Users" Type="XDbModel.Store.Users" Multiplicity="1" />
<End Role="Posts" Type="XDbModel.Store.Posts" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Users">
<PropertyRef Name="UserID" />
</Principal>
<Dependent Role="Posts">
<PropertyRef Name="PosterID" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_ResourceEdges_Resources">
<End Role="Resources" Type="XDbModel.Store.Resources" Multiplicity="1" />
<End Role="ResourceEdges" Type="XDbModel.Store.ResourceEdges" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Resources">
<PropertyRef Name="ResourceId" />
</Principal>
<Dependent Role="ResourceEdges">
<PropertyRef Name="ToResourceId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_ResourceEdges_Resources1">
<End Role="Resources" Type="XDbModel.Store.Resources" Multiplicity="1" />
<End Role="ResourceEdges" Type="XDbModel.Store.ResourceEdges" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Resources">
<PropertyRef Name="ResourceId" />
</Principal>
<Dependent Role="ResourceEdges">
<PropertyRef Name="FromResourrceId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_ResourceNames_Resources">
<End Role="Resources" Type="XDbModel.Store.Resources" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="ResourceNames" Type="XDbModel.Store.ResourceNames" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Resources">
<PropertyRef Name="ResourceId" />
</Principal>
<Dependent Role="ResourceNames">
<PropertyRef Name="ResourceId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Users_Locations">
<End Role="Locations" Type="XDbModel.Store.Locations" Multiplicity="0..1">
<OnDelete Action="Cascade" />
</End>
<End Role="Users" Type="XDbModel.Store.Users" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Locations">
<PropertyRef Name="LocationId" />
</Principal>
<Dependent Role="Users">
<PropertyRef Name="LocationId" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_Votes_Posts">
<End Role="Posts" Type="XDbModel.Store.Posts" Multiplicity="1">
<OnDelete Action="Cascade" />
</End>
<End Role="Votes" Type="XDbModel.Store.Votes" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Posts">
<PropertyRef Name="PostId" />
</Principal>
<Dependent Role="Votes">
<PropertyRef Name="PostId" />
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>
</edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="XDbModel" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
<EntityContainer Name="XDbEntities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="Bundles" EntityType="XDbModel.Bundle" />
<EntitySet Name="CellProviders" EntityType="XDbModel.CellProvider" />
<EntitySet Name="Comments" EntityType="XDbModel.Comment" />
<EntitySet Name="LocationPoints" EntityType="XDbModel.LocationPoint" />
<EntitySet Name="Locations" EntityType="XDbModel.Location" />
<EntitySet Name="Offers" EntityType="XDbModel.Offer" />
<EntitySet Name="PostMedias" EntityType="XDbModel.PostMedia" />
<EntitySet Name="Posts" EntityType="XDbModel.Post" />
<EntitySet Name="ResourceEdges" EntityType="XDbModel.ResourceEdge" />
<EntitySet Name="ResourceNames" EntityType="XDbModel.ResourceName" />
<EntitySet Name="Resources" EntityType="XDbModel.Resource" />
<EntitySet Name="sysdiagrams" EntityType="XDbModel.sysdiagram" />
<EntitySet Name="Users" EntityType="XDbModel.User" />
<EntitySet Name="Votes" EntityType="XDbModel.Vote" />
<AssociationSet Name="FK_Comments_Offers" Association="XDbModel.FK_Comments_Offers">
<End Role="Offers" EntitySet="Offers" />
<End Role="Comments" EntitySet="Comments" />
</AssociationSet>
<AssociationSet Name="FK_Comments_Users" Association="XDbModel.FK_Comments_Users">
<End Role="Users" EntitySet="Users" />
<End Role="Comments" EntitySet="Comments" />
</AssociationSet>
<AssociationSet Name="FK_LocationPoints_Locations" Association="XDbModel.FK_LocationPoints_Locations">
<End Role="Locations" EntitySet="Locations" />
<End Role="LocationPoints" EntitySet="LocationPoints" />
</AssociationSet>
<AssociationSet Name="FK_Posts_Locations" Association="XDbModel.FK_Posts_Locations">
<End Role="Locations" EntitySet="Locations" />
<End Role="Posts" EntitySet="Posts" />
</AssociationSet>
<AssociationSet Name="FK_Users_Locations" Association="XDbModel.FK_Users_Locations">
<End Role="Locations" EntitySet="Locations" />
<End Role="Users" EntitySet="Users" />
</AssociationSet>
<AssociationSet Name="FK_Posts_ResourceNames" Association="XDbModel.FK_Posts_ResourceNames">
<End Role="ResourceNames" EntitySet="ResourceNames" />
<End Role="Posts" EntitySet="Posts" />
</AssociationSet>
<AssociationSet Name="FK_Posts_Users" Association="XDbModel.FK_Posts_Users">
<End Role="Users" EntitySet="Users" />
<End Role="Posts" EntitySet="Posts" />
</AssociationSet>
<AssociationSet Name="FK_Votes_Posts" Association="XDbModel.FK_Votes_Posts">
<End Role="Posts" EntitySet="Posts" />
<End Role="Votes" EntitySet="Votes" />
</AssociationSet>
<AssociationSet Name="FK_ResourceEdges_Resources" Association="XDbModel.FK_ResourceEdges_Resources">
<End Role="Resources" EntitySet="Resources" />
<End Role="ResourceEdges" EntitySet="ResourceEdges" />
</AssociationSet>
<AssociationSet Name="FK_ResourceEdges_Resources1" Association="XDbModel.FK_ResourceEdges_Resources1">
<End Role="Resources" EntitySet="Resources" />
<End Role="ResourceEdges" EntitySet="ResourceEdges" />
</AssociationSet>
<AssociationSet Name="FK_ResourceNames_Resources" Association="XDbModel.FK_ResourceNames_Resources">
<End Role="Resources" EntitySet="Resources" />
<End Role="ResourceNames" EntitySet="ResourceNames" />
</AssociationSet>
<AssociationSet Name="PostBundleJunction" Association="XDbModel.PostBundleJunction">
<End Role="Bundles" EntitySet="Bundles" />
<End Role="Posts" EntitySet="Posts" />
</AssociationSet>
</EntityContainer>
<EntityType Name="Bundle">
<Key>
<PropertyRef Name="BundleId" />
</Key>
<Property Name="BundleId" Type="Int32" Nullable="false" />
<NavigationProperty Name="Posts" Relationship="XDbModel.PostBundleJunction" FromRole="Bundles" ToRole="Posts" />
</EntityType>
<EntityType Name="CellProvider">
<Key>
<PropertyRef Name="CellProviderID" />
</Key>
<Property Name="CellProviderID" Type="Guid" Nullable="false" />
</EntityType>
<EntityType Name="Comment">
<Key>
<PropertyRef Name="CommentID" />
Ah, it's actually very simple, once you think about it..
What you're trying to do it add the resource to the data context, even though this resource object was received from the database in the first place. So the error is not complaining about your child objects, but about your parent object! :)
Basically if you comment the first line in the SaveResource() method it should just work fine!
E.g.:
public void SaveResource(Resource resource)
{
// context.AddToResources(resource); //Should also add children.
context.SaveChanges();
}
Or just move the AddChildResource method to your DAL:
public void AddChildResource(int parentResourceId, Resource childResource)
{
Resource parentResource = repository.GetResource(parentResourceId);
ResourceEdge inEdge = new ResourceEdge();
inEdge.ToResource = childResource;
parentResource.ToEdges.Add(inEdge);
context.SaveChanges();
}
Presumably it's complaining about the childResource not being in the added state. You added it to the edge object that is in the added state.
Can you try flipping the way you set that association round:-
public void AddChildResource(int parentResourceId, Resource childResource)
{
Resource parentResource = repository.GetResource(parentResourceId);
ResourceEdge inEdge = new ResourceEdge();
// inEdge.ToResource = childResource; <-- don't do this
parentResource.ToEdges.Add(inEdge);
childResource.FromEdges.Add(inEdge); // try this instead
repository.SaveResource(parentResource);
}

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