How to use controller injection in opentaps 1.5.0? - crm

I'm a few days new into opentaps, and I've been trying to add a menu item of an entity I created to the crm/sfa application tabs. Since almost no documentation exists on how to achieve this progress is slow. However I did come across this article and I've tried injecting my controller and the example controller into the app but so far gotten nowhere. Can anyone clarify this actually works as is documented and perhaps provide pointers as to how to achieve this.
Thanks

Yes this works and following the docs you should be able to use it. Please note that you can only inject one controller and not more than that. We created a patch which allows multiple controller injection and if you are interested I can send it to you.

Related

Silverstripe Class GridFieldConfig_RelationEditor

How does teh Class GridFieldConfig_RelationEditor in SIlverstripe work with data relations. Why do one need it?
It doesn't work with data relations directly. It's just a shortcut for configuring your gridfield for managing and editing relations of your gridfield. A quick look at the code might shed some light on it. The config items it adds are pretty self explanatory. You might also consult the API Docs for another explantion what this class does for you.
Understanding how the gridfield works is a bit hard in the beginning, but it's very modular and powerful. Out of the box it does pretty nothing but you can do a lot with it when you know how to configure it.
You use the GridFieldConfig_RelationEditor to configure your GridFields. The default configuration for a GridField is using a GridField_RecordEditor configuration... which means, by default you only have the option to edit existing data object (DOs displayed in the GridField). If you switch to the GridFieldConfig_RelationEditor configuration, you'll be able to link already existing data objects to the GridField, or unlink linked DOs in the GridField.

Dynamics CRM 2015 Creating a button to start a workflow

Hi I am currently trying to follow this guide:
https://ribbonworkbench.uservoice.com/knowledgebase/articles/132235-create-a-workflow-short-cut-ribbon-button-no-code
So that I can create a button on the ribbon in CRM to start a workflow. The idea being that the user will fill in part of the form and then request approval.
However I have ran into an issue which is that at one point I have to define the library for the command actions to use and the guide state that we must use the "/_static/_common/scripts/RibbonActions.js" and the "/_static/_forms/form.js" library.
However not having done this before I have no idea how to include the library in the solution, so nothing appears on the library selection screen. I have tried searching how to complete this step but to no avail. Any help would be greatly appreciated.
Thank you.
What I understood is that you are trying to call a workflow from javascript on click of a ribbon button. If you have any reference javascript assembly then both of them should be referred for the javascript method to work as expected.
Lets assume we have two different javascripts files like reference.js and actual.js And the button is supposed to call a method button_click from actual.js. In such a case we will be adding two commands as follows:
Library:reference.js and FunctionName:isNaN
Library:actual.js and FunctionName:button_click
This way the reference javascript also will be loaded and the method should be working properly. Hope I was able to address your query. Let me know if you have any questions or still the problem persists.
There is a possibility to enter plain text to library field instead of choosing from a selector.

Symfony2, how create a widget like a standalone class

Let's start with basic thing, simple example is Yii. It has such thing as widgets. Standalone, configurable and callable from any place we want classes. And I'm wondering can symfony2 has the same? What it will be? Controller in bundle? Action simple (method)? Widget (twig) with parameters?
In Yii we create class (of widget), standalone, describe it and use (by calling in template). How will it look like in symfony2?
Simple example 'i want create menu navigation using widget, where it will construct html by user roles'.
Symfony doesn't provide such a feature however you can make them yourself. They are few ways of doing it.
I'll just admit that we are talking about widgets that could do backend work (i.e. get data from DB, call an API, etc.).
1 - The scalable way
The use of the render tag in Twig which allows you to call a controller action from a template. It's scalable because you could use esi tags with Varnish (you can also implement your own caching profiles).
As a bonus, the profiler will show details about the specific render calls in the timeline (it will look like a subset of the entire request).
2 - Include a template
The included template gathers the data through a Twig function call. By experience, it's a bit faster than the first solution however it's not easily scalable.
3 - Render through a custom TwigExtension
The twig function will get the data and call the renderView method of the template service. If you are planning on doing this, you probably want to use the first method.
Conclusion
If you have a big website with modules/widgets that gets a lot of traffic (or "hit"): use the first solution.
If you have a small website with no support for caching: use the second solution. You'd use this solution if the module/widget is super light.
If you are thinking about the third solution... it's probably a good idea to use the first solution.
Personally, I'll always try to use the first solution and try to boost the performance one way or another. The render call in Twig has been significantly improved since the last versions of Symfony2.
Hopefully, my answer will provide you some guidelines.

Extending ASP.NET Role provider in MVC

I want know if this can be done and if there is somewhere that you can point me in the right direction.
Basically, at the moment, i am using the built in Role Provider for asp.net, on my controller actions, i use a custom attribute filter as described here.
But what i would like to do is extend it even further to do something like this:
Admin - View, Edit, Delete
Manager - View, Edit
So basically, granular permissions. I have searched around on the net, but can't seem to find any way of doing this without writing my own authentication/authorisation providers :(
Any help would be greatly appreciated!!
Cheers,
Nick
There are several ways to tackle this. The easiest (but not necessarily best) way is to have partial views with the navigation elements, view/edit/delete and if statements surrounding each link checking the currebt User's role.
Alternatively, at the other end of the spectrum is something called AzMan (Microsoft's Authorisation Manager) which allows you to create very granular role and task-based authorizations.
AzMan been around for ages but as far as I know it is now incorporated into MS's enterprise library.

Where IOchardServices gets its concrete class set?

I am looking at the Orchard source and am looking for where the IOchardServices gets its concrete injected. I realize that all one has to do is specify the IOchardServices as a param in a controller constructor and it'll get injected, but I want to know where Autofac actually does it. I was looking at '/Orchard/Environment/OrchardStarter.cs' and there are many builder..... calls and so it looks like injection is occurring there; did a search in that file for IOchardServices and didn't find it.
The reason I'm interested in this is, I need to do property injection on aspx pages' codebehind since our team will only be able to slowly migrate over to Orchard CMS and we'll need to keep our existing pages as is, well without too much modification. I also assume that when we have our own custom interfaces we'll want to inject and will need to know the best place to do this.
The actual injection is done within Autofac itself, not in the Orchard code. The autofac-configuration is done by several autofac-modules within Orchard-modules.
When you want to migrate to Orchard, you can just start by first using Autofac without Orchard. Define logical interfaces and put the Autofac-configuration in application_start in your global.asax. See here and here for examples.

Resources