How to Extract value from Parameter Key - roomle

I know its possible to read a parameter externally from the iFrame of the configurator
const frameColour = params.find(({ key }) => key === "frameColour");
but is it possible to on the ADD TO CART action to read the value of a Parameter Key (frameColour) and display it in an HTML DIV / Input? The reason for this is I have the parameter key that is the colour of the Shelf Frame I'm building, I want to be able to read the colour and display it to the Screen, then I can store that colour in my external database

After you've created a new configurator using the embedding API you can use this to get notified about parameter updates:
configurator.extended.callbacks.onUpdateParameters = (parameters) => {
// add your logic here
};
configurator.extended will give you access to the RoomleConfigurator instance (https://docs.roomle.com/web/api/classes/roomleconfigurator.html)

Related

How to change token label using C_SetAttributeValue

Is there any way to change token label using C_SetAttributeValue? what template is being used to change token name as I tried with below function got error iaik.pkcs.pkcs11.wrapper.PKCS11Exception: CKR_TEMPLATE_INCOMPLETE
token = getToken();
CK_ATTRIBUTE[] attrs = new CK_ATTRIBUTE[2];
attrs[0] = new CK_ATTRIBUTE();
attrs[0].type = PKCS11Constants.CKA_LABEL;
attrs[0].pValue = label.toCharArray();
attrs[1] = new CK_ATTRIBUTE();
attrs[1].type = PKCS11Constants.CKA_ID;
attrs[1].pValue = label.toCharArray();
token.getSlot().getModule().getPKCS11Module().C_SetAttributeValue(
session.getSessionHandle(), token.getSlot().getSlotID(), attrs, true);
Hello on StackOverflow!
Have a look at C_SetAttributeValue definition:
CK_DEFINE_FUNCTION(CK_RV, C_SetAttributeValue)(
CK_SESSION_HANDLE hSession,
CK_OBJECT_HANDLE hObject,
CK_ATTRIBUTE_PTR pTemplate,
CK_ULONG ulCount
);
The second parameter is the Object ID, not the slot ID.
Please refer to your library's manufacturer documentation for extensions to PKCS#11 that allow to set token label.
C_SetAttributeValue is categorized as an object-management function. More precisely, the cryptoki function C_SetAttributeValue is used to modify or set an attribute value of an object (not token). If you use a standard PKCS#11 library, you should use C_initToken to change or set the token label.
Please note that a company may provide some non-standard functions for its own products. Thus, it might be also a non-standard function or extension in a specific product that helps you to change the token label.

NativeScript-Dev-Appium : UIElement.text() / UIElement.getAttribute("value") returns the automationText instead of the text displayed

I am using NativeScript-Dev-Appium#5.0.0 and wish to check for the text displayed on a label. I have automationText property assigned to the and use Driver.findElementByAccessibilityId(automationTextValue) to get the element. The element is found, but when I try to use the UIElement.text() / UIElement.getAttribute("value") on it, it returns the value of the automationText attribute instead of the actual displayed text. Is there any other method to do it because I can't find any.
Unfortunately, this is a limitation of NativeScript itself since when the automationText property is used, it will set all properties of the element like value, name, label etc. I would suggest you set the same text to automationText property and then you can access or test the element using something like this:
Using XPath:
const el = await driver.findElementByXPath("//*[#name=\"My automation text\"]");
For Android only
const el = await driver.findElementByText("My automation text");
const text = await el.getAttribute("text");
Use imageVerification types like:
await driver.compareRectangle
await driver.compareElement
await driver.compareScreen
Which is very convenient but the cons here is that this will require higher maintenance at some point.

Hiding custom ItemProperties from print. Interop.Outlook

I have written an Outlook plugin that basically allows emails being received through Outlook to be linked with a website so that the email can also be view in the communications feature of the website. I store additional details within the ItemProperties of a MailItem, these details are basically things like the id of the user the email relates to within a website.
The problem I'm having is any ItemProperties I add to a MailItem are being printed when the email is printed. Does anyone know how to exclude custom ItemProperties when printing an email?
Here is the code that is creating the custom ItemProperty:
// Try and access the required property.
Microsoft.Office.Interop.Outlook.ItemProperty property = mailItem.ItemProperties[name];
// Required property doesnt exist so we'll create it on the fly.
if (property == null) property = mailItem.ItemProperties.Add(name, Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText);
// Set the value.
property.Value = value;
I'm working on Outlook extension and sometimes ago we had the same issue.
One of our team members found a solution. You can create some method which is responsible for disable printing. You can see peace of our code below:
public void DisablePrint()
{
long printablePropertyFlag = 0x4; // PDO_PRINT_SAVEAS
string printablePropertyCode = "[DispID=107]";
Type customPropertyType = _customProperty.GetType();
// Get current flags.
object rawFlags = customPropertyType.InvokeMember(printablePropertyCode , BindingFlags.GetProperty, null, _customProperty, null);
long flags = long.Parse(rawFlags.ToString());
// Remove printable flag.
flags &= ~printablePropertyFlag;
object[] newParameters = new object[] { flags };
// Set current flags.
customPropertyType.InvokeMember(printablePropertyCode, BindingFlags.SetProperty, null, _customProperty, newParameters);
}
Make sure that _customProperty it is your property which you created by the following code: mailItem.ItemProperties.Add(name,Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText);
On the low (Extended MAPI) level, each user property definition has a flag that determines whether it is printable (namely, PDO_PRINT_SAVEAS). That flag however is not exposed through the Outlook Object Model.
You can either parse the user properties blob and manually set that flag (user properties blob format is documented, and you can see it in OutlookSpy (I am its author) if you click the IMessage button) or you can use Redemption (I am also its author) and its RDOUserProperty.Printable property.
The following script (VB) will reset the printable property for all user propeties of the currently selected message:
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Msg = Session.GetMessageFromID(Application.ActiveExplorer.Selection(1).EntryID)
for each prop in Msg.UserProperties
Debug.Print prop.Name
prop.Printable = false
next
Msg.Save

How to get Customized template fields from invoice using QuickBooks QBFC

I want to get custom S.O. Invoice Template fields using QuickBooks QBFC.
Here's how to read custom fields from a sales order:
Add "0" to the OwnerIDList of the SalesOrderQuery.
Read custom header fields from the DataExtRetList that is attached to SalesOrderRet objects that are returned from the query.
Read custom line item fields from the DataExtRetList in the SalesOrderLineRet and SalesOrderLineGrouptRet objects that are included in each SalesOrderRet (if you're reading line items).
If you're already using the IncludeRetElementList, you must add DataExtRet to the list; if you're not then don't start using IncludeRetElementList until you have custom fields working. Just like any transaction query, you won't see any line item data unless you set the IncludeLineItems flag in the request.
Custom fields are well documented in the QuickBooks SDK Manual. I'd recommend you take a look at the section DataExt: Using Custom Fields and Private Data in the QBSDK Programmers Guide.
To elaborate on Paul Keister's answer, the reason you must add "0" to the query is because that is the Owner ID of the custom field you are attempting to retrieve. 0 is probably likely to be the value, but if the owner ID is different, you will have to use a different value here.
Some example C# code:
//set the owner id of the custom field you are trying to get back
IInvoiceQuery invoiceQuery = requestMsgSet.AppendInvoiceQueryRq();
invoiceQuery.OwnerIDList.Add("0");
//set up query parameters and actually call your query...
//call this method for each invoice to get its custom fields (if they exist)
static void GetInvoiceCustomFields(IInvoiceRet invoice)
{
if (invoice.DataExtRetList == null)
{
return;
}
for (int i = 0; i < invoice.DataExtRetList.Count; i++)
{
IDataExtRet extData = invoice.DataExtRetList.GetAt(i);
Console.WriteLine("external data name: " + extData.DataExtName.GetValue());
Console.WriteLine("external data value: " + extData.DataExtValue.GetValue());
}
}

youtube upload widget category & tags

except for:
widget.setVideoTitle(title);
widget.setVideoDescription(description);
widget.setVideoKeywords(keyword1, keyword2, ..., keywordn);
widget.setVideoPrivacy(privacy);
is there also a possibility to set Category and Tags along the vid upload???
cheerz!
from the widget I think not, only the properties that you mentioned and in onApiReady:
https://developers.google.com/youtube/youtube_upload_widget#onApiReady
This event fires when the internal command API, which enables you to set metadata for a newly uploaded video, is ready. The event handler for this event can call the following functions to set metadata for an uploaded video:
widget.setVideoTitle(title) – The title parameter is a string that specifies the video title.
widget.setVideoDescription(description); – The description parameter is a string that specifies the video description.
widget.setVideoKeywords(keyword1, keyword2, ..., keywordn); – The function takes a list of string parameters, each of which specifies a keyword for the video.
widget.setVideoPrivacy(privacy) – The privacy parameter is a string that specifies the initial privacy setting for the newly uploaded video. Valid values are public, unlisted, and private. The default setting is public.

Resources