How to change canonicalization method - node.js

does anyone know how to change the CanonicalizationMethod property in xadesjs? I know it is using xmldsigjs underneath but I cannot find a solution to change it. I mean the CanonicalizationMethod for the whole SignedInfo property (not the transforms for the references). Currently (by default) I get a document that has CanonicalizationMethod set to C14N:
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
I want to change it to EXC-C14N:
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
Is it even possible?

Ok, I've found a solution. In case anybody needs it, you can directly assign it with:
let signedXml = new XAdES.SignedXml();
signedXml.XmlSignature.SignedInfo.CanonicalizationMethod.Algorithm = "http://www.w3.org/2001/10/xml-exc-c14n#";

Related

Get property name of changed item - Hazelcast

Are there any listener in IMap which allow to get the name of the property which has been changed?
For example:
I have a map [{Key}, {"foo":"exampleFoo", "bar":"exampleBar"}], if something change in foo value, is there a way to get the name of the property?
Thanks for your support.
You can check the entry value by using entryEvent.getValue() in the EntryEvent parameter. Please remember to set includeValue parameter to true when you are adding the listener.

obj.Attributes(0) returns "ID", obj.getAttribute("ID") returns nothing

This is my first attempt to use MSXML2.DOMDocument within VBA, and I'm having a "huh?" moment right off the start. My document looks like this...
<Locations>
<Location ID="23456">
<Properties>
<Property ID="12345">
etc.
I want to make a report with all the Location IDs, so I:
Set locs= XDoc.SelectNodes("//Location")
For Each loc In locs
Debug.Print loc.Attributes(0).Text
Next
and I got 23456. Yay! But of course, those attributes might move around, so let's fix that...
Debug.Print loc.getAttribute("ID").Text
That returns Object required. Looking in the debugger, I can see that loc has one attribute and it's name is ID. That seems right. I can also see that loc.getAttribute("ID") returns null. That seems wrong.
So what's going on here?
I don't know VBA at all but my guess would be that the .attributes[] property returns an attribute object (XmlAttribute?), which would let you access its identifier and value, whereas the getAttribute() function is the getter for the text value of the attribute with that identifier.

Know which among the dependent keys caused the computed property change

In Ember, is there a way to get which among the dependent keys caused a computed property to recalculate?
eg:
myProp: Ember.computed('dep1','dep2','dep3', function(){
console.log('MyProp was recalculated due to a change in property :' <dep 1,2 or 3(get the value here)>);
return ...;
}),
Kindly let me know if I should provide any additional details.
Short answer: No, thats not possible.
Long answer: You could save away all dependency keys and compare them on recalculation.
If you are in a component.js you can check didUpdateAttributes(options) where options contains the old and new values of updated attributes.

How can I clear an external ID on a record in NetSuite?

I need to clear/reset the external ID on a record in NetSuite, but nothing I do is working.
Some of the InventoryItem records are incorrectly mapped to records in another system. I have an application that can sync up the two systems, but I need to clear NetSuite's external IDs first.
Responses don't really need to be SOAP-specific. If you know how to do it with some specific NetSuite/SuiteTalk client, that might point me in the right direction.
What I've Tried
First up, I tried using the nullFieldList... but maybe it doesn't work because externalId is an attribute, not an element?
<messages:update>
<messages:record internalId="7777" xsi:type="accounting:InventoryItem">
<core:nullFieldList xsi:type="core:NullField">
<core:name>externalId</core:name>
</core:nullFieldList>
</messages:record>
</messages:update>
The external ID is just a string, so I tried just setting it to blank. Didn't work either.
<messages:update>
<messages:record internalId="7777" xsi:type="accounting:InventoryItem">
<accounting:externalId></accounting:externalId>
</messages:record>
</messages:update>
I even tried setting the external ID to 0, but I get back a "not unique identifier" error
<messages:update>
<messages:record internalId="7777" xsi:type="accounting:InventoryItem">
<accounting:externalId>0</accounting:externalId>
</messages:record>
</messages:update>
Other Info
I'm using NetSuite's SOAP API v.2013_1
When I say "it doesn't work", I mean: after I do the update, I get a success response similar to the following:
<readResponse>
<platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2013_1.platform.webservices.netsuite.com"/>
<record internalId="7777" externalId="42" xsi:type="listAcct:InventoryItem" xmlns:listAcct="urn:accounting_2013_1.lists.webservices.netsuite.com">
<!-- snip -->
</record>
</readResponse>
If you are using scripts in netsuite you can run a scheduled script to clear records in NS by loading each record and setting the externalid to '' using the following simple code:
var rec= nlapiLoadRecord(type,id);
rec.setFieldValue('externalid','');
nlapiSubmitRecord(rec);
This seemed to work for me in my enviornment which was on 2015.2.
Unfortunately my understanding is that once you set an externalid you cannot clear it, you can set it to another value, but not back to null. I have experienced this both using SuiteScript as well as a Boomi process that uses the 2014.1 endpoint. This may have changed in the recent releases, as I have not tried it recently with SuiteScript nor with a newer endpoint.
You can eliminate the externalId on a record once it's been set. Here's an example using the NetSuite gem:
ns_customer = NetSuite::Records::Customer.get external_id: 'ext_id'
ns_customer.external_id = ''
ns_customer.update
Here's the corresponding XML for update:
<env:Body>
<platformMsgs:update>
<platformMsgs:record xsi:type="listRel:Customer" platformMsgs:internalId="199113" platformMsgs:externalId=""/>
</platformMsgs:update>
</env:Body>
I have had to attempt this before as well. I know the pains you describe. I ended up putting a "-" in front of my external ID to unlink it between my systems. You can do this in SOAP or even as a simple one time csv upload. As it was one time, I did csv.

sharepoint - add custom column to list via object model

I'm having trouble figuring out how to add a custom column type to a list with the object model.
SPFieldCollection.Add() has a parameter SPFieldType, but that must be one of the enumerated values in the Microsoft.SharePoint.SPFieldType enumeration, thus it cannot be used to create columns of a custom type.
I next attempted using SPFieldCollection.CreateNewField() but when I call SPField.Update() on the returned value I get an exception: "ArgumentException was unhandled. Value does not fall within the expected range.".
I see a reference to SPFieldCollection.AddFieldAsXml() here: How do I add custom column to existing WSS list template but there's hardly any info and I'm not sure that's the right track to take.
UPDATE: I found a post on AddFieldAsXml: http://weblogs.asp.net/bsimser/archive/2005/07/21/420147.aspx and it turns out it's very easy and worked well for me. Posting anyway in hopes it will help someone else.
SPFieldCollection.AddFieldAsXml() is the way to go as far as I can tell. See here for an example: http://weblogs.asp.net/bsimser/archive/2005/07/21/420147.aspx
Try with:
SPField newField = null;
newField= web.Fields.CreateNewField("MyFieldTypeName", fieldName);
web.Fields.Add(newField);
newField = web.Fields[fieldName];
// set some properties
newField.ShowInDisplayForm = false;
newField.ShowInViewForms = true;
newField.Update();

Resources