Thursday, December 27, 2007

Deploying WebParts in SharePoint 2007

Hi Folks,
Any SharePoint Development requires you to develop your Web Part and deploy it to sharePoint,in this post i will describe the steps required to deploy your web part to sharepoint 2007 site:

1) after creating your web part,you have to sign it with strong name.
To Do that : simply open the project properties and on the signing tab select new and then save the properties ad build your web Library.

2) add to the GAC on your sharePoint Server.
you can do that by using VS.Net Command tools or use .Net 2.0 configuration Tool from the control panel.

NOTE: after you add your DLL to GAC you can find it on C:\Windows\Assembly Folder.

Take Note : you have to store the Publick Key token of the signed DLL by right click on your DLL -> Properties and save the public key token on a notepafe file because it will be used later.

























3) To add this webpart to a sharepoint site,you have to make it "Safe Control " to be loaded and configured on your site.


To Do that : open the web.config file of your site,it resides on C:\IntePub\WWroot\WSS\Virtual Directories


then open the folder of your site,it takes by default the port number of your site.

Paste this code on the web.config : (i removed <> letters of the key)

SafeControl Assembly=”ArafaWebPart,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=2e128026f9c7d6df”
Namespace=”ArafaWebPart” TypeName=”*”

Safe and close your web.config.

4) open your sharepoint site->site settings->web parts->click on new and select your webpart and then click on Populate Gallery.














5) then click on any page and add your web part.













Hope this helps.




Regards,
Moustafa arafa

Monday, December 24, 2007

How to pass DateTime Timestamp to Sharepoint 2007

Hi Folks,

if you developing sharepoint application,you will face that the DateTime timestamp parameter on sharepoint is different than what you are used to pass in your .Net Application.

In SharePoint 2007,the TimeStamp has to passed as a string and this is the format of the string:

"YYYYMMDDTHHMMDDZ"

Take these Notes:

1) Date Part is followed by T Symbol.
2) Time Part is followed by Z Symbol.

and the the rest of the string is easy to get it in your application by using:

C#:
DateTime.Now.Date.ToShortDateString()
DateTime.Now.Date.ToShortTimeString()

By using any string concatenation "+" or use String Builder Class to give better performance.


Hope this helps................


Regards,
Moustafa arafa

Sunday, December 23, 2007

Deploying Features without using stsadmin command line tool

Hi Folks,

i'm using a visual tool which build our command you want to write in the stsadmin command line tool without.

Tool Name : Feature Manager

Download Link :
http://www.sharepointblogs.com/files/folders/tbaginski/entry2449.aspx

One Tip : After install and activate the feature dont forget to reset your IIS.

Don't forget to configure the tool before start by clicking on configuration menu item and put the paths of your installation because its by default its on C:\ Drive.

Hope this helps........

Regards,
Moustafa arafa

0x0020 in MOSS object Model

Hi Folks,

This post to inform that when you develop on sharepoint 2007 object model,and if you are manipulating with lists in sharepoint you might face in the item names or field names you will find that the spaces in sharepoint is converted to this hexidecimal code "0x0020".

Example:
if you have a column name in a list with name "Customer Name",when reading this column in your code you will find the column name is : "Customer_0x0020_Name".

Happy .netting with sharepoint...........

Regards,
Moustafa arafa

Sunday, December 16, 2007

How to enable Search on your MOSS 2007 Site

Hi Folks,

If you want to Enable Search facility on your sharepoint 2007 site,follow these steps:

Go to the Site Settings and under Site Administration Click on Seach Visibility Link.













Update the seetings as shown on the attached image.

even after you enable the search visibility on your site and if you start search for a keyword on your site pages it will not work until the Crawling process will be run.

What's the story of Search Crawling in MOSS 2007 ?

There is a Crawling Service running on all Sharepoint conent pages to index all content,if you start your search for a new added content before the crawling process start by including the new content on its schedule,you will not get your search results.

The Question is : How can i Configure My Crawling process on MOSS 2007 ?

Open your central administration site: click on Share Services link under Share Services Administration.

Click on Search Settings -> Content Sources and Crawl Schedules -> Edit the Content Source which is exist.















Update your crawling services as you want and as per your organization needs.

Hope this helps....


Regards,
Moustafa arafa

Wednesday, December 12, 2007

Variations Tip in MOSS 07

Hi All,

Locatiozation on MOSS 2007 is a piece of cake to start creating your site multi-lingual site.

to start creating multi-language site on sharepoint 2007,you have to use one of the new features on MOSS 2007 called Variations.

when you create variations on your site you might face this problem which mentioned below.

if you got this error message when you try to create heirarchies on your site in sharepoint 2007 :

"No Variation Root Web has been set - hierarchies cannot be created until a Variation Root is set."

simply this because you didn't specify the variation root of your site.

click on variations link and set / on the location to create the variation on your root or base on your select.

hope this helps.

Regards,
Moustafa arafa

Thursday, December 06, 2007

Which Master Page Shall I Use in Built-In Master Pages in MOSS 07 ?

Hi All,

In MOSS 2007,there's 9 Master Pages built-In on any create site in Sharepoint 2007.

The Question is : Which Master Pages shall I use for my Site ?

Case #1: Blue Vertical / Black Vertical
This is the best choice in case you are building an internet sites with good representations of the WCM related columns,No Top Navugation only Left Navigation which is most required on internet sites.

Case #2: Blue Tabs
Is the best alternative for default master page .The difference is the tabbed representations of the top navigation.


Case #3: Blue Band / balck Band / Blue Glass Band
Same as Default master page with both Top and Left navigation,the best selection for starting to customize the default master page.

Orange Sigle Level & Black Single Level : same as blue band master pages with different on Color Combinations.

Or you can still use the default master page with full control on the top and left navigation and customize it but it will take much work on your customizations.

The Good starter from my point for your customization is Blue Band Master page coz it contains the minimal that u want to put on your master page with site actions and navigation.


Hope this Tip help.


Regards,
Moustafa arafa

Wednesday, December 05, 2007

Create your first Content Page in MOSS 2007

Hi Folks,

MOSS 2007 is amazing product from MS,it contains Sharepoint as well as CMS features on one product,Sharepoint 2007 built on top of WSS 3.0 which has alot of features to built collaboration solution with great integraion with asp.net applications.

one of important features on MOSS 2007,the Content management which was separate product before the release MOSS 2007 and had name (CMS 2002 with SP2 latest release).

Now,CMS 2002 is incorporated on MOSS 2007,and the product team for content management on MOSS 2007 has name "ECM" Team : Enterprise Content management which is different than the sharepoint product team.

To start use and implement your first CMS Site on MOSS 2007,its different than CMS 2002,alot of terminologies and key features have been changed.

one of the most required question,HOW TO ? create my CMS or built my Content Site on MOSS with little bit customization.

The Guide URL below,is oyur start,believe me....start forward and showing you step by step how to create your first content page for editors in MOSS 2007.

http://msdn2.microsoft.com/en-us/library/aa830818.aspx

Part 1 is enough for this topic,and to dig more on ECM on MOSS 07,MUST READ 3 PARTS of this Article.

Life is easier with WCM in MOSS 2007.....Thanks Microsoft.

Hope this helps.



Regards,
Moustafa arafa

Tuesday, December 04, 2007

Forms Authentication on MOSS 07 Sites

Great Article shows with screen shots How To ? implement Forms authentication on your MOSS Site.

Excellent Article:

http://weblog.vb-tech.com/nick/archive/2006/06/14/1617.aspx


Another useful one :

http://www.developer.com/net/asp/article.php/10917_3622481_2


Hope this helps.

Regards,
Moustafa arafa

Monday, December 03, 2007

MOSS 2007 Problem : Cannot connect to the configuration database.

Hi Folks,

During my work with MOSS 2007,i had some performance issues regarding the SQL Server instance services which is running the configuration and Data for MOSS sites.

I had closed this service bymistake and when i'm trying to open the central administration site or any site i got this message in the IR:

"Cannot connect to the configuration database."

To resolve this : go to your services and start this service:
"SQL Server (OFFICESERVERS)"

This Tip is enough to continue your work with your MOSS sites.

Hope this helps.

Regards,
Moustafa arafa

Thursday, November 29, 2007

Recover your DB from Log Files in MS SQL DBMS

Hi Folks:

I got a call from one of my friends "Fady" regarding one of the guys dropped his tables without taking a backup of his DB.

This is my Support and answer to him.

"
Dear My Firend Fady,

Regarding your question yesterday, for that person who Dropped his tables, anyways this email has good news for him, as I told you he can recover the DB from its log file, simply pass these Urls to him, to recover your DB from Log File.

Urls:

http://sqlserver2000.databases.aspfaq.com/how-do-i-recover-data-from-sql-server-s-log-files.html

http://www.apexsql.com/sql_tools_log.asp

"

Hope this help you guys.......


Regards,
Moustafa arafa

November Rosario CTP now available

7 days after Visual Studio 2008 RTM’d, we have a preview of the next version of VSTS available. Get it while it’s hot.


http://blogs.msdn.com/jeffbe/archive/2007/11/28/november-rosario-ctp-now-available.aspx

I'm happy to announce that the next Community Technology Preview of Rosario (officially known as Microsoft® Visual Studio® Team System code name “Rosario” November 2007 CTP) is now available. Customers can immediately begin downloading the VPC images from our download page.

For this release we worked on a number of key scenarios that we'd like you to try out. To help facilitate your evaluation, we've included samples and walkthroughs within the VPC to demonstrate these new features. Here's a list of walkthroughs broken out by product:

Architecture Edition
• Visualizing Interaction Sequences between Service-Oriented applications
• Using the Distributed System Designers and the Web Service Software Factory to build WCF applications
• Designing and Visualizing Interactions between classes
Development Edition
• Simplify Code Analysis rule selection with Rule Sets
• Find and fix a bug using the historical debugger
• Identify the test impact of code changes
• Find a bug on a separate machine using the standalone debugger
Test Edition
• Planning a testing effort
• Executing manual test cases
Team Foundation Server
• Managing user stories with the Agile Process
• Managing features with the CMMI Process


Read more on Jeff Blog :

http://blogs.msdn.com/jeffbe/archive/2007/11/28/november-rosario-ctp-now-available.aspx


Regards,
Moustafa arafa

Monday, November 26, 2007

Part 2 : when ? where ? i have to use NotBot Ajax control

Hi Folks,

I got some questions regarding the using the NotBot Ajax control : Where we can use it ? when ? and some visitors requires the code to use this control.

The answer of when ? You have to plug NotBot Control on your business applications,if it uses Forms authentication then you can put it on Login Page,OW you can put it on your master page incase your site for anonymous users.

The answer of where ? You can drop it on your login page or your master page instead of putting it on each page of your applications or websites.

The code you have to put : (in C#)

protected void Page_Load(object sender, System.EventArgs e)
{
if (!NoBot1.IsValid())
{//trying to automate requests to the page....
// to do..............

}

Hope this helps.....

Regards,
Moustafa arafa

Part 2 : when ? where ? i have to use NotBot Ajax control

Hi Folks,

I got some questions regarding the using the NotBot Ajax control : Where we can use it ? when ? and some visitors requires the code to use this control.

The answer of when ? You have to plug NotBot Control on your business applications,if it uses Forms authentication then you can put it on Login Page,OW you can put it on your master page incase your site for anonymous users.

The answer of where ? You can drop it on your login page or your master page instead of putting it on each page of your applications or websites.

The code you have to put : (in C#)

protected void Page_Load(object sender, System.EventArgs e)
{
if (!NoBot1.IsValid())
{//trying to automate requests to the page....
// to do..............

}

Hope this helps.....

Regards,
Moustafa arafa

Wednesday, November 21, 2007

Secure your Website by using NoBot Control on asp.Net Ajax

Hi All,

Today i have used one of the important controls on ajax framework which secure my website/Application from automated attacks on your websites in away to hack your application without any human interaction.

NoBot is a control that attempts to provide CAPTCHA-like bot/spam prevention without requiring any user interaction. This approach is easier to bypass than an implementation that requires actual human intervention, but NoBot has the benefit of being completely invisible. NoBot is probably most relevant for low-traffic sites where blog/comment spam is a problem and 100% effectiveness is not required.


NoBot employs a few different anti-bot techniques:

1)Forcing the client's browser to perform a configurable JavaScript calculation and verifying the result as part of the postback.
2)Enforcing a configurable delay between when a form is requested and when it can be posted back.

NoBot can be tested by violating any of the above techniques: posting back quickly, posting back many times, or disabling JavaScript in the browser.


add it on your application and secure it by checking on NotBot status and add your custom behavior for catching website spams.

Read More :

http://en.wikipedia.org/wiki/Captcha

http://asp.net/learn/ajax-videos/video-141.aspx



Regards,
Moustafa arafa

Tuesday, November 20, 2007

CDO Error when creating Person Object

Dear All,

If you are using CDO DLL for Integration with Exchange server in your application,you might face problems when you are trying to initiate an object from CDO.dll Class Library.

i used to create contacts in exchange server,and my application was working fine with cdo.dll after migrating to vs 2005,the cdo stop working,after alot of investigation,i found that the dll wasn't registered on .net framework 2.0 and register on .net framework 1.1,this is one of my bad luck...and to see the related posts,kindly visit below links :

http://forums.asp.net/p/1002362/1996021.aspx#1996021

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=310987



ex.Message "Retrieving the COM class factory for component with CLSID {CD000107-8B95-11D1-82DB-00C04FB1625D} failed due to the following error: 80040154." String

to fix it,register the cdoex.dll on .net framework 2.0 :

regsvr32 cdoex.dll

This will fix the problem..........


Happy .Netting.



Regards,
Moustafa arafa

Wednesday, November 07, 2007

ASP.Net 2.0 Tip : CSS is not applied on my aspx page

Hi Folks,

You might face this problem on asp.net 2.0,if you create an aspx page and you reference the css file on the header of this page,you will face that the css classess are not applied on that page even if the css reference is right.

And css link is working on other pages but is not working on the new created page.

The workaround of this issues is to remove the below line of the html code :



!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"


this will instantly apply the css classes on your page.

Happy .Netting..... :)


Regards,
Moustafa arafa

Tuesday, November 06, 2007

Release of VS 2008 & .Net 3.5 by the end of november

Hi All,

For those who didn't go to TechEd 07 this year which is running nowadays,MS Announced the release date for VS 2008 and .Net 3.5 by the end of november this year.

It is amazing specially the release of .Net 3.5 which has alot of enhancement and new features which doesn't exist on .Net 3.0.

Read more on MS Press :

http://www.microsoft.com/presspass/press/2007/nov07/11-05TechEdDevelopersPR.mspx


Regards,
Moustafa arafa

Sunday, November 04, 2007

Next Event : TechNet & MSDN Road Show @ Gulf

Hi Folks,

Execlusive to my blog readers,the agenda of Gulf TechNet & MSDN Roadshow.

Next Event will be held on Gulf during november-Dec based on your location.

Register now :

https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=e1dcb941-a365-4d4b-8e0f-1c3a8946ecb1&lcid=1033

For Kuwait : its on 14th of November 07 - Movenpick
Read more on the event site .


Dates

City Venue Date
Kuwait Movenpick Hotel Wednesday Nov 14th
Oman Shangri la Hotel Saturday Nov 17th
Bahrain Sheraton Hotel Monday Nov 19th
Dubai Habtoor Grand Hotel Tue/Wed Dec 4 & 5
Qatar Intercon Hotel Sunday Dec 9th

Agenda


TechNet Track Speakers MSDN Track Speakers
Session 1 - UC
Session 2 - WS08 First Look at Visual Studio 2008 - Part I

First Look at Visual Studio 2008 - Part II


Lunch
Session 3 - System Center Configuration Manager
Exploring the Building of Software + Services Applications
Session 4 - Data Protection Manager Best Practices for Team-Based Software Development
Break
Session 5 - Virtual Machine Manager IIS7, Orcas & Team System
Session 6 - SQL Server Building Silverlight Applications Using .NET
Closing and Raffle Closing & Raffle




Regards,
Moustafa arafa

Sunday, September 30, 2007

Astoria

Hi Folks,

New tool has been shipped to expose your data on your applicaitons as Data Services,These data services can be used by Ajax web enabled applications.
This tool provdes the facility to expose your data over HTTP which is an added value for your application to easily consume the edata exposed by Astoria SDK.



Download Sept CTP :
http://www.microsoft.com/downloads/details.aspx?FamilyID=0FA1413C-CB55-4577-960E-0F3491847F58&displaylang=en

Regards,
Moustafa arafa