Does Foundry Scenarios support Quiver? - palantir-foundry

I would like to use Scenarios in my Quiver application - does Scenarios support Quiver?

You can use the Quiver template widget in Workshop to integrate with Scenarios. Both modified object data and timeseries will be reflected in the Quiver template widget when a Scenario is specified.

Related

How to check if we are on Design Automation cloud or not?

I'm running a plugin in Design Automation platform on forge however I do run it locally as well for testing. I'd like a way to check if the code is running on forge or not.
Searching I came across this example:
https://forge.autodesk.com/blog/how-generate-dynamic-number-output-design-automation-revit-v3
which use if (RuntimeValue.RunOnCloud) however I didn't manage to get it work (nor to find any references for it in forge documentation).
How can I check if I run on forge?
Design automation service sets a special environmental variable DAS_WORKITEM_ID for your appbundle code to make use of it should you need. Given that, you should be able to check if this variable is set to determine if your code is running in DA.
public static string GetWorkitemId()
{
return Environment.GetEnvironmentVariable("DAS_WORKITEM_ID");
}
public static bool IsRunningInDA()
{
return !String.IsNullOrEmpty(GetWorkitemId());
}
Please note that we recommend using same code for your DA appbundle and Desktop Revit DB addin. Use such tactics with caution and try to minimize the differences between your DB addin and DA appbundle.
The startup method of your application differs: OnApplicationInitialized versus OnDesignAutomationReadyEvent. You can set a flag in these and check it from you plugin code, cf. e.g., Preparing a Revit Add-in for Design Automation.

Angular - building a "public" function (newbie)

I'm After several days learning angularJS through converting my standart JS app to a ng one.
I was wondering about this simple scenario:
I have a global function called fb_connect(),
it can be used from any page (or any controller if you like) to make a facebook-based login.
This function makes a simple http call and receives a JSON object contain data to move on (display a pop up, login, etc...)
I read that I can define a Factory or a Service for my app and use it in any controller, which works fine.
So, I created a fb_connect factory function.
The problem is that now, in every page (every controller), I have to define that fb_connect in the constructor of every controller - for example :
function welcome($scope,fb_connect){});
What is the proper way to do this kind of actions using Angular without having to define these functions each and every time in every controller?
Thanks
Setting up factories and services is all part of the dependency injection system of Angular. Using that system is great when you need to create things that depend on other injected things. It's a big tree of dependencies. It's also nice for creating singletons, such that everywhere in your code end up using the same instance of some object.
It sounds to me like neither of these benefits apply in your case. I'd suggest just not using Angular's DI for it. You have some function defined globally, just call it directly and skip the DI. There's nothing wrong with that.
Of course you say it makes an Ajax call, so doesn't depend on the Angular $http service?
Your two options are:
Declare the function on the $rootScope
Inject it as a service
My advice is to go with making it a service. The whole purpose of services is explained in the Angular.js docs, just like this quote:
Angular services are singletons that carry out specific tasks common to web apps... To use an Angular service, you identify it as a dependency for the dependent (a controller, or another service) that depends on the service.
As you mentioned in your question, you'd prefer to not define the service in every controller you wish to use it in. With $rootScope you'll be injecting that also in every controller. So really it's a question of which you prefer, although to answer your question, the proper way of using a factory or service is to inject it into the controller you wish to use it in.
You can always put it in the $rootScope
myApp.run(function($rootScope, fb_connect){
$rootScope.welcome = function(){
};
});

MvvmCross - structuring shared View Models and Views

Love this framework thus far.
That said, hit my first roadblock. I have created an MvvmCross-based library (actually a few libraries) that performs login services that will be used across multiple cross-platform applications of the same family. What I can't quite figure out is how to plug these login libraries into my other applications (which will also be using MvvmCross). I want to be able to re-use the same ViewModels and Views across these apps.
Assume that I've read and watched a lot of slodge's videos. :) Which are very good.
I think MvvmCross with two core libraries was about the closest thing to what I'm trying to do, which is just smash MvvmCross projects together and make it all magically work. But going by that post, which had some inconsistencies in the code samples, I've been unable to get this working.
There are 2 methods in Setup which tell mvvmcross where to look for Views and ViewModels. If you override these then the system should find your views and view models.
protected virtual Assembly[] GetViewAssemblies()
{
var assembly = GetType().Assembly;
return new[] {assembly};
}
protected virtual Assembly[] GetViewModelAssemblies()
{
var app = Mvx.Resolve<IMvxApplication>();
var assembly = app.GetType().Assembly;
return new[] {assembly};
}
Beyond this, the only additions to this that I'm aware of are that you might need:
to give wp some extra help in finding the xaml urls for any views which are in additional assemblies - by default mvx only looks for the xaml uri in /views, not in any other folder in any other assembly. One way to provide the xaml urls is to add a MvxPhoneViewAttribute within the View's c# file, another is to override the MvxPhoneViewsContainer to make it provide custom urls.
to adjust some of the android project settings in order to get resources shared from libraries to main project (although this functionality has gotten much better within xamarin.android this year.

IMvxServiceProducer and IMvxServiceConsumer missing from latest NuGet

I'm using the latest NuGet packages for MvvmCross CrossCore, Hot Tuna, Location and Picture Plug ins, but I can't seem to find in the object browser the IMvxServiceProducer and IMvxServiceConsumer classes that are used in many examples. Doing a search for RegisterServiceInstance, I found Cirrious.CrossCore.IoC.MvxIoCExtensions. Did the two interfaces go away in place of something simpler?
Those interfaces were used in many v1 and vNext samples, but in v3 they have all been replaced with Mvx.Resolve<T> service location, or with cleaner constructor injection.
All the examples in https://github.com/slodge/MvvmCross-Tutorials/ and in the N+1 videos have been updated to use the newer APIs.
For a full explanation of v3's service location and IoC see: Instantiation of ViewModels and Service classes

Mapping Linq-to-Sql entities to custom domain entities

How could I map my Linq-to-Sql generated entities (DTO’s) to my domain entities? The problem is that I can’t map the associations because they are not of the same type. The DTO’s uses EntitySet and EntityRef and my domain entities uses IList and T.
I’ve looked at some blog post: Ian Cooper's architecting-linq-to-sql-applications-part-5 and digital_ruminations linq-to-sql-poco-support but they don’t fit my needs. I like some kind of generic converter class to handle the mapping.
Now I do something like this:
public IList<Entities.Customer> GetAll()
{
try
{
return _custConverter.Convert(base.GetEntities());
}
But the Convert method only converts the basic properties not the associations.
Any ideas how I can do this the best way?
You might want to look into AutoMapper. It does a great job of mapping properties automatically out of the box and supports extensive customization, such as custom converters, which I think could be used to make Lists out of your EntitySets.
Update:
The official project site and compiled releases are found in CodePlex (same link as above).
Code is SVN hosted at Google Code
Discussiong group is hosted at Google Groups
Accouncement and overview of features at Jimmy Bogart's blog post