Creating a Sharepoint solution from a site (including workflows and custom webparts) - sharepoint

Here's the scenario
I created a Site which in I used custom lists, webparts, custom developed webparts, workflows et cetera. You can see the site as an application.
What I am trying to do is to create a solution package which holds everything I build in that site so that I can give the solution file to an sharepoint administrator who can install the solution to his sharepoint environment.
For example look at the free application templates you can download from MSDN, I am trying to achieve the same as they did. One solution file to hold them all!
Any idea's?
Cheers!

Get STSDev and SharePoint Manager. STSDev is goog for creating the solution you want and SharePoint Manager can be used to get the SchemaXML from the customisations you have already created.
You will need to package up the webparts and everything. Unfortunately, this is a pretty hefty learning curve, so expect to do a lot of reading on this subject and some experimentation. However, this is time well spent as a solution is the "only" way to release a custom site definition.

Workflows created using SPD are not portable across sites - they will have to be recreated. As a result, Nathan's solution is probably going to be the only way to go.

Export the site as a template and include all the content. The workflows will point at the old site and will need to be updated manually, I believe. Everything else should work.

Related

SharePoint 2007/2010

I'm a developer with 5 years of MCMS development and without a single know how with SharePoint.
I want to use the CMS capabilities of Sharepoint to migrate my applications but I DONT KNOW HOW TO START!!!!!!
In my actual projects i have a Visual Studio solution with all my code, my templates and my usercontrols...
I cannot see how can i do the same thing with Sharepoint :(
I want to customise my site like i did before, i want to create pages based on templates like i did before.
Anyone knows where i can find a walkthrough that explains me that?
Thank U All.
Unfortunately I think you are going to have to learn SharePoint. Even the WCM features are a big topic, and probably the best book is Andrew Connell's "SharePoint 2007 Web Content Management Development" - I don't think a 2010 version is available yet. The good news is that I think the MCMS product had a big influence on how the SharePoint WCM features were architected, so the underlying principles will be similar.
SharePoint 2010 has a Visual Web Part that will encapsulate a user control which might make the transition easier. Also see my answer to this question about converting an ASP.NET site to SharePoint which might have some relevant information.
Most of the information about converting from MCMS to SharePoint is for the 2007 version of the product. This two-part article on MSDN seems to be the best starting point.
I cannot see how can i do the same thing with Sharepoint :( I want to customise my site like i did before, i want to create pages based on templates like i did before.
Problem is, SharePoint is not MCMS, no matter how Microsoft tries to brand it as its successor.
Creating sites in SharePoint is almost opposite of how things we were done in MCMS were you build from the ground up using ASPX templates, user controls and placeholders. In SharePoint, you'll have to strip out most of the OOB stuff you don't need. The recommended approach to custom development is through web parts, CAML, and the SharePoint APIs.

Sharepoint: How can I package a Content Type?

I've created a content type on my local dev server, how can I package this content type, so I can deploy it professionally to live installations?
An option is AC's WCM Custom Commands for STSADM.EXE which adds two commands which is relevant here:
GenSiteColumnsXml
GenContentTypesXml
These allow you to get the XML for Site columns and content types base on ones existing in a site
I would suggest you to look at the WSP Builder. It will help you a lot when creating SharePoint WSP solutions.
I came across this , http://moss2k7ctypesviewer.codeplex.com
SPSource is an open source project that can reverse-engineer quite a few SharePoint artifacts and is actively supported by knowledgeable SharePointers such as Jeremy Thake and Rich Finn. There is a bit of set-up time required however.
There's also SharePoint Solution Generator from the Visual Studio Extensions for WSS (although I would use SPSource over this any day).
Note that both of these options are much more comprehensive than what you've asked for and designed to extract the artifacts from an entire SharePoint site. So if you just want the content types go with Per Jakobsen's answer.

Best practice for redesigning a SharePoint site

Basically need to use SharePoint (because we promote MS yay!) as a content management system for an internet facing site.
How do I get rid of the default SharePoint look and feel and make it look like however I want it to?
I know the process involves creating a new masterpage with SharePoint Designer. However I prefer to code webpages rather than use a visual editor. Is this possible? Do I need knowledge of .NET?
Just check out ferrari.com for a very well made redesign of a SharePoint site.
Heather Solomon's Branding SharePoint series would be a good place to start. There's a lot you can do just with CSS, JS and HTML, but the most complete solutions (like Ferrari) require some pretty extensive customization with .NET and other SharePoint development techniques (features and delegate controls, in particular).
Your branding effort will be a lot easier if you only need to heavily brand the public-facing "publishing pages", from which you can remove most of the SharePoint-specific elements that make branding difficult.
Also, SharePoint Designer has a source view if you don't like the visual editor.
Yes it is possible to make it look like however you want it to (as you've seen from the Ferrari site). However to create that sort of site takes a lot of work.
Microsoft recommend the use of SharePoint Designer for 'designing' pages and layouts. However changing their behaviour almost always needs Visual Studio and development in .NET. You can largely avoid SharePoint Designer (which may worth considering as it can be a PITA) with an open source tool such as SPVisualDev. Use this with WSPBuilder for packaging your solutions (and avoid VSeWSS where possible).
Considering it sounds like you're just getting started, be aware this is a big topic with a reasonable learning curve. Read a good book on the topic such as Professional SharePoint 2007 Web Content Management Development: Building Publishing Sites with Office SharePoint Server 2007 by Andrew Connell. It takes you through most things you will encounter from the ground up.
I'm working my way through Real World Branding by Andrew Connell at the moment. It seems like a good demonstration, with code.
Plus the Heather Solomon articles as suggested by dahlbyk are always informative.
Just changing the theme, or creating a custom theme for the site, can go a long way towards making SharePoint look a lot better. It's also a lot less intensive then changing the master pages.
How to create a theme
How to deploy a theme
Example customization you can do with just CSS
Does the EULA allow you to disguise the fact that it's MS software?
Remember, you didn't buy the software, you're just paying for the privilege of using it.

How do modify a form on a sharepoint site?

I have a task that I need to perform for a friend as a favor, to modify some forms on a MOSS/Sharepoint site to add some javascript to each form for some SEO tracking purposes.
I've had a little bit of exposure to Sharepoint, but it is mostly by using the Sharepoint Designer 2007 tool.
I am able to navigate to the site, and I can see the content in Sharepoint Designer. However, I am not able to see the forms, and I'm a bit stuck.
Here is an example of a form that I need to modify:
http://www.MY_SITE_GOES_HERE.com/forms/covg_order.aspx
I've read a little online, but I'm stuck. I don't know if these are infopath forms or what. I just need to modify the forms.
Is there a simple answer to this problem? Or a good resource to get up to speed quickly for this task?
I'm not a sharepoint expert, so thank you in advance for answering a simple question.
While hardly the simplest approach, but since this is a developer site, I would recommend creating a DelegateControl to add to your site. Using DelegateControls has several benefits, for example:
the ability to selectively activate and deactivate the controls through features
no need to modify any out-of-the-box files which would break supportability
ability to output different content on a page-by-page basis
You can opt to use one of the DelegateControls of the default master pages if you need to deploy to an existing site based on one of the default site definitions. The AdditionalPageHead is a favorite among developers, as it allows multiple overrides to be active at the same time.
If you want to create your own master pages you can add DelegateControls as you like.
If you want to learn more about DelegateControls you can check out the first issue of Understanding SharePoint Journal (Disclaimer: I wrote that issue). Also, check out the MSDN article on How to customize a Delegate Control.
.b
you can also check PowerForms which is a silverlight webpart that fully customizes sharepoint forms. You can add business logic in forms using custom assemblies and a lot other advanced tasks. Give it a try, i think it will solve a lot of problems.
http://www.bpc.gr/powerforms
You have a couple of options here:
If you need to add a unique code, like Google analytics you should probably deploy your code to the master page.
In case you need to customize forms for lists you will have to do it with SharePoint designer. In that case you will find EditItem.aspx and NewItem.aspx with SharePoint Designer pages or any other custom page. Open SPD, locate your list, expand it, look for Forms subfolder and you will find all the forms there.
Microsoft Office SharePoint Designer is now free, as of 1-Apr-2009. It's a good tool, not only for modifying individual pages, but for entire sites.

SharePoint 2007 Publishing site development and deployment

I am total beginner in SharePoint and I need some help in starting a project. I have to develop publishing site that will be delivered to the client. I would like to give client deployment experience like he would get when deploying standard ASP.NET application as much as possible. I plan to use Visual Studio 2008 with SharePoint extensions and maybe WSPBuilder or some other tools.
I also need help in structuring whole project.
Here is what I plan to do:
1. Develop minimal site definition
2. Create site from this defionition. How should I do this from code ? Use SharePoint Feature ? How should I activate it ?
3. Develop all the needed infrastructure for the site (master page, layouts, content types, ...) as SharePoint Features.
Is this correct and how should I develop all those parts so I can make a some kind install script so can client create get complete site with one click ?
Site definitions are complex no question about it, but they are very useful if you need to deploy to unrelated enviornments. If you are staying on the same server farm, maybe site definition is overkill. If you are going between domains (i.e. test & prod, then maybe they are worth looking into).
Another advantage to site definitions, esp. if delivering to a client is it feels more like a traditional deliverable. They will have a bunch of files (hopefully in source control) that are their custom site. I think that gives IT dept's a much warmer feeling than an XML file created from the SharePoint UI.
Another benefit of site definitions are you have a lot more control over the pages that make up the site. IMHO its easier to add master pages & custom CSS via site defintion that site template.
I am curious as to what are the 'moving parts' to the site you are trying to deliver? I think that answering that question will determine how to define the project's structure.
Generally, I think you are on the right track. Features and solutions are a must. I would stay away from VSeWSS, its buggy and clunky and generally terrible if you are trying to do anything complex. It tries to be so smart, that it leaves you no control.
That said, it really depends on what you are trying to do. If you are going to build a solution to deploy to the GAC with one assembly, and only building features supported by vsewss you may be fine.
If however, you want to develop, say a timer job wiring that into the VSeWSS feature framework gets tough. Also, if you need multiple assemblies in the solution. YMMV, but I had to junk it and find of a more flexible solution (hello NANT).
A lot of the work you will end up doing is building and checking, and re-checking XML configuration files. Bookmark the Feature Schema reference page on MSDN, you will be spending a lot of time going through it.
Finally, yes, if you have all of the parts packaged as features you should be able to develop a nice install script. Ultimately the script will need to call the STSADM (there are some really nice STSADM extensions here) commands necessary to create the site structure, add & deploy the solution & activate the features. You can start with a batch file, and get as complicated as you want.
Personally I don't find that creating a site definition is really that useful for the sites I have built. They can be very tricky to set up, because of their complex nature.
What I do is use the standard Publishing Site and then using features to add my additional componets (deployed via a SharePoint solution).
You can use Feature Stapling to connect up the feature to the Publishing Site creation.
I've also just done a blog post on how to programmatically modify the workflow which is created by default: http://www.aaron-powell.com/blog/february-2009/programmatically-modifying-sharepoint-workflows.aspx (that also has a link in the comments off to the Feature Stapling concept).
Then I use a combination of SharePoint Solution Installer (http://www.codeplex.com/sharepointinstaller) and batch files to install the components. SSI for all the SharePoint database level installs and batch files for the file system stuff.
Adding another answer, because I have more than 300 characters worth of stuff to say :(
RE: SharePoint solutions generator, again I would say your mileage may vary.
The biggest issue with SharePoint dev is managing all of the "magic strings" across the various configuration files. GUIDs and Fully Qualified Assembly names are the spit and glue that hold the whole thing together, and although it all makes sense its very difficult to manage.
The current crop of tool all try and alleviate the complexity of managing these things, but they require that you work in a certain way, so the tool knows how to inject the appropriate plumbing.
If you plan on doing a lot of work with SharePoint it really behooves you too learn to manage the plumbing yourself. Its painful up front, but really pays dividends.
Basically, I suggest you spend your time learning the platform and not the tools. Once you know the platform, using the tools will be much easier.
If you are doing this as a one-off engagement and just want to get it done, I'm sure you can get any of the tools you've mentioned to do the trick.
I would agree with the use of the out of the box publishing site definition, and then customizing it using Site Collection features (Master Page, Page Layouts, CSS) and site features (create lists, pages, sub sites, defining master pages of sites, etc...).
Feature stapling is great when you want to customize new sites (allow user to create new sites) of well known site templates, like customize the "My Site" look and feel. In this case I don’t think its very useful.
As a tool to help this task, I personally use STSDEV (http://www.codeplex.com/stsdev) to help in creating, programming, debugging and deploying my Sharepoint solutions.
First it creates a good project for Visual Studio (clean, or with some nice "starting point" definitions). Then it includes some “build configurations” that really helps with install, deploy and upgrade in the development machine.

Resources