0

I'm a Sharepoint beginner so my question could be naive but I wasn't able to find any answer.

Could someone give me a brief guide about developing a complete, enterprise class solutions in a shorat steps?

I feel a little bit astound when I read all those beginners guides for a Sharepoint developers where I see dozens of clicks. Every tutorial shows those abilities but I don't understand how could it work in a production environment. Is the real scenario of Sharepoint development really based on clicking or is the application structure usually created programmatically?

Let's say we want to create a simple web application with one visual web part (aspx user control). We obviously have to create a web application, site collection and (correct me if I'm wrong) deploy web part package. How it looks in real development? Is the Powershell used for the structure creation?

I'd be very thankful if someone could give me the answer in a form similar to below:

  1. Creating web application (Powershell)
  2. ...
  3. Developing web part (Visual Studio)
  4. ...
  5. Web application is done

One more question - how do we place the web parts on web pages programmatically? Because I can't imagine placing them manually, by clicking, on every deployment at every environment...

I'd be also very thankful about any links about the issue. My question refers to the Sharepoint 2010.

EDIT:

I thank all of you very much for help.

To cut a long story short, the scenario is:

1) Manual creation of the web application.
2) Manual creation of the site collection.
3) Manual creation of the web page.
4) Visual Studio development of the web part.
5) Manual deployment of the web part.
6) Manual placing web part amongst the web page.

Where all the manual steps can be scripted. Right?

Is there any possibility of transfer the particular solution (web app+site collection+web page) from one environment to another? Let's say we build an application from a scratch, from nothing on our development environment. Is there any way to create some kind of package which we can latter subsequently deploy on for example test environment? I know our Visual Studio solutions are packaged to WSPs, but what about things I mentioned?

1

1)

creating web application is full of clicking, being a sharepoint developer somtimes well for me most of the time incorporates sharepoint administration to it. You would use central admin to create web application and then site collection, or use powershell.

web application

central admin -> application managment -> click on manage web applications -> click on new (top left)

for site collection

central admin -> application managment -> click Create site collections and follow the instructions

once that is complete you would create your web part within visual studios and test within your dev enviroment by depoying directly, this will create a wsp file within the bin folder.

(your dev envirmoent should have everything in one place like visual studios, central admin, front end/backend and sharepoint designer)

once happy you just copy the wsp from the bin folder and move on to the test inviroment and deploy using powershell, same goes for pre-production and production server.

2)

placing a webpart within a web application can also be deployed using powershell, but in your case its easier to goto central admin and look at the deployed wsp's, you can see what web apps they are currently deployed to and select which ones you want to deploy them too.

central admin -> system settings -> manage farm solutions -> here is the list of wsp -> click on one wsp -> from this point you can see its deployed to what and you can deploy to others from here! to deploy to one or many web apps click on the deploy button above or retract to remove the wsp from one or more web apps!

0

In my environment the site collection/web application parts are created by clicking. This is because you need to do it very rarely. Maybe you do it by powershell, there's no difference.

Developing is done by visual studio. And yes there is a possibility to place a webpart on a page by code: http://www.stefangordon.com/add-web-part-to-page-programmatically/

You find many information about this. Deploying the webpart package is mostly done by powershell as well. Then maybe you need to make an event receiver for "feature activated" to let it be placed inside a page automatically.

Event Receiver (Feature Activated): http://msdn.microsoft.com/en-us/library/ee231604.aspx

If we need the webpart only on one place, we place it manually by clicking. Hope this helps :)

0

1) be carefull with using "web application" to name a custom (Visual Studio) solution. A web application in SharePoint had a different meaning. Very rough. you link a domain to a web application. A web application contains all your site collections for that domain.(very rough it does a bunch of other stuff as well). You can create a new web application in Central Administration (the default administration site that is installed together with SharePoint) Custom code created for SharePoint is generaly addressed as a "SharePoint Solution" or "custom feature".

2) You can create a web part with Visual Studio. A tip: use Visual Studio 2012 and all the updates! VS2012 contains a lot of new handy tools to develop for SharePoint 2010. You also might want to look at the free Visual Studio plugin CKS:DEV. http://visualstudiogallery.msdn.microsoft.com/cf1225b4-aa83-4282-b4c6-34feec8fc5ec

3) You can create a web application. Leave it empty. Create your SharePoint Solution and install it afterwards. You do not need to have the final version of your solution when creating a (sharepoint) web application.

Web part) You can programmatically add, remove, configure web parts on a SharePoint page by using the WebpartManager object. http://dubreville.wordpress.com/2011/04/15/programmatically-moving-adding-and-removing-web-parts-in-sharepoint-2010/

You can do this with a PowerShell script. Or you can put this code in a SharePoint solution. Add a feature (ex. 'Set Webpart') and run the code when activating the feature. http://msdn.microsoft.com/en-us/library/ee231604(v=vs.110).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.