How to build complex UI on Sharepoint? - sharepoint-2010

All,
We’re building an intranet on Sharepoint 2010. One of the requirement is to have a custom webpart/sharepoint page as a view to an Oracle EBS and HRMS.
This view have little (if at all any) interactions with Sharepoint functionalities.
This view is pretty complex in terms of layout, so we will definitely benefit of using asp.net user controls, rather than building all controls programmatically.
All operations lives in a WCF service which encapsulates all calls to Oracle.
Here are initial ideas:
Control.Load through a WSP – is this still valid with Sharepoint 2010?
use SmartPart to encapsulate the user control
Other ideas? Stand alone aspx page perhaps?
I would be keen to know the pros and cons of the approach. Cheers

Simplest solution might be to use the Visual Web Part -project type in Visual Studio 2010. It allows you to build Sharepoint Web Parts like regular ASP.NET User Controls. Because of Visual Web Parts SmartPart is no longer needed in Sharepoint 2010.
You can consume the WCF service in the web part or you could use Business Connectivity Services to create External Lists and use the Web Parts to interact with those lists.
If you are familiar with Silverlight I believe you can also use that to build the UI for your Web Parts.

Related

Approach at designing ASP.NET Core 2 applications that share functionality

Currently I've been tasked to create a bunch of small-to-medium applications, each of them having some common functionality.
Implement a preapproved boostrap-based graphical design. Therefore, they will use the same assets, images, css and JavaScript components.
Share the same licensing-based mechanism. An application service will be built where it will scan a file or database to get the number of licenses available for each app, thus granting or denying access to users. The only thing that varies is the name of the application instance itself.
Use AzureAD authentication.
Each must use the same authorization mechanism. A claims-based mechanism will be built to retrieve the claims from the database, given a user AAD account.
Each must share the same administration console.This console will be the one needed to populate user information and common catalogs.
A service will be built, to show toast notifications within the apps.
An email notification service will be built, to send emails to users when triggered by business rules.
And some other, less important features, but these are the core ones.
A first, perhaps naïve approach, was to create an ASP.NET Core 2 solution for each application, and implement the shared functionality in a sort-of Core assembly that can be shared by each app. However, while this could work for points 2 to 5, I'd still be repeating the graphical UI design for each app (basically, copying the wwwroot folder as well as the shared razor views five times). So, a change tomorrow in a CSS would have to be replicated five times.
Another approach would be to create a single ASP.NET Core 2 solution, implement the shared functionality and the UI, and then use the "areas" feature o ASP.NET Core 2, each area being a different app. The problem to this approach is shipping the app: if I have to install the five apps in a customer's server, no problem. If I have to install, say, only two apps, then I'd have to ship the five apps anyway and find a way to disable the other three apps.
So, I'd like to know if there is a feature in ASP.NET Core 2 for handling this type of scenarios, or alternatively, what are industry-standard architectural designs that could apply here.
In Windows Presentation Foundation with Unity, I can create a common shell, and then load modules in that shell, within the same shell window. So, using configuration files, I can add or remove modules as I see fit. What I'm looking is something similar in concept. I do not want to create five ASP.NET Core solutions and copy-paste the wwwroot folder and implement the same mechanisms of authorization, notification, email, etc., but rather, find a way to load the core, common features and then load additional features.
Thanks in advance.

How To Open A Meeting Page Client Side

I'd like to open a SharePoint 2010 meeting page from a client side, Win form, C# application. How is this done? There is plenty of documentation to open a site and a List page but almost nothing on this. Can anyone help?
I think you cannot open the page per se (unless you use a internet explorer wrapper). But you can get all the underlying data from that meeting (all data in sharepoint lives in lists) and render it in your winform page by rebuilding the page with winform layout, controls etc,
To extract the data you have a variety of options:
Client Object Model (check the item under building a console app) - http://msdn.microsoft.com/en-us/library/ee857094(v=office.14).aspx
Using Sharepoint Web services - http://msdn.microsoft.com/en-us/library/office/ee705814(v=office.14).aspx
Using the REST API - http://msdn.microsoft.com/en-us/library/ff798339.aspx
In your particular scenario I would go with the first option since it provides a more streamlined api for .net apps and allows among other goodies batching of commands which will improve the performance of your comms with the sharepoint server.

SimpleMembership - anyone made it n-tier friendly?

"SimpleMembership", we're told, is the future of asp.net membership / role management.
The MVC4 "Internet Application" template implements Account management using SimpleMembership. However, the way it is implemented merges all the application tiers into 1.
It kind of shocked me that after all the work they've put into layering apps properly with MVC, we get this shoddy implementation of "the way forward" for Membership with no DI, use of WebMatrix DLLs and complete lack of SoC. Particularly the ActionFilterAttribute for SimpleMembershipInitialization - it inherits from an MVC attribute and makes calls to the EF DBContext directly.
I realise I'm being lazy, but has anyone done a "proper" template using SimpleMembership that means I can have proper separated tiers in my app, and not have EF DBContext references in my MVC app?
One of powerful concepts of SimpleMembership is that you can customize the user profile to fit your application needs, as discussed in this article. For example, you may want to add email confirmation to your registration process which will require storing the user's email address in the user profile. In the previous membership/role management for ASP.NET this was very ugly to implement and added properties were stored in a blob. Yuck!
So what does this have to do with your question on making SimpleMembership n-tier friendly? While I agree that what the template generates is not n-tier friendly I would also state that most real MVC applications of any complexity will require customizing SimpleMembership, and therefore will require making a tier or layer that is specific to the application requirements anyway. Stated another way, creating a reusable tier for SimpleMembership would only be useful in the most basic MVC apps.
Personally I have come to the conclusion that what is generated by the Internet template in regards to SimpleMembership will almost always be modified. As the first article I referenced points out the first part of customization is getting rid of the SimplemembershipInitialization attribute, which is just a lazy way of initializing SimpleMembership in the event the developer is not using forms authentication. And often you will want to move the DBContext used by SimpleMembership into the DBContext for the rest of your application. User profiles are often tightly integrated with the rest of the application domain.
And since we are on the subject of SoC and ASP.NET security, I would argue that ASP.NET was never very good at this. For forms authentication you use an Authorize attribute on your controllers and/or actions which takes a role as a parameter. This forces the application developer to think about security design while designing the application domain. You have to determine what roles the application will have up front, and heaven forbid they change later because now you have to go through all of those attributes and update them accordingly. I have started to use a custom authorize attribute that takes as parameters a resource name and an operation type (ex: read, write, execute...). Then I can map roles to resource/operations in a database so that it can change easily, or even allow an administrator to make changes to how roles are implemented in the application. Microsoft is taking the same approach with ClaimsPrincipalPermissionAttribute now that they have incorporated WIF into .NET 4.5.
Updated 3/8/2013
I have created an open source project on CodePlex called SimpleSecurity that decouples SimpleMembership from the MVC application. You can read about it here. I still think developers will most likely want to modify SimpleSecurity but since this is open source they can. We will see if this is something we can evolve to be a reusable and better SimpleMembership.
Accepted answer is not correct, that is not N-Tier. The membership data access and business logic are occurring in the same layer. Just because code is in a different assembly doesn't mean it isn't in the same layer.
Without some kind of transport mechanism to the data access layer, this is not N-Tier.
The solution is to inherit and override the WebMatrix SimpleMembershipProvider class such that its data access calls can be performed on a separate host.
I recommend using dotPeek to look at SimpleMembershipProvider so you know what to do in your overrides.
I think your question relates more to SoC than n-tier architecture (which is more about physical separation between layers as pointed out by #klatzib).
I would argue that the logic within the membership providers should not be classed as business logic as they do not contain application or client specific code. In fact the idea of the provider model is that it fulfils a generic contract irrespective of the context in which it's used. A common mistake developers make is extending MembershipProvider and bolting in application specific business logic that should exist in a higher layer. If that's what you want to achieve with a alternative design, then that's the wrong approach. Providers are plugins for the .NET framework, and should be entirely abstracted from code. They certainly shouldn't contain your application domain, and you should very rarely need to extend them.
Addressing your question another way, does the SimpleMembershipProvider prohibit SoC in application design or even n-tier architecture? No it doesn't. The MVC4 template is built for simplicity, but the ActionFilter used to initialize the provider is not part of the membership implementation, and you are free to initialize the the provider in any way you see fit (I prefer making this call from a DI container factory method). In fact SimpleMembershipProvider as no direct dependency on EF at all, so yes it is possible to remove references to EF DbContext in your web app.
Exactly what I was looking for (almost). Just wish it wasn't tied into entity frameworks as I was hoping to get Kevin's n-tier solution working with Dapper ORM :(

Third party components in Sharepoint

Has anyone had experience with using third party components in Sharepoint please?
I am considering using Infragistics or Telerik. But would love to hear any case studies of how these or any others can integrate well with sharepoint. I am using Sharepoint 2010
There are some Frameworks or Controls which don't work well in SharePoint. In SharePoint you always have to care about multiple Servers in a farm. There are also some JavaScript Controls which are great, for example I couldn't get ExtJS working with SharePoint 2010.
In my opinion it's safer to use Silverlight and use the fancy UI controls inside of a Silverlight component. By doing it this way, we could ensure that we don't harm the SharePoint farm.
Take look at the SharePoint Kits from the most famous .NET components vendors:
DevExpress
Telerik
ComponentOne
Infragistics
SharePoint is still an ASP.Net application and so I really don't think there will be any issues.
There are lot of clients I worked/working with who uses Telerik with SP2010

Integrating Sharepoint Calendar into Web Forms

I'm attempting to add a calendar to one of our VB.NET Web Forms-based websites which will be used for scheduling purposes. We want to have this calendar sync with our corresponding Sharepoint calendar.
My problem is this: I know that I can integrate a Web Part into a Web Forms page; can said Web Part use a calendar from our Sharepoint site as its data source? If so, how would I go about doing that?
Thanks for your help; I've done a lot of looking online, and I haven't been able to find anything, one way or the other.
you can integrate the webform calendar with sharepoint calendar using the webservices exposed by sharepoint in your case you would require to use lists.asmx
http://dotnetdreamer.com/2009/06/04/moss-web-services-accessing-sharepoint-list-data/