Wednesday, April 18, 2012
Taxonomy Simple talk
Taxonomy in SharePoint 2010 is a new topic to organize and index the contents based on certain hierarchical group based.
Put it in simple word,How the supermarket organizing the products categorically to easy access by the customers.
By categorize the products by apartment wise,floor wise and rack wise.
In SharePoint provide this logical approach by using the "Managed Metadata Services".
SP object model gives the hierarchical view of the terms such as Session,Store,Group,TermSet and Terms.
On site capacity plan,Let assume we have a site for Tax Managing department for a corporate.Every time the users from the tax department uploads the document for collaborate and process for taxation,they needed a reliable mechanism to manage them in organized manner.
Suppose they wanted to search document,they can easily do it by supplying the keywords like "Sales tax 2011".Search will quickly returns the document.
Even though there were types of law related document stored in document library,It simply returns the relevant document.
So the term or keyword "Sales tax 2011" will be stored as Term in Managed Metadata service.We consume this from our site by placing the new column type "Managed Metadata".
Like taxonomy we have another fancy word folksonomy.This is nothing but user generated keywords when they uploading the document or record to be identified quickly.Example "Tag clouds".
Lastly,Taxonomy is nothing but "Classifying the information[contents] through hierarchical based approach".
Saturday, April 14, 2012
WCF Hosting in SharePoint environment
Creating the WCF service and consuming in SharePoint application is now improved.Later version we need to create the WCF service and hosting it in IIS server as stand alone application.
From this we need to create the "Proxy Class" using the tool wsdl or svcutility to be used on client application.
But this approach will not be so user friendly when it comes to SharePoint.
Again the hosting endpoint is the static one.
Maintainability and back up of the webapplication or service application in SharePoint is must not be complex.
Recent improvement has been done in WCF using Factory method.This will get rid of the static end point problem.It automatically set the dynamic end point in run time.
Create the SharePoint empty project.
Select the "SharePoint Mapped" folder.
Under ISAPI folder you'll the folder.Inside this folder create the "text file or xml file".
Copy the below line in to this txt or xml file.
<%@ServiceHost Language="C#" Debug="true"
Service="WCFHosting.Layouts.WCFHosting.ListService, $SharePoint.Project.AssemblyFullName$"
Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressBasicHttpBindingServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Rename this file's extension as .svc
Under the same folder create the code file type "Interface" and implement all the methods on the same file.
For simplicity I created the below class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Runtime.Serialization;
using Microsoft.SharePoint.Client.Services;
using System.ServiceModel.Activation;
namespace WCFHosting.Layouts.WCFHosting
{
[ServiceContract]
interface ServiceInterface
{
[OperationContract]
List GetAllRecords();
}
[BasicHttpBindingServiceMetadataExchangeEndpointAttribute]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class ListService:ServiceInterface
{
public List GetAllRecords()
{
List obj = new List();
SPListRecord record = new SPListRecord();
record.title = "SP"; record.name = "Pandian"; record.city= "Mumbai";
obj.Add(record);
return obj;
}
}
}
public class SPListRecord
{
public string title{get;set;}
public string city {get;set;}
public string name{get;set;}
}
Now we need to do important step to enable dynamic endpoint by sharepoint.
Now right click on your "Project" and choose the "Unload project".Edit the Project file(.csproj).
Inside the PropertyGroup place this tag
svc
Now reload your WCF project,rebuild and deploy it.
Now we have the full pledged and SharePoint compatible WCF service and it can be host anywhere in the Farm and it can be consumed in Application Page,Visual WebPart and InfoPath forms.
Wednesday, April 11, 2012
REST Web Service in InfoPath 2010
This blog will be underline the verily basic step needed to consume the REST Web service in Info Path 2010.
Here I have created the WCF Service using Factory method.There will not be the endpoint config entries.I just removed all the config entries in this WCF application.
On service file(.svc) used the Factory="System.ServiceModel.Activation.WebServiceHostFactory" in the markup view.
Download the Microsoft.Http.dll and Microsoft.Http.Extension.dll from the Microsoft site.
I have two method to retrieve the single record and one is for multiple records.
WCF interface implementation code
sing System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using Microsoft.Http;
using System.ServiceModel.Web;
using System.Text;
namespace RestWCF
{
[ServiceContract]
public interface RestWCFInfoPathCalculator
{
[OperationContract(Name = "SomeValue")]
[WebGet(UriTemplate = "/GetAllDetails")]
List GetAllDetails();
[OperationContract(Name = "GetBillValueByInv")]
[WebGet(UriTemplate = "/GetBillValue")]
BillDetails GetBillValueByInv();
}
[DataContract]
public class BillDetails
{
[DataMember]
public string InvoiceNumber;
[DataMember]
public double InvoiceAmount;
[DataMember]
public DateTime InvoiceDate;
}
}
Interface code implementation
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
namespace RestWCF
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
public class Service1 : RestWCFInfoPathCalculator
{
public BillDetails GetBillValueByInv()
{
return GetAllDetails().FirstOrDefault(c => c.InvoiceNumber == "2");
}
public List GetAllDetails()
{
List list = new List();
list.Add(new BillDetails { InvoiceNumber = "2", InvoiceDate = Convert.ToDateTime("12/03/2012"), InvoiceAmount = 34343.45 });
list.Add(new BillDetails { InvoiceNumber = "3", InvoiceDate = Convert.ToDateTime("08/03/2012"), InvoiceAmount = 6457.7 });
return list;
}
}
}
Host this WCF service in IIS.Video to help you on this [http://www.youtube.com/watch?v=iptFJaeJ-F0]
Now open your InfoPath Designer 2010 - > select the "Blank" form template
On Ribbon select the "Data" tab and click on "Data Connection" follow the screenshot.
Infopath Output.
Monday, April 09, 2012
Where is the love for InfoPath
One of the best blog over the Info path and its development aspects,I came across this blog.
where-is-the-love-for-infopath
It almost speak the real time development issues by most of the MVPs and not just pros and cons some of the blog entry those without going actual experimental.
An year ago,I was part of the team to develop the complex custom workflow using visual studio.At initial point we used the merely "approve/reject" option.Later the requirement need to incorporate to capture the "Life Cycle" of multiple workflow those are attached into document library,and wanted to use "Managed Meta Data" on all the user's comment and ratings over the document.
we shocked and stalled whether these are possible in Info Path.
Moreover,Configuring the info path for client side also is not easiest one.Every time we ended up with strange error.
Some point,we could not identify the actual errors on Logs either Windows Event log.
Cost issue also raised on that time,Client was very conscious on budget at one point they are not ready to go single license to adopt the Info Path strategy.
So we withdrawn the Info Path form development and put placed Custom ASPX form with all requirement that almost replicate the info path's layout/rules/action and enhanced rich features on the "Approval/Reject Form".
But I still love the info path where you don't need high complex business logic to be applied and ready to limiting the features to adopt Info Path.
Subscribe to:
Posts (Atom)





