About Me

My photo
Currently working as a Pen Tester, I'm interested in Android and web apps.
Showing posts with label Sharepoint 2007. Show all posts
Showing posts with label Sharepoint 2007. Show all posts

Friday, 17 September 2010

Developing for SharePoint Online (Cloud Based SharePoint Site)

In the previous post I spoke about a point in the project where I wanted to do some specific things with the site. I also spoke about some difficulties I encountered. In this post I'll clarify the issues I'm facing. To begin with I'll describe the setup I am working with. It is a Microsoft BPOS (Business Productivity Online Services) SharePoint site. This is a cloud based SharePoint site based on SharePoint Server 2007. I access the site in an internet browser through a URL like this one https://exampleemeamicrosoftonlinecom-1.sharepoint.emea.microsoftonline.com/. Any changes I've made to the SharePoint site have been done in an internet browser or through SharePoint Designer. To edit a cloud based SharePoint site in SharePoint Designer simply click on the "open site" button and enter the URL used to access the site in the browser and then enter a username and password associated with the site.

Up until this point in the project  it has been sufficient to develop in an internet browser and through SharePoint Designer. However, now the site needs to function in very specific ways. These include;
  • Dynamically calculating (calculating in real time) a result from three SharePoint drop down menus and presenting the result to the user before they commit the value to a SharePoint List.
  • Populating the left hand side of a paired list box from a SharePoint List
  • Each value in the left hand side must be associated to a control number when they are added to the right hand side of the paired list box. When the user commits the values to a SharePoint List both the value and the control number must be together.
  • When the user adds a value to the right hand side of a second paired list box then a completion date must be appended to each value on the right hand side of that paired list box.

Initially I was going to use JavaScript for the first problem but I was unsure of using it with SharePoint drop down menus. A friend suggested that it would be messy to use JavaScript and to simply use the SharePoint APIs. This lead to the problem of setting up Visual Studio with a SharePoint BPOS site. I posted my problem on a couple of forums, the best answer coming from the TechNet forum. Basically Visual Studio is not built to develop for remote SharePoint sites and using a shared SharePoint environment means that it is not possible to deploy solutions built with compiled code.

Now I'm in the position where I have to use client-side code such as JavaScript for the functionality I need and also look at different ways around my other problems. So far I've got the problem of dynamically calculating the values just about done. There is still an issue of using the drop down menus with a List. I will continue to find work arounds for the problems as this prototype has to be developed on the setup I was given. If this was not just a prototype I would not recommend developing on a cloud based SharePoint site.

Wednesday, 18 August 2010

Removing 'Title' from a SharePoint List

Every time you create a List that pesky 'Title' field is automatically created. This post will explain how to get rid of it.

EDIT -> Have a look at This Post before proceeding

A new List;


Step 1
To start click Settings > List Settings


The Settings Page;



Go to Advance Settings under General Settings and check the radio button to 'Yes' where it says 'Allow Management of Content Types?'.


Once you click okay your back in the Settings Screen. Scroll down to Item under Content Types and then click on Title.


Once Title is clicked select the radio button 'Hidden (Will not appear in forms)' and press OK.

That gets rid of the 'Title' field.


Optional
Change the Views
On the Settings page scroll down to 'Views' and click on 'All Items'


Now here you can select what Items will be in all the Views presented to the user. Select which ones you want and what positions you want them at.


Once you press OK and then go to create a new Item you should only have the Items you have selected here within the new Item form. I'll post up any other solutions as I discover them.

Tuesday, 17 August 2010

Populating a 'Drop Down List' from a SharePoint List

I've been playing around with SharePoint Lists and I've found a handy way of populating a drop down list in SharePoint with another SharePoint List. Here is a quick guide;

In this example I'm creating a place where a user enters their name and then selects what country they are from. So I create two Lists
  • User Details
  • Countries
User Details will have two columns; 'Name' and 'Country'.

Step 1
Create the Custom Lists
Site Actions > Create > Custom List
Add columns;

Settings > Create Column
or Settings > List Settings > Create Column


The above screen shot is of the Country column being created within the User Details List. Notice that instead of filling in a list of countries in this column I simply put 'none' in the "Type each choice on a separate line" box. I'm not listing countries here because I want to populate this from a SharePoint List that I've made called Countries.


Step 2
Now create a Document Library
Site Actions > Create > Document Library

Then create a Web Part page. Choose the layout as a full page and add it to the document library just created.

Step 3
Launch SharePoint Designer and open up the Web Part page just created.


Delete the 'click to insert Web Part' from the page and add a Custom List form to the page.
Insert > SharePoint Controls > Custom List Form...


Then select the List you want to populate, in this case it's the User Details List.

Now right click where the Country drop down is and select the following;
Format Item as > Drop Down List


Make sure the drop down list, which will now have unbound, is not selected (click beside it). Go over to the right of SharePoint Designer 2007 to the window with the tabs Toolbox, Data Source Library... etc. and click the 'Data Source Library' tab.
*If it is not there go to the top toolbar (File, Edit, View...) and click on Task Panes -> Data Source Library.

Find the List that you want to populate the drop down with, in this case the Countries list will populate the drop down. Click the list and click inset data source control.

Now go back to the drop down and click the little arrow and then click Data Fields.

A window will pop up, the first option is the data field just leave it as this is the one selected (although you can change it if you want). In this case the data field selected is Country in the User Details List.

There is also an option here to present the user with data from one column in the List and once selected by the user a value is entered from a different column in the List from a corresponding row. This is handy if you want a description for the data presented to the user but want a number value to be entered into the List.

Step 4
All that needs to be done now is to change the view the user gets when they are creating a new Item from the default view to your new Web Part page with the custom form.

Go to the Lists on the left hand side of SharePoint, expand Lists and then right click the User Details List and click Properties.



Then in list properties click the 'Supporting Files' tab and do two things

  • *Very important that under 'Content type specific forms:' you change it from 'Folder' to 'Item'.
  • Then change the 'New item form' to the Web Part page with the custom form (Pages/userdetails.aspx) by pressing browse and locating you new page.



All done. Now when a user clicks 'New Item' in SharePoint they will be brought to the Web Part page and the drop down list will be populated from another SharePoint List.

Friday, 30 July 2010

The Wrong Platform

So I've made my decision, I think it's the wrong platform. Developing on SharePoint seems like a nightmare and for this project I would have to bend the platform to suit the needs of the system. There's plenty of resources out there where people talk about joining SharePoint Lists and manipulating Lists using Views and Web Parts but it's all unnecessary coding to get something simple to work! I can't guarantee the performance of the application or if it could be further developed due to the restrictions with storing data in SharePoint. Storing unrelated data with a 2000 item cap is bad. The project could not go from prototype to commercial release using SharePoint. To me SharePoint is aimed at people who can't code and just want a simple team website.

Sure it'll save me time as I don't have to code a user database or any lower level code but at the price I can't develop what I want, I'm restricted. It'll save time with testing too but I can see it getting messy.

I'm left scratching my head why SharePoint clumps information into a List and you can't use SQL. It's pointless having a system like that because there is so much power with SQL, I just don't know? I've read so many blogs and articles about developers constantly coming up with workaround for their SharePoint site and I don't want to be one of them. Also so many people frustrated trying to import a database into SharePoint.

I've come to dislike SharePoint without even getting stuck into it. Why use SharePoint when I can use PHP and MySQL. There are probably situations where SharePoint is a great idea but for this project it's not.

Wednesday, 28 July 2010

First Impressions

I'm just finished college and I got a research position with a company called BH Consulting. I'm so happy because it is difficult to get a job in this climate, especially one that you want. Anyway I've been asked by the company to build a web application but to develop it on the Microsoft SharePoint platform. My background in college was developing in Java with some C but I've never developed on a Microsoft platform. So I'm looking at ASP and C# and thinking it's not that dissimilar to what I was doing with Java and the syntax is not too bad, this is going to be okay (famous last words!).



At first glance SharePoint looked like a great idea and a powerful platform to develop on. But I did have some concerns, one of which was the fact that lower level coding has been taken away from developers. The idea being products and solutions can be developed quickly and easily. You don't build a website from scratch using ASP on SharePoint; instead you use ASP to extend SharePoint sites. This is fine using templates and extending them for a company that wants to create a space where people can work on a document or a task list or a wiki or something, but can the SharePoint platform be used to develop a really powerful web application? This is what I have to figure out; this is why I've been hired into a research position. Can it be done and if not what would I recommend.



With this project, and I suppose with any project, the developer needs to know what the client/boss requires from an application, what is their vision essentially. So I gathered information and I've been building upon a document while I'm waiting on the software I need on my machine here in the office. One of the conclusions I've come to is the database is the driving force behind this application and it needs to be designed and implemented to a high standard. My opinion is the application needs to use the concept of a relational database. After all, relational databases have been tried and tested and they work for powerful and demanding web applications.

So, logically I thought I might as well jump in and start designing a relational database. But... there's a bit of a problem. SharePoint does not support relational databases. What I mean by this is you cannot write SQL when developing for SharePoint and you cannot implement any relational database using the SharePoint platform.

There are options though, I could design and implement a relational database on an SQL server and import it into SharePoint. This does mean I need an SQL server on top of the other software for SharePoint and anywhere this application rolls out needs an SQL server. This may or may not be a problem, but there can't be any uncertainties in this solution. Another concern is I don't really know how well SharePoint interacts with an external database?

Ideally I'd just like to use the SharePoint platform and nothing else, so I was looking at SharePoint 'Lists'. Lists resemble tables in a database with columns and rows and you can add different data types, but, and this is a big one, -Lists don't relate to one another like tables in a relational database do. To get lists to relate to one another you have to write things called 'Web Parts'. At this stage I really don't know how good a solution this mixture of Lists and Web Parts will be? Also Lists only support up to 2000 items, not good when the database grows.

I'm starting to think SharePoint is fine for simple, unimaginative team sites using templates and clumping data here and there. Fine if all you want to do is something simple but for something that is specific and requires the power of a relational database back end, then SharePoint can't replace the power of current web technologies.

Bottom line is;

  • Will an external relational database work well with SharePoint and if it does will the use of an SQL Server cause problems when the product rolls out?

  • Will Lists and Web Parts be powerful and dynamic enough to get this job done?

  • Will it be the case where ultimately SharePoint is simply the wrong platform?