Recently I was refactoring a SharePoint project and wanted to be able to move the Resources mapped folder to a location external to my SharePoint project. In case you're wondering the reason, I'm working with both SharePoint 2007 and 2010 and I'd like to be able to consolidate as much code as possible.
Here are the steps I took:
1) Add the mapped folder to the SharePoint solution
2) Move the folder to the new, external, location
3) Create a symbolic link to the mapped folder and point it at the original location of the mapped folder using mklink (http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx)
After these steps the Resources folder should still show up in your SharePoint solution package even though it's actually located outside the solution.
This blog shares some of the issues / experiences I have passed through related to development in SharePoint.
Monday, November 21, 2011
Wednesday, October 19, 2011
"Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges"..."Request failed"
When I tried running some code within the "Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges" block I received this exception message:
System.Security.SecurityException was unhandled by user code
Message="Request failed."
Source="Microsoft.SharePoint"
StackTrace:
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at JackBe.SharePoint.Core.Logging.SPLogger.Log(String message, CategoryID categoryID, TraceSeverity severity)
at JackBe.SharePoint.Core.Logging.SPLogger.Log(String message, CategoryID categoryID)
at JackBe.SharePoint.WebParts.MashletWebPart..ctor()
at T_27cf1440_c8a3_45ef_b04a_bcf1032711ed.CreateInstance()
at System.Web.HttpRuntime.FastCreatePublicInstance(Type type)
at System.Web.UI.WebControls.WebParts.WebPartManager.ImportWebPart(XmlReader reader, String& errorMessage)
InnerException:
It turns out the problem was I was executing this code too early in the page life cycle. I moved the block to "CreateChildControls" and the problem went away.
System.Security.SecurityException was unhandled by user code
Message="Request failed."
Source="Microsoft.SharePoint"
StackTrace:
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at JackBe.SharePoint.Core.Logging.SPLogger.Log(String message, CategoryID categoryID, TraceSeverity severity)
at JackBe.SharePoint.Core.Logging.SPLogger.Log(String message, CategoryID categoryID)
at JackBe.SharePoint.WebParts.MashletWebPart..ctor()
at T_27cf1440_c8a3_45ef_b04a_bcf1032711ed.CreateInstance()
at System.Web.HttpRuntime.FastCreatePublicInstance(Type type)
at System.Web.UI.WebControls.WebParts.WebPartManager.ImportWebPart(XmlReader reader, String& errorMessage)
InnerException:
It turns out the problem was I was executing this code too early in the page life cycle. I moved the block to "CreateChildControls" and the problem went away.
Monday, October 3, 2011
Recap from Tally Code Camp Talk
First of all I wanted to thank everyone who helped put together the code camp for this year. I had a blast and look forward to the next one. For those who wanted a copy of my slides and demo code on 'Building Robust SharePoint Applications' you can get it from my skydrive.
If you in or around the Tallahassee area I would like to encourage you to attend our next SharePoint user group meeting on Tuesday Oct. 18. Please visit our site to register.
If you in or around the Tallahassee area I would like to encourage you to attend our next SharePoint user group meeting on Tuesday Oct. 18. Please visit our site to register.
Tuesday, June 14, 2011
Enable SSL on Tomcat
As a little background, my current occupation involves connecting SharePoint 2007 / 2010 to an external enterprise mashup platform created by JackBe called Presto. Part of my testing recently included enabling SSL on Presto which is currently running on Apache Tomcat 6.0.xxx. Although simple to enable I still wanted to share my experience.
Granted these steps do not cover every scenario they are mainly geared toward setting up a test environment (not production).
Generate self-signed certificate on Tomcat
Run the following command:
Configure server.xml
Navigate to {apache home}/conf and update the following section by removing the comment
to:
Export / Import certificate
Once you have completed configuration of Tomcat, start the server. You will then need to export the certificate and import it into your browser for testing.
Once the certificate has been exported, import the certificate into your browser of choice and you're done!
Granted these steps do not cover every scenario they are mainly geared toward setting up a test environment (not production).
Generate self-signed certificate on Tomcat
Run the following command:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA
Configure server.xml
Navigate to {apache home}/conf and update the following section by removing the comment
from:
<connector port="8443" protocol="HTTP/1.1" sslenabled="true" maxthreads="150" scheme="https" secure="true" clientauth="false" sslprotocol="TLS">
to:
<connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" sslenabled="true" maxthreads="150" scheme="https" secure="true" keystorefile="<.keystore location>" keystorepass="
Export / Import certificate
Once you have completed configuration of Tomcat, start the server. You will then need to export the certificate and import it into your browser for testing.
export:
%Java_Home\bin\keytool -keystore "{keystore location=""}" -alias tomcat -export -file c:\presto.cert
Once the certificate has been exported, import the certificate into your browser of choice and you're done!
Friday, April 29, 2011
Error Generating Unit Tests
After trying to build my unit test project I noticed that some of the private accessors in my unit tests were no longer referenced properly. I tried to regenerate a unit test and came across the following error:
"The following error was encountered while reading module 'Microsoft.SharePoint': Assembly reference not resolved: Microsoft.Internal.Mime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35."
When I copied the dll of the project throwing the error to the GAC the build error disappeared. I removed the dll and the error was back. I then tried to remove the Microsoft.SharePoint reference from my project and add it back. Still no luck.
My final step was to delete the project file from the solution and re-create the project with a fresh project file. Problem solved.
"The following error was encountered while reading module 'Microsoft.SharePoint': Assembly reference not resolved: Microsoft.Internal.Mime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35."
When I copied the dll of the project throwing the error to the GAC the build error disappeared. I removed the dll and the error was back. I then tried to remove the Microsoft.SharePoint reference from my project and add it back. Still no luck.
My final step was to delete the project file from the solution and re-create the project with a fresh project file. Problem solved.
Wednesday, March 23, 2011
Create External Content Type Using SP Designer 2010 with Remote Database
With the release of SharePoint 2010 came many significant improvements to the SharePoint platform. Among them was the release of SharePoint Designer 2010. After working with the new release of SharePoint Designer I have been *very* impressed with the improvements that have been made.
It wasn't until today that I was problem free with SharePoint Designer. It started off with beginning to work more closely with External Content Types using the Secure Store Service. Due to the amount of time spent trying to come up with a solution alone, was reason enough for me to write something about it.
Scenario: Connect to remote SharePoint site collection in SharePoint Designer 2010 to create an External Content Type from a SQL database that isn't on the same server as SharePoint.
Problem: Because I'm using NTLM authentication I am unable to connect to the database through SharePoint using Pass Through Authentication. The limitation with NTLM is that it doesn't support multiple server hops.
Procedure: First step is to create a Secure Store Application for my connection to the remote MS SQL database. The reason for this is it acts as a bypass to the multiple server hop limitation with NTLM by authenticating against the Secure Store Service using my NTLM credentials to retrieve the credentials needed to authenticate against SQL server and then having SharePoint use those credentials and authenticating against SQL server.
Because SQL server is on a different domain than my local box I decided to use SQL authentication not Windows authentication to login against SQL server. I created a SQL account that I could use for the external content type and mapped that user to my SharePoint account in the Secure Store Application.
Everything was setup to work properly...the problem was when I tried to connect to the database I was getting back an error message:
It wasn't until today that I was problem free with SharePoint Designer. It started off with beginning to work more closely with External Content Types using the Secure Store Service. Due to the amount of time spent trying to come up with a solution alone, was reason enough for me to write something about it.
Scenario: Connect to remote SharePoint site collection in SharePoint Designer 2010 to create an External Content Type from a SQL database that isn't on the same server as SharePoint.
Problem: Because I'm using NTLM authentication I am unable to connect to the database through SharePoint using Pass Through Authentication. The limitation with NTLM is that it doesn't support multiple server hops.
Procedure: First step is to create a Secure Store Application for my connection to the remote MS SQL database. The reason for this is it acts as a bypass to the multiple server hop limitation with NTLM by authenticating against the Secure Store Service using my NTLM credentials to retrieve the credentials needed to authenticate against SQL server and then having SharePoint use those credentials and authenticating against SQL server.
Because SQL server is on a different domain than my local box I decided to use SQL authentication not Windows authentication to login against SQL server. I created a SQL account that I could use for the external content type and mapped that user to my SharePoint account in the Secure Store Application.
Everything was setup to work properly...the problem was when I tried to connect to the database I was getting back an error message:
I then looked in the Secure Store Audit table in the SQL database and noticed that nothing was being logged for the requests from Designer. My next step was to close down SharePoint Designer due to a possible issue with caching. After reopening I selected the Impersonate Custom Identity option and entered the Secure Store Application ID which would return the windows identity credentials I had stored in the application. When I was prompted with a Windows login, I entered the SQL DB user credentials which worked!! When I opened the connection properties I noticed that the Secure Store Application ID wasn't what I had first entered...wierd. The secure store application ID was what I had configured to return the SQL server credentials. Bottom line...try and try again.
So, looks like there are still some kinks with SharePoint Designer 2010. If I discover any further oddities I'll be sure to update this blog.
Wednesday, March 9, 2011
Installing Language Pack on Microsoft Office SharePoint Server 2007 (64 bit)
This post will help you setup language translation for your SharePoint deployment. The links below are for 64 bit systems only. You will need to download / run all of the following, in order. Before downloading each file, select the language for the service pack.
5. Run SharePoint Product and Technologies Configuration Wizard
6. Create a new site in SP and select the language you just installed
Thursday, February 17, 2011
Recap from Houston SharePoint User Group
First I wanted to thank everyone for coming out to the user group last night in Houston. It was great to meet many of you all and I thoroughly enjoyed my time. Discussing integration of SharePoint with an enterprise infrastructure can be quite daunting but I feel like the message got across based on some questions during and after the presentation. I would appreciate any constructive feedback related to my presentation by commenting below.
As a side note, one of the attendees asked a very good question around authorization of multiple SharePoint lists from different SharePoint farms. I wanted to highlight this at the beginning and provide a more complete answer. Because of the nature of mashing SharePoint lists in a different environment such as Presto the security context in SharePoint no longer applies.
As a side note, one of the attendees asked a very good question around authorization of multiple SharePoint lists from different SharePoint farms. I wanted to highlight this at the beginning and provide a more complete answer. Because of the nature of mashing SharePoint lists in a different environment such as Presto the security context in SharePoint no longer applies.
Therefore we have security built around the SharePoint lists registered in mashup server which then carry over to mashups created using the SharePoint lists. In doing such the creator of the mashup can setup custom authorization to that SharePoint list. I didn't want the audience to think that we were compromising security in order to simplify access to external SharePoint data. I hope this is clear.
In brief there are three challenges organizations will have to face related to integration when deploying SharePoint as part of their information infrastructure. We have titled them as the "Inside-Inside", "Outside-Inside" and "Inside-Outside" problems.
"Inside-Inside" Problem
With the exponential growth of data within a SharePoint deployment comes the question of how to manage the data as well as consolidating the data in a rapid, yet concise fashion. One example that an individual asked me about last night was being able to bring a contact list from one SharePoint site over to another SharePoint site and allowing users to update the data in the new location. This is a classic example of the types of issues many organizations are facing today. At JackBe we like to use the phrase "Rapid Intelligence"; being able to harvest data, quickly, within SharePoint in order to help the end user make fast, intelligent decisions. Out of the box it is very difficult and tedious to manage SharePoint data stored in lists across multiple site collections. At JackBe we have developed a product that can quickly and easily "mash" SharePoint lists in a manner that can help minimize the SharePoint crawl problem.
"Outside-In" Problem
Within organizations is the challenge of collecting data external to SharePoint and brining it into SharePoint with as little development cost as possible. SharePoint 2007 and 2010 answers this type of problem using the "Composites" piece of the SharePoint pie. More specifically the Business Data Catalog (BDC) in Moss 2007 and Business Connectivity Services (BCS) in SharePoint Foundation 4.0 and SharePoint Server 2010. In my demonstration list night I showed the audience how it is possible to gather data external to SharePoint such as a MS SQL table or a WCF web service and display that data within a SharePoint list using External Content Types; and do this without any code, all within SharePoint designer. I also pointed out that while the SharePoint Designer is capable of such tasks it is still quite limited in the types of LOB systems it can connect to. We are currently working on expanding the ability for the end user to be able to connect to most of the popular data sources and bring them into SharePoint as External Content Types without any custom development involved.
"Inside-Out" Problem
Once data begins to grow within SharePoint, organizations are also looking for ways to pull this data into other external portals or data centers. Currently the only way to accomplish such a task is to custom develop a SOAP client that is able to connect to SharePoint's web services and pull the list data out. At JackBe we have already included this capability within Presto by allowing users to register SharePoint lists and then Mash them together and publish them as Apps to just about any type of portal using simple scripting or even to other SharePoint farms.
In brief there are three challenges organizations will have to face related to integration when deploying SharePoint as part of their information infrastructure. We have titled them as the "Inside-Inside", "Outside-Inside" and "Inside-Outside" problems.
"Inside-Inside" Problem
With the exponential growth of data within a SharePoint deployment comes the question of how to manage the data as well as consolidating the data in a rapid, yet concise fashion. One example that an individual asked me about last night was being able to bring a contact list from one SharePoint site over to another SharePoint site and allowing users to update the data in the new location. This is a classic example of the types of issues many organizations are facing today. At JackBe we like to use the phrase "Rapid Intelligence"; being able to harvest data, quickly, within SharePoint in order to help the end user make fast, intelligent decisions. Out of the box it is very difficult and tedious to manage SharePoint data stored in lists across multiple site collections. At JackBe we have developed a product that can quickly and easily "mash" SharePoint lists in a manner that can help minimize the SharePoint crawl problem.
"Outside-In" Problem
Within organizations is the challenge of collecting data external to SharePoint and brining it into SharePoint with as little development cost as possible. SharePoint 2007 and 2010 answers this type of problem using the "Composites" piece of the SharePoint pie. More specifically the Business Data Catalog (BDC) in Moss 2007 and Business Connectivity Services (BCS) in SharePoint Foundation 4.0 and SharePoint Server 2010. In my demonstration list night I showed the audience how it is possible to gather data external to SharePoint such as a MS SQL table or a WCF web service and display that data within a SharePoint list using External Content Types; and do this without any code, all within SharePoint designer. I also pointed out that while the SharePoint Designer is capable of such tasks it is still quite limited in the types of LOB systems it can connect to. We are currently working on expanding the ability for the end user to be able to connect to most of the popular data sources and bring them into SharePoint as External Content Types without any custom development involved.
"Inside-Out" Problem
Once data begins to grow within SharePoint, organizations are also looking for ways to pull this data into other external portals or data centers. Currently the only way to accomplish such a task is to custom develop a SOAP client that is able to connect to SharePoint's web services and pull the list data out. At JackBe we have already included this capability within Presto by allowing users to register SharePoint lists and then Mash them together and publish them as Apps to just about any type of portal using simple scripting or even to other SharePoint farms.
Labels:
Houston SharePoint User Group
,
JackBe
,
Presto
,
SharePoint Designer
Subscribe to:
Posts
(
Atom
)