ARAnchor / SCNNode relation - scenekit

Using ARKit, I have a use case where I need, from a touch event to retrieve the touched Node, and update it with some of its Anchor information.
With ARKit, I can retrieve the touched anchor, but then, how to get the related node ?
or
With SceneKit, I can retrieve the touched node, but then, how to get the related anchor ?
The only I found was to maintain a relationship table myself, using the various delegate's calls. Is there any smarter way ?

The ARSCNView class exposes both -anchorForNode: and -nodeForAnchor:.

Related

Functional Test With ExtJS 6

I'm using HP UFT for functional tests.
Because of dynamic id definition of ExtJS, I can't use UFT Recording feature.
I've tried many ways for assigning dynamic IDs to staticly.
I tried to change id: function() in ext-all-debug.js file.
I tried to change Components getId() function in ext-all-debug.js file.
I tried override components with afterRender method to change ids aswell.
Sometimes I achieved to change id's using component's properties (text, fieldLabel, overflowText, etc.), but for some components I couldn't achieve to assign ID's since the components properties seem empty.
Above, I listed my actions to assign static ID. So, I want to know your opinions about my actions and if you found them incorrect or not sufficient, could you offer me new approaches for using HP UFT recording feature with ExtJS6.
You can't change the dynamic id of the dom elements which represents ExtJS components. That's really bad thing and I think you would break the whole app.
The easiest way to test ExtJS app is to use already created frameworks/tools like:
Siesta by Bryntum
Sencha Test by Sencha
The Siesta is free. It has some pro features which requires the license. But you can use it for free.
If you still insists on doing it your way. You need to dynamically get the IDs of the dom elements created by ExtJS components. Basically write your own API.
You need to execute the ExtJS JS code, which will return you the ID of the component. So you need to get the ExtJS component and call getId() function on it to get the dom id.
Here is the example code:
>Ext.ComponentQuery.query('checkbox')[0].getId()
"checkbox-1047"
You will definetely need: http://docs.sencha.com/extjs/6.5.3/modern/Ext.ComponentQuery.html#method-query
And keep in mind that the query can be pretty advanced and you can use all the configs which are set on the ExtJS elements such as name, xtype, etc
You can find some other info in my other anwser https://stackoverflow.com/a/41718879/1768843

SuiteCommerce Advanced - Show a custom record on the PDP

I am looking to create a feature whereby a User can download any available documents related to the item from a tab on the PDP.
So far I have created a custom record called Documentation (customrecord_documentation) containing the following fields:
Related item : custrecord_documentation_related_item
Type : custrecord_documentation_type
Document : custrecord_documentation_document
Description : custrecord_documentation_description
Related Item ID : custrecord_documentation_related_item_id
The functionality works fine on the backend of NetSuite where I can assign documents to an Inventory item. The stumbling block is trying to fetch the data to the front end of the SCA webstore.
Any help on the above would be much appreciated.
I've come at this a number of ways.
One way is to create a Suitelet that returns JSON of the document names and urls. The urls can be the real Netsuite urls or they can be the urls of your suitelet where you set up the suitelet to return the doc when accessed with action=doc&id=_docid_ query params.
Add a target <div id="relatedDocs"></div> to the item_details.tpl
In your ItemDetailsView's init_Plugins add
$.getJSON('app/site/hosting/scriptlet.nl...?action=availabledoc').
then(function(data){
var asHtml = format(data); //however you like
$("#relatedDocs").html(asHtml);
});
You can also go the whole module route. If you created a third party module DocsView then you would add DocsView as a child view to ItemDetailsView.
That's a little more involved so try the option above first to see if it fits your needs. The nice thing is you can just about ignore Backbone with this approach. You can make this a little more portable by using a service.ss instead of the suitelet. You can create your own ssp app for the function so you don't have to deal with SCAs url structure.
It's been a while, but you should be able to access the JSON data from within the related Backbone View class. From there, within the return context, output the value you're wanting to the PDP. Hopefully you're extending the original class and not overwriting / altering the core code :P.
The model associated with the PDP should hold all the JSON data you're looking for. Model.get('...') sort of syntax.
I'd recommend against Suitelets for this, as that's extra execution time, and is a bit slower.
I'm sure you know, but you need to set the documents to be available as public as well.
Hope this helps, thanks.

Best way to implement in angularjs list detail view hierarchy without reloading when going back

i've the following hierarchy structure : Group -> Family -> products -> Product details.
each node is retrieve through an $http service.
i would like the user to be able to drill down until the final product details and i would also like no reloads when the user hits the back button as parents never changes.
i've succeeded to build the first part using routes and it works pefectly but now each time i want to go back the controller of the parent view (last view) is reloaded and i don't know how to avoid this reloading.
i am thinking of changing my way of doing it by having only 1 view (while 4 before) and manage the drill down through a directive, do you think it could be considered as a good practice ? how would you implement this ?
You could check out AngularUI Router, since one of its main feature is the ability to nest states & views.
Have a look at the UI-Router Demo, source code here.

Want to display results of a callout

When a user 'Saves' a Contact (for example), whether it's new or just updated, I need to:
Do an external callout using one of the Contact field values as a lookup
Display the results of the callout, so the user can make a selection
Update the Contact based on the user's selection display the updated Contact
I have found two aproaches, but have reached a point in both that I need to resolve.
Trigger Based Method
In the 'after' trigger pass the lookup string to a callback.
Update the Contact with the selection
Issues
How do you pass the lookup string or results to a visualforce page to display the lookup results?
When the user makes the selection and the update has been done, how do I move back to the updated contact?
Override Base Method
I found a discussion here that seems to suggests using overriding & redirection to someone asking about 'Edit'. I think this could also be done with the 'Save' button.
Issue
This is meant to be a deployable sollution, so I think that the override has to be set in code (I'm using the IDE) and not via Setup (or am I wrong?). I can't find out if this is possible or how to do it
Sorry for detailed question. Didn't want to just ask the wrong question (i.e. assume I know the best approach).
Thanks...
For the trigger-based method, you cannot change the built-in Save functionality, but (per your second solution) you can override the Edit button and recreate the Edit page with Visualforce, which would give you full control over the Save button and how you handle the callout and redirecting.
The release notes for Spring '10 indicate that standard-button overrides are now available for packaging, as they can be created through the Metadata API.

copy entity in entity framework?

For example I have a wpf window bound to an customer Entity (let suppose it's cus1). Then I load another entity from context :
customer cus2 = context.customers.where(x=>x.id=10).FirstOrDefault();
Now I want cus1 = cus2 ? I can do this way :
cus1.name = cus2.name;
cus1.address = cus2.address;
...
...
This way meets my case (the content of textboxs in the form change immediately into values of cus2) but I wonder if there is anyway to make it shorter since cus1=cus2 doesn't work ?
Thanks
You can use the memberwise Clone method to make a shallowcopy of a business object:
See http://msdn.microsoft.com/de-de/library/system.object.memberwiseclone.aspx
You could also use Serialization or Reflection, to do it on your own. However both oof the methods are slower then writing it directly.
Take a look at this article. Maybe you will find it helpful:
http://www.codeproject.com/KB/dotnet/CloningLINQ2Entities.aspx
Edit:
Btw. Remember, using using MemberwiseClone, in case of ReferenceTypes will effect in copying the references, not objects.
If you want to update the values of a Customer entity in memory with the newest values in the datastore you can use the Refresh method on your ObjectContext.
Here is the documentation.
In your case it would look like:
context.Refresh(RefreshMode.StoreWins, cus1);
If you really want to map two entities you could have a look at AutoMapper. AutoMapper will help you by automatically mapping entities to each other with a default setup that you can tweak to your needs.

Resources