Do Webparts get added to the the automatically on deployment? - sharepoint

I created a webpart in a sharepoint, tried googiling how the webpart would need to be added to the webpart gallery but couldn't find a good answer or a "how to" how it is done programatically through the activateFeature?. is there an online source which I can follow?

I am not fully clear on your question. Going on an assumption you have developed a webpart using Visual Studio (say 2010 or 2012), then the addition of your webpart to the webpart gallery of your site collection will be taken care of when the solution (the compiled WSP) is deployed (whether you do it through Visual Studio deploy commands, PowerShell etc.) to your target SharePoint instance. If this is not your question, then let us know.

Related

TFS 2012 Document Hyper-Links

In TFS 2005, from Team Explorer in Visual Studio, we used to be able to very easily view a documents properties and view the hyper-link. We could then copy this and share it in an email, intranet etc. We have recently upgraded to TFS 2012 using Sharepoint 2010 and I cannot seem to locate document hyper-links.
Is there an easy way to obtain these (without knowing the hyperlinks) or is there another easy way to share content stored in the TFS SharePoint document store? I can do it from the SharePoint Portal easy enough, but I don't really use this, I use Team Explorer and the TFS Web Screens mostly
Many Thanks
this question is quite a bit older, but: maybe I've got an idea?
In each work Item, you have a register "All links"
There you can put the hyperlink to your sharepoint document in. (Button "Link to", Link Type "Hyperlink)
We used this since TFS 2010 and I sumbled over this thread, 'cause we are running into an issue, where these linked documents could not be checked out after opening.
Regards
Jimmy
P.S: maybe, I completely misunderstood?

SharePoint 2010 VS development: Intellisense for ASPX files

I'm using Visual Studio 2010 to develop a SharePoint Server 2010 solution. Part of this includes custom Page Layouts, but when editing them, intellisense is completely broken, since Visual Studio doesn't appear to know how to handle them. Here's what I've done:
Created a new blank solution
Right-clicked on the solution and created a new "Empty SharePoint Project"
Right-clicked on the project and created a new "Module"
Renamed sample.txt to MyPageLayout.aspx or created a new ASPX Web Form
At this point, intellisense for the new Page Layout is broken. It gets even worse with tools like ReSharper installed. Also, things like "Format Document" will break the Page Layout (by for example changing asp:Content to asp:content)
What I've tried to get intellisense working:
Added a Web.config from a standard Web Application Project to the root of the SharePoint Project - made no difference.
Added the ProjectGuid for a Web Application Project to the SharePoint project file - broke the project.
Is there any way to get intellisense, and the rest of the support Visual Studio can offer for Web Forms, available when developing SharePoint 2010 Page Layouts?
I have followed your post to some extent.
Using VS2010 (On an x64 machine)
Create a blank SharePoint solution. (this properly combines your #1 & #2)
Add a module (in SharePoint a module is like a folder or resource container)
added a new class to the module (intellisense present)
Added a new webpart to the module (intellisense present)
added a user control to the project designer works and (intellisense present)
I believe that you should consider creating true server or visual web parts. This will have a harder learning curve but will pay with dividends in the future. You will be able to package and deploy your solution again or to another server/farm. Aspx pages can be added and manipulated by the dreaded SharePoint designer. In 2010 the theory is that those designer mods can be packaged and deployed.
I work in this environment every day and the best advice I can give is to embrace the SP object model and do 'it' the sharepoint way. Don't try to force SP to be something its not. :)
This is probably not the solution you are looking for but it's the best thing I found for SharePoint development.
In your solution, create 2 projects :
1 SharePoint Project (empty or not)
1 ASP.NET web application project
Develop all your UI (aspx pages, ascx controls, etc.) in your ASP.NET project and create post-build steps that will copy the pages and controls to the appropriate folders in your SharePoint solution.
That way, you will benefit from all the features of web development in visual studio and it will be very easy to deploy as well. It is a bit of a time investment at first, but it is well worth it if you have any considerable amount of logic to implement in your aspx pages.
This blog post documents what you need to do.
you can add an intellsense to pagelayouts by closing the page and simply reopen it from
file->openfile->your file page layout path
Or you can directly "Right Click" on the file you want to open from the Solution explorer and then select "Open" : you'll get the Intellisense !

SharePoint 2010 - Creating a custom document library template

I'm trying to figure out if it is possible to create a custom document library template for SharePoint 2010. When a user clicks on the Libraries link on the quick launch menu of a new SharePoint site, and then clicks the Create button, the Create dialog is launched.
I know this dialog window hosts a Silverlight control, but obviously there is a way to create custom template types in this window. There is even a category that is called Blank & Custom. I've tried copying and modifying the DocumentLibrary feature located in the following location - C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES, but that didn't seem to work.
Thanks for reading, I'm sure the answer is obvious but I've been stumbling over Google and MSDN all morning trying to figure this out but I haven't had any luck.
Well, unfortunately the answer is not that obvious. You'll have to create a new List Definition (a document library is actually a list). For that there are several ways, but as a developer, I guess the most common way is to do that through Visual Studio.
A basic tutorial that will guide you through the steps can be found here:
http://msdn.microsoft.com/en-us/library/ms466023.aspx
After you deploy your solution, a new list template (or document library, depending what you created) will show up in the dialog.
Yes, it is not that obvious at all.
Most of the Microsoft documentation is now based on using Visual Studio 2010 and are more focused on the lists than on the document libraries.
By the way, as told by Erwin, document libraries in SharePoint 2010 seems to have become lists, but the lack of documentation regarding the creation of custom lists remains anyway, so after having perform some successful trials I have decided to publish a step by step guide.
Sharepoint 2010 custom ducoment library

How can i access my custom webpart in sharepoint foundation 2010?

So i just started trying to develop a simple webpart today for a sharepoint foundation i put on a virtual machine. I have no previous experience with sharepoint whatsoever.
As i cant run a sharepoint 2010 on my local machine for dev purposes i followed advices in this thread http://social.technet.microsoft.com/Forums/en/sharepoint2010programming/thread/cda807f6-4edf-4efc-8e9b-4d446356c8ae to able to actually develop something (just the registry bit).
I created the simple test web part (writes out "hi"), uploaded it to virtual machine, added it with add-spsolution and install-spsolution in powershell with success. When i do get-solution through powershell on my webpart it says deployed = true.
What am i missing from here to get it to actually show up somewhere in the web interface so i can add it to a page?
Cheers
You need to go into site settings and activate the feature. If its already activated edit the page > Insert WebPart > Look under Custom to find your webpart.
HTH

Sharepoint 2007 template to site definition conversion

Is there a way to (semi) automatically convert a sharepoint 2007 site template to a site definition? This seems like it could be quicker than building a site definition from scratch, yet provide the benefits of the site definition.
I think with VSeWSS 1.2 you can convert a site to an site definition.
Extract from the VSeWSS 1.2 announcement on the SharePoint Team blog:
SharePoint Solution Generator
This
stand-alone program generates a Site
Definition project from an existing
SharePoint site. The program enables
developers to use the browser and
Microsoft Office SharePoint Designer
to customize the content of their
sites before creating code by using
Visual Studio.
So crating a site from a site template an then running VSeWSS 1.2 should do the trick.
One way you can do it to rename the Site Template (.stp) file to .cab and extract the content and get the onet.xml schema and customize it as you wanted it.
Which defintion was used for the site template do you want to convert? I've found the SharePoint Solution Generator to be hit and miss. For example I can't get it to process blog sites. Worth a shot though.

Resources