Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Thursday, March 21, 2019

Embedding a Visio Diagram in SharePoint Online using Visio JavaScript API

Why?

Couple of reasons,
  1. Time taken to load the diagram using Visio Web Access web part is very high.
  2. Microsoft no longer is recommend to use Visio Services with SharePoint Online.


We no longer recommend using Visio Services (also called Visio Web Access)  or the Visio Web Access Web Part with SharePoint Online. These features will be retired from Office 365 and SharePoint Online. We will stop Visio Services and stop supporting the Visio Web Access Web Part in September 2018.
Note   In SharePoint Server, these features will be supported in accordance with the Microsoft Lifecycle Policy.
Use Visio Online from now on. Visio Online is your choice for future solutions in SharePoint Online. Visio Online is a new way to view, edit, and share Visio diagrams on the web. For more information, see View, create, and edit a diagram in Visio Online and Visio Online help.



Steps followed

  1. Edit the page you want to add the diagram.
  2. Insert Script Editor web part into the page
  3. Click on the "EDIT SNIPPET" and paste the following code
    1. Replace the value of the url with the "Embed URL" of the Visio  Online document


Only reason why I used the above approach is to hide the toolbars and borders.

You can use the following approach as well.

  1. Just copy the "Embed Code" of the Visio Online document



  1. Copy  that into an "Embed Code" snippet in a page.

Thursday, May 28, 2015

Taxonomy hidden list is not synced after updating terms in termstore

Problem: After updating terms in term store, the value is not reflected in the list view. But in edit form it shows the updated term value.

Solution: Having done some investigation, figured out that the, TaxonomyHiddenList for the site collection has not been updated by the “Taxonomy Update Scheduler” timer job.
In order to sync the list manually, ran the following PS command.

$site = Get-SPSite "site collection url"
[Microsoft.SharePoint.Taxonomy.TaxonomySession]::SyncHiddenList($site)


Sunday, November 04, 2012

How to re associate list workflows with lists after a migration in SharePoint 2010

Recently I had been exercised on migrating a sub site into a root web in a different site collection.One of the major issue, out of many, was none of the list work flows were working.

After further investigations, figured out that the issue was due to old list Id’s that were associated with the workflows from the source site which I exported.

Follow the steps below to re associate new list Id’s with the workflow using MS SharePoint Designer.

Step 1: Open the site in SPD

Step 2: Locate the workflow you want to re associate with new list Id's (See image below)

blogpost-workflow-1

Step3: Change the 4 list Id’s numbered in below image with the new Id’s

blogpost-workflow-2

  • DocLibID
    • The list Id for the workflow definitions lists (This is a hidden list and you can use SharePoint manager to get the list id)-Refer the image below

blogpost-workflow-3

  • ListID
    • The list Id that needs to associate with the workflow
  • TaskListID
    • "Workflow Tasks" list Id
  • HistoryListId
    • "Workflow History" list Id

Saturday, March 17, 2012

Colombo SharePoint Camp 2012


This is surely going to be a quite a different experience for some of the SharePoint geeks in the community.Simply because, we are planning to have one kind of a hands on experience with SharePoint.

More info at http://www.colombosharepointcamp.com/

Friday, October 21, 2011

Configuring Forms Based Authentication (FBA) in SharePoint 2010

One of my favorite configuration tasks from SharePoint 2007 is to configure multiple authentication providers. So I wanted to do the same thing in SharePoint 2010 too. Here I will be using the MSSQL database as the membership store for the users.
Steps
  1. Create MSSQL membership store
  2. Create the new web application
  3. Configure support for FBA
    1. In Central Administration
    2. In new web application
    3. In STS web service (new in SharePoint 2010)
  4. Adding user policies to the web application
  5. Login to the site
Step 1: Create MSSQL membership store
This is where all the user details going to be store.
  • Create the database
    • Run the ASP.NET SQL Server Setup Wizard located at C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe and follows the instructions.
clip_image002 clip_image004 clip_image006
clip_image008clip_image010 clip_image012
    • Once completed create a separate database user and assign that user and add the “db_owner” role.
  • Add users into the membership store
    • Launch the Visual Studio and create a web site project
    • Add a connection string pointing to the above created database
    • Launch the “ASP.NET Configuration” wizard in “Website” menu item.
    • Click on the “Security” link and select the “internet” option and add users in to the store.
clip_image014
Step 2: Create the new web application
  • Go to Central Administration > Manage web applications and click on the “New” in the ribbon
  • Set the settings in the dialog box as in the below images (Check the red boxes)
clip_image002[4]
clip_image004[4]
  • Once the web application created, create the site collection as well.
Step 3: Configure FBA support
  • Edit the web.config for the central administration in the virtual directories folder
    • Add the following entry just above the </system.web> node
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<remove name="AspNetSqlMembershipProvider" />
<add connectionStringName="AspNetSqlProvider" passwordAttemptWindow="10" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" description="Stores and retrieves membership data from the Microsoft SQL Server database" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
<roleManager defaultProvider="AspNetWindowsTokenRoleProvider">
<providers>
<clear />
<remove name="AspNetSqlRoleProvider" />
<add connectionStringName="AspNetSqlProvider" applicationName="/" description="Stores and retrieves roles data from the local Microsoft SQL Server database" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
    • Add the below connectionString details just above the </configuration> node and put the corresponding values for the database,user id and password
<connectionStrings>
<add connectionString="Data Source=eccolw7ira;Initial Catalog=<database>;User ID=<user id>;Password=<password>" name="AspNetSqlProvider" />
</connectionStrings>
  • Edit the web.config for the corresponding site in the virtual directories folder
    • Add the following entry just above the </system.web> node.
      • Note : If the membership entry is already available , add only the missing entries (Highlighted in Yellow) from the bellow entry.
<membership defaultProvider="i">
<providers>
<add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<remove name="AspNetSqlMembershipProvider" />
<add connectionStringName="AspNetSqlProvider" passwordAttemptWindow="10" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" description="Stores and retrieves membership data from the Microsoft SQL Server database" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
<roleManager defaultProvider="c">
<providers>
<add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<remove name="AspNetSqlRoleProvider" />
<add connectionStringName="AspNetSqlProvider" applicationName="/" description="Stores and retrieves roles data from the local Microsoft SQL Server database" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
    • Add the below connectionString details just above the </configuration> node and put the corresponding values for the database,user id and password
<connectionStrings>
<add connectionString="Data Source=eccolw7ira;Initial Catalog=<database>;User ID=<user id>;Password=<password>" name="AspNetSqlProvider" />
</connectionStrings>
  • Edit the web.config located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebServices\SecurityToken
    • Add the following entry just above the </configuration> node

<system.web>
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<remove name="AspNetSqlMembershipProvider" />
<add connectionStringName="AspNetSqlProvider" passwordAttemptWindow="10" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" description="Stores and retrieves membership data from the Microsoft SQL Server database" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
<roleManager defaultProvider="AspNetSqlRoleProvider" enabled="true" cacheRolesInCookie="false">
<providers>
<add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<remove name="AspNetSqlRoleProvider" />
<add connectionStringName="AspNetSqlProvider" applicationName="/" description="Stores and retrieves roles data from the local Microsoft SQL Server database" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
</system.web>
<connectionStrings>
<add connectionString="Data Source=eccolw7ira;Initial Catalog=<database>;User ID=<user id>;Password=<password>" name="AspNetSqlProvider" />
</connectionStrings>
Step 4: Adding user policies into the web application
  • Go to Central administration > Manage web applications and select the web application and click on the “User Ploicy” button in ribbon.
  • Click on the “Add users” link and select the “Default” as the zone and click on “Next”.
  • Type the user name in the “Users” text box and click on the People Picker icon.
  • If everything configured correctly you should see the user name get underlined in the “users” box. OR
  • Click on the “Browse” button under the users text box and type the user name in the search text box and click on the search button.
  • And you should see the user name in the search result.
clip_image002[6]
Step 5: Login to the site
  • Open the site in browser and select the “Forms Authentication” from the drop down
clip_image004[6]
  • Provide the user credentials and you should be redirected to the home page
image

Monday, February 14, 2011

Arctic SharePoint Challenge 2011

The team Puzzlepart is sponsoring one of the most intriguing event you would ever going to experience during this winter.
Are you ready to take on the challenge ?
Visit http://arcticsharepointchallenge.com/ for more info and feel free to follow @SPChallenge (Dexter the Lynx challenge mascot) on twitter.

Sunday, September 05, 2010

Error accessing Business Data Connectivity Services in Windows 7

While I was doing some research on BCS , wanted to import a BDC model from Central Administration > Manage service applications > Business Data Connectivity Services.

As I hit the link,  following error message prompted.

 

bdc-service-error

As usual did a search on the Google and found out the following entries.

http://sensoft2000-sharepoint.blogspot.com/2010/08/error-access-services-is-unable-to.html

https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=23806

Downloaded the above fix and installed.

problem solved. :)

bcs-service

More references on the issue :

http://blogs.technet.com/b/dahnesh/archive/2010/06/16/error-while-accessing-business-data-connectivity-services-on-windows-7.aspx

http://support.microsoft.com/kb/976462

http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=976462&kbln=en-us

 

Tuesday, September 15, 2009

Internal names should be used in SPQuery

Today I found out an interesting issue when I accidentally changed a field name used in a query used in SPQuery.

I wanted to change the display names of my fields and after doing that I renamed all the usages of that field name in my web part code.

After deploying the solution I got the error message "One or more field types are not installed properly. Go to the list settings page to delete these fields"

I had no clue what so ever when you read that error message.This is not the only error message that share point generates which we cannot figure out by looking at this.

I spent considerable amount of time debugging the solution until I decided to Google the error message.

Then found that in one of the msdn forums that the internal names of the fields should be used in the CAML queries.

reference : http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/a2c6bed0-eee1-4f9b-b468-fc57c2e45c16

And that was indeed the trick.

Tuesday, August 18, 2009

How to avoid recursive calls in list item event receivers in SharePoint

I wanted to insert a value into a column in a list when adding and updating items in the same list.

First I registered the item event receiver into the list.

SPList list = web.Lists[listName];
list.EventReceivers.Add(eventType, assemblyName, className);

Then in the actual event receiver class I override the “ItemAdded” and “ItemUpdated” methods.



public override void ItemAdded(SPItemEventProperties properties)
{
SPListItem item = properties.ListItem;
string itemStatusValue = string.Format("Item added @ {0} by {1}", DateTime.Now.ToLocalTime(),
properties.UserLoginName);
item["columnName"] = itemStatusValue;

item.Update();
}

public override void ItemUpdated(SPItemEventProperties properties)
{
SPListItem item = properties.ListItem;
string itemStatusValue = string.Format("Item updated @ {0} by {1}", DateTime.Now.ToLocalTime(),
properties.UserLoginName);
item["columnName"] = itemStatusValue;

item.Update();
}

But when I debug this in VS2008 I noticed that, as the item get updated or added it always calling to the “ItemUpdated” method.Of course that is understandable since I am updating a column in the same list.

But I didn’t want that to happen.Then I found out that you can enable/disable event firing.

So the solution for that is ,

DisableEventFiring();
item.Update();
EnableEventFiring();

It is pretty straight forward once you get to know it.

More references on this : Visit BinaryJam

Friday, August 14, 2009

How to avoid inline codes in user controls in SharePoint web parts

When I was at the beginning of developing web parts for SharePoint , I wanted to find a way of reducing the time consume to develop web parts using Web User Controls (*.ascx) as web parts.Otherwise you will have to write all the mark ups in the CreateChildControls method.

Check here how to use web application projects to develop web parts.

So I was very fond of that method till I figured out, this is not going to inline with the SharePoint deployment techniques.Especially if you are using wsp solution packages and 12 hive structure in Visual Studio with WSPBuilder.

Recently in a project that I was working with, I used a slightly different approach to which I was used to.That is not using web application projects but I used the user control(*.ascx file) with inline codes for the web part in the templatecontrol folder.

There are pros and cons having inline codes.

The code is visible to a person who has access to the server directly.

If it is a complex web part your lines of code will be very high and which will lead to readability and maintainability issues.

Today I managed to figure out how to move inline code into your main assembly of your SharePoint solution and I thought of sharing that with you.

SampleWebPartControl.ascx (user control)

What is important here is that the entry in the RED box in above image.That is the way you specify where the code behind can be found for this user control.

SampleWebPartCOntrol.cs(code behind)

The initialization of user controls you are using is paramount(check the RED box in this image).I had all sorts of problems till I sorted that out.

Solution Structure

Check where the items in the RED box in this image.

Friday, August 07, 2009

List content type troubleshoot

Recently I had a problem with the default content types that are bind with a custom list.

I created an Announcement list and I have bind my own content type into it.Then I wanted to hide the default content type which is the “Announcement”.Initially I used the name to get the content type from the list but later I had to re factor it simply because, if we are to support multilingual we should not use names but id’s.

Then I thought this should be a piece of cake and I re factored it like bellow.

SPList list = web.Lists[listName];
SPContentType item = list.ContentTypes[SPBuiltInContentTypeId.Announcement];
item.Hidden = true;
item.Update();
list.Update();

To my amazement , as I activated the updated feature I got the error “Object reference not set to an instance of an object”.

And then I open this list from the SharePoint Manager and checked the ID of the content type “Announcement” and it is totally different one to the default content type id which is the “0x0104”.

Then I got some expert help on this and got to know that this is because what ever the bind content types in lists are a copy of the site content type.Thank you Bjorn for letting me know about it.

So here is the new code of doing it.

SPContentType item = list.ContentTypes[list.ContentTypes.BestMatch(contentTypeId)];

It was that simple once you got to know it.

So what you need to understand here is that adding a content type to a list means that you actually adding a copy of the content type.

Tuesday, July 28, 2009

SharePoint 2010 Sneak Peak

Are you wondering about how will SharePoint 2010 look like.Here we go click on SharePoint Sneak Peek.

Saturday, June 20, 2009

SharePoint tools for developers

There are very important tools that you can use while you are working with SharePoint development work.

I thought of putting down very important tools that you can use when comes to developing SharePoint projects.Those tools are really handy on reducing your development time as well as troubleshooting time.

WSP Builder – This is a VS extension which is fully cable of deploying sharepoint solutions.This is a dream tool you can think of the problem you are facing when comes to deploying SharePoint solutions.

Hats off to Carsten Keutmann

SharePoint Manger – This is a very useful tool to explore the every item in your SharePoint installation.

BareTail – This is also very important tool that can be used to view the SharePoint log files which lies in the 12 Hive.And you can use this tool to monitor any log file for that matter

Tuesday, June 16, 2009

Document Template Management in SharePoint

Very good article on SharePoint document template management.

Read it here.

Saturday, May 23, 2009

Localization of web parts in SharePoint

My colleague Sanjaya has posted a fantastic article on localizing SharePoint web sites and web parts.

One of the major problem when comes to localizing web parts is that you have to have all translations relates to the locale you are using, if you are to build the embedded resources.

So I would prefer let the customer do the translations rather than we do it.In that case if you can send the set of resources files ( *.resx ) to the customer he can easily open those files and he can do the translation as he needs.

What my colleague mentioned in his article is totally alright but it is not entirely to my likings when comes to localizing web parts because of the above mentioned reason.

So I just used the resources files (*.resx) but not deployed them as embedded resources.

How to do it ?

  • Add the relevant resource files in to your web part.
  • Use the following fragment of code to access the resource strings from the resource files as required in your controls.
  • HttpContext.GetGlobalResourceObject("<resource file name>", "<resource key>").toString()
  • Make sure to have the resource files in the “App_GlobalResources” directory of the corresponding web application project.

More can be read from the following references :

http://tomblog.insomniacminds.com/2008/02/25/sharepoint-internals-resources/

http://www.mikhaildikov.com/2007/03/sharepoint-resources-types-use-and_2163.html

Tuesday, May 12, 2009

SharePoint and Women

I read a very interesting blog entry published by Bjørn Furuknap and I should definitely share this with you.Read it here.

Thursday, March 12, 2009

Enabling anonymous access in MOSS

Recently I wanted to enable anonymous access to one of my sites in Share Point.I enabled the anonymous access to the web application from the IIS 7.Unfortunately it didn't work.

Then only I started googling on this and found out this wonderful blog post by Sven Gillis.

It indeed save my time and sharing with you all too.

Monday, February 16, 2009

Visual Studio 2008 extensions for SharePoint

I wanted to install VS 2008 extensions for SharePoint in my Vista box.I downloaded the package from here and started installing and got the following message

"This product can be installed if Windows SharePoint Services 3.0 has been installed first."

As usual searched in Google and found this blog entry on how to resolve the issue.

It was indeed save lots of time for me. Thanks goes to who ever contributed to this thread.