Archive

Posts Tagged ‘SharePoint’

User Interfaces generated by CodeFluent Entities using out-of-the-box producers

October 16, 2012 2 comments

Over the past articles we showed you how to use the following UI producers provided out of the box by CodeFluent Entities:

· Windows Store producer

· ASP.NET Web Forms Producer / AJAX/JSON

· WPF Smart Client Producer

· SharePoint Web Part Producer

In this article I want to emphasize the fact that CodeFluent Entities is totally UI-agnostic. Indeed from the same and unique model you can generate screens that will be rendered in the targeted platforms of your choice. Here is for instance the list of all UI producers available:

UI_Producer

Let see all the user interfaces that CodeFluent Entities has been able to generate from the exact same model, using those different producers.

Note that the generated applications are not just a set of user interfaces; they are actually complete interactive applications sharing the same business object model, database and are 100% functional.

We used the “ContactManager Sample Model” supply by CodeFluent Entities:

ContactManagerModel

Here is the ContactManager model:

ContactManagerSurface

Since we’ve already seen how to use the producers provided by CodeFluent Entities in previous blog posts I’m going to skip their configurations and directly present you the generated UIs:

UI generated using the Windows 8 Store Producer:

The homepage generated by default lists all namespaces and their contained entities:

Windows Store (1)

Clicking on an entity gets you to the entity page.
On this entity page you’ll find a screenshot of the entity from which this page was generated.

Right Clicking on this page or typing Ctrl+Z will bring up a menu at the bottom where you’ll find the list of actions available on this entity. Those actions correspond in fact to business methods provided by the entity:

Windows Store (2)

Here is the screen displaying for the Contact entity when clicking on the “LoadAll” button and then selecting a contact:

Windows Store (3)

Bringing back the menu by hitting Ctrl+z or right clicking will enable you to create, edit or delete an entry:

Windows Store (4)

For instance, pushing the Edit button will give you the following screen:

Windows Store (5)

UI generated using the ASP .NET MVC Producer:

The homepage generated by default lists all namespaces and their contained entities:

ASP NET WebApp (1)

Clicking on an entity gets you to the entity page.
On this entity page you’ll find a screenshot of the entity from which this page was generated.

On the left side of the page you’ll find a list of actions available on this entity. Those actions correspond to business methods provided by the entity:

ASP NET WebApp (2)

Here is the screen displaying for the Contact entity when clicking on the “LoadAll” button:
It lists all the contacts through an HTML table and enables sorting.
From it you can detail, edit or remove a contact.

ASP NET WebApp (3)

Clicking on the “Details” hyperlink will bring up the following screen:

ASP NET WebApp (4)

Clicking on the “Edit” hyperlink will enable you to edit the entry:

ASP NET WebApp (5)

UI generated using the ASP .NET AJAX Producer:

The homepage generated by default lists all namespaces and their contained entities:

ASP NET AJAX-JSON (1)

Clicking on an entity gets you to the entity page.
On this entity page you’ll find a screenshot of the entity from which this page was generated.

On the left side of the page you’ll find a list of actions available on this entity. Those actions correspond to business methods provided by the entity:

ASP NET AJAX-JSON (2)

Here is the screen displaying for the Contact entity when clicking on the “LoadAll” button:
It lists all the contacts through an Ajax grid supporting sorting and paging.
From it you can detail, edit or remove a contact.

ASP NET AJAX-JSON (3)

And the one when clicking on the “Edit” button:

ASP NET AJAX-JSON (4)

UI generated using the ASP .NET WebForms Producer:

The homepage generated by default lists all namespaces and their contained entities:

ASP NET WebForms (1)

Clicking on an entity gets you to the entity page.
On this entity page you’ll find a screenshot of the entity from which this page was generated.

On the left side of the page you’ll find a list of actions available on this entity. Those actions correspond to business methods provided by the entity:

ASP NET WebForms (2)

Here is the screen displaying for the Contact entity when clicking on the “LoadAll” button:
It lists all the contacts through an HTML table and enables sorting.
From it you can edit or remove a contact.

ASP NET WebForms (3)

And the one when clicking on the “Edit” button:

ASP NET WebForms (4)

UI generated using the Smart Client (WPF) Producer:

The first screen generated by default lists all namespaces and their contained entities:

SmartClient (1)

Clicking on an entity will load all the data corresponding to it:
From it you can create, edit or remove an entry.

SmartClient (2)

Clicking on an entry will open a window to edit it:

SmartClient (3)

UI generated using the SharePoint WebParts Producer:

The homepage generated by default lists all namespaces:

SharePoint (1)

Clicking on a namespace lists all its entities:

SharePoint (2)

Clicking on an entity gets you to the entity page:
It lists all the data of that entity through a Web Part.
From it you can create a new entry, detail, edit or delete one.
SharePoint (3)

For instance, clicking on an entry brings up its details:

SharePoint (4)

and clicking on the “Edit” button brings up the editor:

SharePoint (5)

As you can see, from a same model we have generated several UIs all consistent with each other.

Besides, thanks to the Platform Independent Form Editor you can also define forms directly on their entities which will then be translated into actual screens by user interface producers. We talked about it in details in this article.

Finally, in the case you did not find the desired producer, I remind you that you can create your own template and use it with the Template Producer or you can even create your own custom producer. All you’ll need to do would be to implement the IProducer interface.

To sum up, CodeFluent Entities is able to generate 100% functional applications with the UI of your choice just by using the right producer.

Cheers,

Thibault Nestor

September 26th 2012 Links: Visual Studio, Windows, SharePoint 2013, .NET 4.5, Roslyn, eBooks

September 26, 2012 Leave a comment

Here is our new entry in our link-listing series:

 

Visual Studio

Visual Studio 2012 released to the web

Visual Studio 2012 is available for download!

 

Windows 8

Windows 8 RTM is available for developers

Microsoft gives Windows 8 early access builds for developers.

 

Microsoft finally comes clean(er) on post-Metro naming plans

Microsoft is discontinuing its use of the term “Metro” used to describe the tiled user interface in Windows Phone and Windows 8. Its new name might be ‘Windows Store’.

 

Windows Server 2012

Windows Server 2012 is available

Windows Server 2012 is available!

 

SharePoint 2013

What’s Coming in SharePoint 2013

An updated user experience, some upgrades and I/O performance improvements, collaboration and social networking capabilities, better tagging, SkyDrive Pro replacing SharePoint workspaces and so on.

 

Dev

Announcing the release of .NET Framework 4.5 RTM – Product and Source Code

.NET Framework 4.5 is available as well as the reference source code under the Microsoft Reference Source License (MS-RSL). You’ll find improvements brought by this release and some guidelines to debug with the .NET Framework library reference source.

 

Roslyn September 2012 CTP is now available

Good work in progress!

 

Free eBooks

Programming Windows Phone 7

Microsoft Office 365: Connect and Collaborate Virtually Anywhere, Anytime

Large collection of Free Microsoft eBooks for you, including: SharePoint, Visual Studio, Windows Phone, Windows 8, Office 365, Office 2010, SQL Server 2012, Azure, and more.

Here is a compilation of a variety of free Microsoft eBooks including: SharePoint 2013, Office 2013, Office 365, Azure, Cloud, Windows Phone and so on. Enjoy!

 

Cheers,

Thibault Nestor

March 19th 2012 Links: Windows 8, Visual Studio 11 Beta, Office 15, SQL Server, Tips

March 19, 2012 Leave a comment

Wow, this was a busy month!!

Here’s our latest batch in our link-listing series:

Windows 8

Windows 8 Consumer Preview

The Windows 8 Consumer Preview is now available!

 

Optimizing the .NET Framework Deployment Experience for Users and Developers

A great article which looks at the integrated experience that Windows 8 provides to run apps built for the .NET Framework.

 

Visual Studio 11 Beta

Welcome to the Beta of Visual Studio 11 and .NET Framework 4.5

Jason Zanders announces that Visual Studio 11 Beta, Team Foundation Server 11 Beta and .NET Framework 4.5 Beta are now available for download!

 

Introducing the New Developer Experience

In this blog post the Visual Studio Team introduces a few of the broad reaching experience improvements that they’ve delivered in Visual Studio 11.

 

Visual Studio 11 Beta Frequently Asked Questions (FAQ)

Jason Zanders answers some frequently asked questions on Visual Studio 11 Beta.

Note: Read the comments! Especially Patrcik Smacchia’s question:

-> Is there a chance that the VS team takes account of the thousands of negative feedbacks concerning greyish icons, and switch back to VSpre11 colorful icons?

To which Jason Zanders answered:

@Patrick – we have definitely heard the feedback.  as mentioned above, the beta is about getting feedback and will not reflect the final look and feel

 

Coming Soon: TFS Express

In TFS 11, Microsoft is introducing a new download of TFS, called Team Foundation Server Express which is free for individuals and teams of up to 5 users.

 

The C# 5.0 Beta Release is now available

Included in the Visual Studio 11 Beta, the C# version 5 and Visual Basic version 11 are shipped.

 

Office 15

Microsoft SharePoint 15: A 2012 release target, an app marketplace and more

Microsoft is adding new features to the next versions (Wave 15) of its SharePoint Server and SharePoint Online offerings. Mary Jo Foley takes an early look at some of them.

 

Microsoft chops Office 365 enterprise prices by 20%

Yay!! Price reductions!!

 

SQL Server

SQL Server 2012 RTM Available for Download

The new SQL Server version is available for download

 

Software Development

Envisioning the Future of UX: WebVisions NYC 2012

Some takeaways from the WebVisions NYC 2012 conference by Miao Wang

 

Cheers,

Carl Anderson

CodeFluent Entities: SharePoint Web Part Producer

February 10, 2012 2 comments

In previous posts, we’ve introduced the SharePoint Web Part Producer, shown its output, and that you could customize forms. In this post we’ll show you how to generate web parts Smile

To generate web parts, add the SharePoint Web Part Producer to your project by clicking “Add new producer” on the “Producers” folder in Visual Studio’s Solution Explorer, expand the Web Producers node and select it:

image

The SharePoint Web Part producer provides two main types of features:

  • code generation features,
  • deployment features.

You can use it to generate code, compile it and deploy it on a SharePoint server in the same run, however here since we want to be able to view and extend the code, compile with Visual Studio and deploy ourselves, we’re going to disable those deployment features.

Here’s a sample configuration:

image

Properties I changed are in bold:

  • Source Production > Target Directory (mandatory): I’m making it point to my class library project containing my generated .NET classes
  • Deployment > Copy Binaries: Set it to false, we’ll compile with VS so the producer has no binary to deploy yet,
  • Deployment > Update [trust].config: Set it to false, same as before, for now we’re developing, we’re not bothering with deployment stuff,
  • Deployment > Update web.config: Set it to false, same as [trust].config,
  • Site Creator > Produce MsBuild Task Files: The site creator feature is to create a document library on the SharePoint server to test our generated web parts, set it to false for now,
  • Site Creator > Produce Source Files: set it to false as well.

Build your project over and….ooops! We get the following error:

CF5519: The SharePoint WebParts producer needs the ‘SoftFluent.AssociationManage’ pattern to be included in the project.

Correct, the AssociationManage Aspect is needed by the SharePoint producer as it adds many-to-many management features which are required in the generated UI.

While we’re at it, I’d also recommend you add the AutoFormattable aspect to your project as in the generated UI, for one to many relations, you’ll get a preview of related data if any instead of just the number of related items.

image

Generate over, and there you go: you’ll see that custom web parts were generated:

image

Carl Anderson

CodeFluent Entities: Using your application in SharePoint 2010

January 25, 2012 1 comment

SharePoint 2010 provides a great feature named the Microsoft Business Connectivity Services (BCS) (formerly known as the Business Data Catalog in SharePoint 2007).  SharePoint’s BCS enables users to read and write data from external systems from within SharePoint 2010 and to do so you need to create an External Content Type to bring external data in SharePoint. Once you have an external content type, you can use it with any of the various presentation features of Business Connectivity Services such as external lists, external data columns, and external content controls for Office applications.

External Content Types can be created from databases, WCF services or a .NET assembly, and it just so happens CodeFluent Entities can generate any of the three, therefore using SharePoint’s BCS feature you can, without a single line of code, consume your application in SharePoint 2010!

Form a bird’s-eye view here’s how to do it:

Create Your Application

Nothing specific there: use CodeFluent Entities to design your application and generate the code!

For this post, we used:

  • the SQL Server Producer to generate the database,
  • the Business Object Model Producer to generate our .NET classes,
  • the WCF Service Producer to generate our WCF services and contracts,
  • the Template Producer to generate our WCF configuration file, as well as SVC files to host our services in IIS.

image

 

Create an External Content Type

As a data source to our external content type we used our WCF services so that manipulating data in SharePoint still uses our business logic and we don’t have to deploy our dll in SharePoint.

Here’s how how to do it: How to create an External Content Type based on a Web Service.

image

 

Create an External List in SharePoint

Once you have your External Content Type, still using SharePoint Designer, you can create a SharePoint list from it as well as Forms to create, list, update and delete data in SharePoint by clicking on “Create List & Forms”. Here’s how to do it: http://msdn.microsoft.com/en-us/library/ee558778.aspx.

Note: you can also do it from SharePoint, but don’t forget to create the InfoPath forms or else you’ll only be able to list and delete data as you won’t have any forms to create and update it.

image

 

Set Permissions so users can use the BCS

At this point, everything is ready however if you try to access your list you’ll get this error:

Access denied by Business Data Connectivity

That’s actually normal: by default no user (even the one who created it) can access external data, you need to grant this permission explicitly.

To do this, go to: Central Administration -> Application Management -> Manage Service Applications ->Business Data Connectivity Service* -> [Your Entity] -> Set Permissions, and grant them to the desired accounts or groups. (Here’s a nice blog post with screenshots illustrating how to do it: Access denied by Business Data Connectivity solution).

 

Result

And taadaa!! Here’s your data in SharePoint:

image image

Furthermore, now that your data is in SharePoint you can do way more that just listing them or editing them, you can for instance:

 

Cheers,

Carl Anderson

Adding a document template to a SharePoint 2010 List Template

January 3, 2012 2 comments

Did you ever get a “This file could not be found” error in Microsoft Word after trying to declaratively set a document template for a list template?

Solution04

I did! And as I didn’t find any satisfying solution on the web, here is mine.

Typically you get this error when creating a custom content type – let’s say “Expense” – to which you attach a document template – “ExpenseTemplate.docx” – that you import with a Module – “ExpenseTemplateModule”.

As you’re obviously following SharePoint best practices (see chapter “Finalizing the Definitions”), you decided to put your document template in the “_cts” hidden folder in the “Expense” subfolder.
Though I don’t recommend it, I’ve put all components above in one “element.xml” file for simplicity’s sake:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="ExpenseTemplateModule">
    <File Path="ExpenseContentType\ExpenseTemplate.docx" Url="_cts/Expense/ExpenseTemplate.docx" />
  </Module>
  <!-- Parent ContentType: Document (0x0101) -->
  <ContentType ID="0x0101007565c5a8bf1244838e8c8d3b3ea430cb"
               Name="Expense"
               Group="My Content Types"
               Description="Create a new Expense from a content type"
               Inherits="TRUE"
               Version="0">
    <Folder TargetName="/_cts/Expense" />
    <FieldRefs>
    </FieldRefs>
    <DocumentTemplate TargetName="ExpenseTemplate.docx" />
    <XmlDocuments>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Display>DocumentLibraryForm</Display>
          <Edit>DocumentLibraryForm</Edit>
          <New>DocumentLibraryForm</New>
        </FormTemplates>
      </XmlDocument>
    </XmlDocuments>
  </ContentType>
</Elements>

Then you create a list definition from content type – “ExpenseListDefinition” – with a list instance – “Expenses” (OK, give me a 9 for my creativity).
Following are the two “Element.xml” files automatically generated by Visual Studio 2010.

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List Definition project item, an error will occur when the project is run. -->
    <ListTemplate
        Name="ExpenseListDefinition"
        Type="10001"
        BaseType="1"
        OnQuickLaunch="TRUE"
        SecurityBits="11"
        Sequence="110"
        DisplayName="Expense List Definition"
        Description="List definition for the expense document library"
        Image="/_layouts/images/itdl.png"
        DocumentTemplate="121"/>
</Elements>
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="Expenses"
                OnQuickLaunch="TRUE"
                TemplateType="10001"
                Url="Expenses"
                Description="Document library to manage expenses.">
  </ListInstance>
</Elements>

Icing on the cake, you implement a feature event receiver to automatically enable content type on list instance.

using System.Runtime.InteropServices;
using Microsoft.SharePoint;

namespace ExpenseAccountLibrary.Features.Expense_Library
{
    [Guid("08e11c2c-7273-4b55-962b-db3704e70552")]
    public class Expense_LibraryEventReceiver : SPFeatureReceiver
    {
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            SPSite site = properties.Feature.Parent as SPSite;

            if (site == null)
                return;

            SPList invoiceList = site.RootWeb.Lists["Expenses"];
            invoiceList.ContentTypesEnabled = true;
            invoiceList.Update();
        }
    }
}

At this point, your Visual Studio solution should look like this:

Solution01

Once successfully deployed, you probably expect that creating a new “Expense” in your “Expenses” library should open ExpenseTemplate.docx in Word…

Solution02

Well, it doesn’t!

Solution03

Apparently, SharePoint is looking for the document template inside the library folder itself. I played with the Folder and DocumentTemplate nodes of the ContentType element (see first code snippet) with no luck.

Some people found an alternative solution by saving their folder in the LAYOUTS folder, but that’s not an option in my case as I want my templates to be locally saved and not accessible in every single site of my SharePoint farm.

I then wondered how SharePoint handles this when doing the same thing from web site administration. Well, it just duplicates the document template inside the “Forms” folder of the library in a subfolder that has the same name than the content type.

So let’s just do that, it’s quite simple, we only need to modify two files. First the “Schema.xml” underneath the ExpenseListDefinition element. The ContentType node has been copied from the first “Elements.xml” file (see first code snippet). Just modify the “Folder” node as the following:

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Expense List Definition" Direction="$Resources:Direction;" Url="ExpenseAccountLibrary-ExpenseListDefinition" BaseType="1" xmlns="http://schemas.microsoft.com/sharepoint/">
  <MetaData>
    <ContentTypes>
      <ContentType ID="0x0101007565c5a8bf1244838e8c8d3b3ea430cb" Name="Expense" Group="My Content Types" Description="Create a new Expense from a content type" Inherits="TRUE" Version="0">
        <Folder TargetName="Forms/Expense" />
        <FieldRefs>
        </FieldRefs>
        <DocumentTemplate TargetName="ExpenseTemplate.docx" />
        [...]

Then edit the “Elements.xml” file that define the list instance and add a new Module element to duplicate the document template:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="Expenses"
                OnQuickLaunch="TRUE"
                TemplateType="10001"
                Url="Expenses"
                Description="Document library to manage expenses.">
  </ListInstance>
  <Module Name="ExpenseListInstanceTemplateModule">
    <File Path="ExpenseContentType\ExpenseTemplate.docx" Url="Expenses/Forms/Expense/ExpenseTemplate.docx" />
  </Module>
</Elements>

Re-deploy your solution, and “voilà”, everything works great:

clip_image009

Thomas Ledan

Using Office Applications As Clients

August 3, 2011 Leave a comment

Using CodeFluent Entities you can generate synchronizable lists which lets you use Office Excel (2003 and upper) and Office Access (2007 and upper) as front-end clients of your application. This feature is actually discussed in this post: Introduction to SharePoint Lists.

However, in Excel 2007 and 2010, the ability to update SharePoint lists changed in the following ways:

  • Opening a list from SharePoint with Excel 2007 or 2010 disables the "Synchronize with SharePoint" feature.
  • Existing .XLS files from Excel 2003 still load and continue to support update functionality when opened in Excel 2007 or 2010.
  • Lists that link to a SharePoint site are converted to read-only tables when you save existing files to the new Open XML Excel 2007 or 2010 file formats.

This means that the synchronization functionality still works and is still assured by Excel, however Excel 2007 and 2010 can not access it when exporting from SharePoint.

To address this issue we released a tool named the SharePoint List Synchronizer.

It opens Excel in compatibility mode since the synch feature is still available in this mode, and loads the list. Once this is done, our tool is out of the equation, it’s fully transparent and restores the same experience as in Excel 2003.

If interested, more information on the tool is also available on CodeProject as well: Restoring Two-Way Synchronization on SharePoint Lists Using Excel.

Generate Web Parts Using CodeFluent Entities (Video)

June 27, 2011 Leave a comment

We introduced in previous posts that CodeFluent Entities provides a SharePoint Web Part Producer which lets you generate SharePoint web parts from your model:

Since you’re familiar with the theory, check-out this video to see how the generated web parts looks like by default:

Generating SharePoint Web Parts

Note: CodeFluent Entities supports WSS 3.0, MOSS 2007, SharePoint Foundation 2010, and SharePoint 2010

CodeFluent Entities Webinar – June 15th 2011

June 16, 2011 1 comment

In this webinar Carl Anderson demonstrates CodeFluent Entities using the latest release of the product. This includes designing an application from scratch, generating a database and .NET code, using the generated code, generating entire applications including UI (SharePoint and WPF Smart-Client), as well as importing an existing Microsoft Access database.

If you’re interested but could not attend to the webinar, you’ll be glad to know that it was recorded and is now available online:

http://www.youtube.com/watch?v=3r_pEmRLBuY

Note: Watch the video in HD by selecting the 720p option instead of the default 360p on the bottom right section of the player.

Introduction to SharePoint Lists

May 6, 2011 2 comments

Starting with Office 2003, Microsoft introduced SharePoint Lists which allow Office client application such as Excel to manipulate lists of data provided by SharePoint. This way users can keep information in their Excel/Access tables synchronized with a list hosted on the SharePoint site. This feature is available for Excel 2003+ and Access 2007+.

CodeFluent Entities can generate Web Services – which can be hosted in IIS or WCF – which emulate a SharePoint server so that Excel and/or Access can be used to edit your data. Since it leverages a Microsoft Office built-in feature, it does not require any deployment on user’s machines. The global architecture is illustrated in the following figure:

OfficeLists

As shown in the figure above, using the generated lists does not require SharePoint at all, it only emulates SharePoint as Office applications such as Excel and Access were built to consume Lists hosted in SharePoint. From a developer’s perspective, all server components from the data tier to the web services can be generated by CodeFluent Entities. By default each entity has a list per load method (e.g. LoadAll). Moreover, you can design extra lists by adding views on your entity. By the way, the generated classes are public partial classes, so if you need to create some very specific list, you can always write it yourself without having your code overwritten on a following generation.

Finally, since your generated lists use the business objet model to manipulate data, your business logic is still applied.

In a nutshell, generating Office synchronizable lists for Excel and Access enables end-users to edit and manipulate massive amounts of data in a familiar UI. End-users will benefit from advanced features such as Excel’s filters, sorting and pivot tables or Access’ Form View. Furthermore, it’s all based on a built-in feature which does not require to deploy any component on the client side, nor to actually have SharePoint on the server.

Follow

Get every new post delivered to your Inbox.

Join 694 other followers

%d bloggers like this: