Monday, December 7, 2009

Creating Custom theme in Share Point2007(MOSS 2007)

It is very easy to create custom theme for share point sites. A SharePoint site theme basically consists of three kinds of files:-

1. theme.inf

2. theme.css

3. image files.

Just follow the following steps and you will get your custom theme. Suppose your theme name is "myTheme".

1. Go to the folder "C:Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES" folder. Every Folder under this Folder defines a theme. Just make a copy of any of the the Folders and name it "myTheme". Suppose you copied BELLTOWN folder.

2. Rename BELLTOWN .INF to MYTHEME.INF. Keep in mind the uppercase thing.

3. Open MYTHEME.INF file with notepad and replace all BELLTOWN to myTheme.

4. Open "C:Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATELAYOUTS\1033\SPTHEMES.XML" file with notepad.

5. Add the following lines under tag:

< templates >
<>
myTheme< /templateid >
<>
myTheme< /displayname >
<>
myTheme< /description >
<>images/
myTheme.gif< /thumbnail >
<>images/
myTheme.gif< /preview >
< /templates >

Notice that preview and thumbnail paths are images/thghost.gif. By default, MOSS 2007 and WSS 3.0 will not have such image files.

6. Create a picture to describe your theme and store that in "C:Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES" folder with myTheme.gif name.

7. Restart IIS.

8. Now go to Site Settings, now choose myTheme theme.

9. Now to edit this theme open SharePoint Designer 2007. Go to "File" -> "Open Site…" and type the URL of your site.

10. In the Left menu you will find a lot of Folder,find a folder named myTheme which is your custom theme.

11. Find myTh-65001.css file in this folder. This is the CSS file for your theme. Edit this according to your need.

12. There is another css file named CORE.CSS in "C:Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUT\1033\STYLES" which contains styles for all sites. You may need to override some css attributes from this file.



Friday, December 4, 2009

Using Membership Provider with security controls in ASP.NET

Membership Provider is a great feature of ASP.NET which makes user authentication jobs dramatically easier for coders. There are two different membership providers: the ActiveDirectoryMembershipProvider and the SqlMembershipProvider.
The ActiveDirectoryMembership provider uses Microsoft® Active Directory® directory service to maintain user information, while the SqlMembershipProvider stores user details in a SQL Server database.
This article is aimed to provide the minimum required steps to use Membership Provider with security controls.

First create a database which will store your user credentials. Suppose the name of the database is Credentials.

First start Visual Studio 2008 Command Prompt,assuming you are using VS2008 you will find it in All Programs>Microsoft Visual Studio 2008>Visual Studio Tools>Visual Studio 2008 Command Prompt.

Now execute the command aspnet_regsql Now you will be given a ASP.NET SQL Server Setup Wizard. You can use this tool to create/configure databases which stores information of ASP.NET application services.

If you have successfully followed the steps then check the database you provided here and you will find some new tables created in your database. So your database is ready.

Now create a web site using VS2008. We have some editing to do in the web.config file. You have to provide connection sttring,changed authentication mode to "Form" from "Windows" and then in system.web section add membership provider info.

<>
< name="ConnectionString" connectionstring="server=BDDH01-W0065\SQL2K5;database=Library;integrated security=SSPI;Trusted_Connection=Yes;">
< /connectionStrings >

and ---

< mode="Form">

and finally in system.web section

< defaultprovider="CustomMembershipProvider">
<>
< add connectionStringName="ConnectionString" name="CustomMembershipProvider"
type="System.Web.Security.SqlMembershipProvider" />
< /providers>
< /membership >



That's all. Now to check if everything is working fine go to Website menu in Visual Studio and select ASP.NET Configuration . A webpage will appear and you can configure your system here Go to Security tab,there will be a option for creating new user. Create a new user.

Now add the Login control in your webpage from Tollbox.Run the website and try to log in using the user you already have created. You can use all the other controls like CreateUserWizard etc. in the same way. Easy, huh :) :) :)

So you have managed to create the whole authentication process without any coding. This is just the beginning,there are a lot of other features available. If possible I will come with some deeper facts.

Friday, November 13, 2009

Microsoft SharePoint : Creating Web Application

Here we shall create a Web Application in Microsoft SharePoint. I assume already IIS and SharePoint has been installed successfully.

First run IIS manager. To do this go to run and type inetmgr. There you will see Web Sites and Application Manager tabs. We shall use these two.

First create a site and publish it. Check if it works in your browser. Change the host file in C:\WINDOWS\system32\drivers\etc folder if needed.

Then create a new Application Pool. Change its' Application Pool Identity from Network Service to Configurable. Use a deticated account for this purpose.

Now Open your SharePoint Central Administration. Here you will find a tab named Application Management. Go to this and click Create new Web Application.

In the new page follow your instinct,I have full faith on your instinct. Change to NTLM from Negotiate in Authentication Provider. Use you already created Web Site and Application Pool to create this Web Application.

Now again go to Application Management and click Create Site Collection. Here create a site collection for the web application you have just created.
It will take smoetime to create the site collection. After it is created you can go to the site using the link provided. Nice site hah ;)

This is just the beginning and simple example. Next article will contain some more interesting things.

Thursday, November 12, 2009

Microsoft SharePoint : Introduction

Ok,first I confess that I am the least learned person about Microsoft SharePoint in the world and so this attempt might be a disastrous one.But I have to learn it anyway and here I will put all the stuffs I get day by day.

So,what is Microsoft SharePoint? This would be a very bad idea asking this question me rather googling it. Google wouldn't mind telling you about this though Microsoft is their biggest competitor. Anyway what idea I got is,this is a collection of tools and s/w. This is not a single s/w rather it's a platform. Now what they are aimed to do? This integrated system can provide content management, enterprise search, accelerate shared business processes blah blah blah...But to me, most importantly it provides developers a platform and tools they need for server administration, application extensibility, and interoperability. Being a Microsoft product it has a very good integration with .NET. So .Net developers might find it interesting to investigate.

Now there are few keywords one must know before going ahead. I will try to list some of them here(be sure that I have copied them all from internet,none of them is written by me :))

wss(windows sharepoint services) : this is a free product from microsoft (comes with windows server). it gives you all the basic functionality of sharepoint including document libraries, lists, even things like email integration.

moss(microsoft office sharepoint server) : this is an add-on to wss which gives some very cool additional features. some examples are excel services, infopath forms server, ecm (enterprise content management) and moss enterprise search. this is not free(Ooops :(:(:(...)

also you can't just install moss... moss is built on top of wss, so wss is a prerequisite.

web application / web app : also known as a virtual server (in sharepoint v2) and an web site / application pool (in iis), web apps allow for logical separation of sharepoint content. each web app runs under a different process on the iis web server.

two examples of different web apps are the central administrator site which runs on an arbitrary port number and then standard sharepoint sites which typically run on port 80. they both run under separate processes in iis.

site collection / top level site / parent site / spsite : a site collection is a web site that can contain sub-sites (aka webs), which all share the same owner and administrators of the top level site collection.

a site collection controls global settings that sub-sites underneath it inherit. settings can include permissions, storage quotas, and themes, etc...

webs / sub-sites / spweb : these are web sites that live underneath a site collection. these are almost the same thing as a site collection but the difference is the global settings that are applied from the site collection.

webs can have their own independent settings separate from its parent site collection, but it makes it a bit easier to manage for the owner of the site, that's the idea here.

lists : a list is a generic term used to define the different places to store content in a sharepoint site. some built in lists are document libraries (upload and share word docs), picture libraries (upload pics), and custom lists where you define what you want to store.

I think this writing has been big enough to be an introduction. This will surely be edited again after learning some more about SharePoint.

Thursday, October 8, 2009

What database does Google use?

I was wondering what database system does google use. Oracle or MySQL? These two are the names came into my mind then. But just after little googling I found something much more interesting.

Google actually does not use any of the database systems available at market. Sure they use Oracle and MySQl (modified versions) for some of their services but neither of those contributes to their Search Engine. They have developed a storage system for their search engine(really a google job!!!). This is called Big Table. Google has been using it since early 2005.

This is a distributed storage system for managing structured data that is designed to scale to a very large size: petabytes of data across thousands of commodity servers.

Bigtable is the basis of Google's search technology, as well as many other applications such Google Finance, Google Maps and Google Earth. These applications place very different demands on Bigtable, both in terms of data size (from URLs to web pages to satellite imagery) and latency requirements (from backend bulk processing to real-time data serving).

Bigtable was developed with very high speed, flexibility and extremely high scalability in mind. A Bigtable database can be petabytes in size and span thousands of distributed servers.

Google released it in May 2008 as part of Google App Engine. As is typical with Google offerings, Bigtable is free to use, and the service is described as "in beta," even though Google has been using Bigtable internally for more than three years.

So why not dig deeper to find more about this....let me know if any of you get lucky with something interesting.

Sunday, March 29, 2009

MySQL :: Compiling the skeleton engine

From MySQL-5.1 there is support for pluggable storage engine. Here we will learn how to compile and use a skeleton engine.
First you need to have MySQL installed in your system. For installing follow this link

Now get the latest version of the skeleton engine. You will get it here
http://hg.tangent.org/skeleton-mysql-engine?ca=tip;type=gz

Now Step 1 untar and uncompress the file.

Now cd to this directory. You will see there is no configure file. Step 2 to generate on do the following

[root@localhost skeleton-mysql-engine-0beed5ef2859]# sh config/bootstrap+ '[' -f /usr/bin/glibtoolize ']'
+ LIBTOOLIZE=libtoolize
+ aclocal
+ autoheader
+ libtoolize --automake --force
+ automake --add-missing --force
configure.in:5: installing `config/missing'
configure.in:5: installing `config/install-sh'
src/Makefile.am: installing `config/depcomp'
Makefile.am: installing `./INSTALL'
+ autoconf

Now Step 3 is to configure

[root@localhost skeleton-mysql-engine-0beed5ef2859]# ./configure --with-mysql=/root/Desktop/mysql-5.1.30/ --libdir=/usr/local/mysql-5.1.30/lib/mysql/

Here the --with-mysql should be pointed to a source tree for MySQL. The --libdir can be used to say which lib directory the plugin should be installed in once it is compiled.

Now Step 4 is to just make, make install.

[root@localhost skeleton-mysql-engine-0beed5ef2859]# make
[root@localhost skeleton-mysql-engine-0beed5ef2859]# make install

Now start mysql and connect to it. Then Step 5 is to load it.

mysql> INSTALL PLUGIN skeleton SONAME 'libskeleton_engine.so';
Query OK, 0 rows affected (0.01 sec)

You can see all the storage engines.

mysql> show plugins;
+------------+--------+----------------+-----------------------+---------+
| Name | Status | Type | Library | License |
+------------+--------+----------------+-----------------------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| SKELETON | ACTIVE | STORAGE ENGINE | libskeleton_engine.so | BSD |
+------------+--------+----------------+-----------------------+---------+
6 rows in set (0.00 sec)

See,you have loaded your first storage engine.

MySQL :: Uninstalling

Sometimes it becomes mor cumbersome to uninstall something rather installing. MySQL is no different.

If you install it from rpm then follow these commands to uninstall.

# rpm -qa | grep -i mysql
mysql-libs-5.0.45-4.fc8
php-mysql-5.2.4-3
# rpm -e php-mysql-5.2.4-3
# rpm -e mysql-libs-5.0.45-4.fc8

In case of an installation from source distrobution, you can unistall mysql by going to that extracted installion directory (the directory you used to build/install mysql) and type in the following.

shell> make -n uninstall
then type
shell> make distclean

Following this, go delete the directory that it was installed to (i.e. /usr/local/mysql )

Thats all to uninstall MySQL from your PC.

MySQL :: Installing in Linux from source

What should be the Step 1 for installing MySQL from source. Easy,download the source from MySQL site. Here is the link MySQL Source

Here is a point, If you are going to work with storage engine download at least mysql-5.1 because older versions don't have pluggable storage engine support. In this example I am using mysql-5.1.30 in Fedora 8.
It may take a few minutes to download the source. By the time you get the source downloaded you can read the rest of the article or take a cup of tea or just keep starring at the monitor(that's what I do actually).

Now make sure that you are logged in as superuser(root). Now create an account mysql. Step 2

# groupadd mysql
# useradd -g mysql mysql

This account(mysql) will have access to manage databases.

Now unpack the downloaded file and cd to it. Step 3

# tar -xzf mysql-5.1.30.tar.gz
# cd mysql-5.1.30

Now configure, make, make install. I usually use the /usr/local/ directory to install mysql.
Step 4

# ./configure --prefix=/usr/local/mysql-5.1.30
# make
# make install

Now we have to create a configuration file. It offers several security and control options (here you can limit system resources to be used by MySQL server, set the default collation and character set etc.). No need to make a new configuration file,there are 4 in support-files/ directory. Here we will use my-small.cnf. Step 5

# cp support-files/my-small.cnf /etc/my.cnf
# chown root /etc/my.cnf
# chgrp root /etc/my.cnf
# chmod 644 /etc/my.cnf

Now open the file and add user = mysql below [mysqld]

Now we have to install the grant tables. Installing the grant tables is accomplished by running the mysql_install_db script. This creates the mysql database which will hold all database privileges, the test database which you can use to test MySQL, and also privilege entries for the user that run mysql_install_db and a root user (without any passwords).Step 6

# /usr/local/mysql-5.1.30/bin/mysql_install_db --user=mysql

The script will create /usr/local/mysql/var/ directory containing the necessary databases. This directory serves as a default storage for all databases you will create. Make sure it is writable by "mysql" system user!

Now we shall start the server. Step 7

# /usr/local/mysql-5.1.30/bin/mysqld_safe --user=mysql &

This will start the server. To check if really server is running you can check the processes or try checking the mysql version.

# ps -all|grep mysql
# /usr/local/mysql-5.1.30/bin/mysqladmin version

Now connect to mysql server. Step 8

# /usr/local/mysql-5.1.30/bin/mysql -u root

Now you can see that you are connected to mysql. To check all Hosts and users do,

mysql> SELECT Host, User FROM mysql.user;

Right now there is no password for root user,you can put a password for the root user.

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');
Query OK, 0 rows affected (0.00 sec)

To exit mysql write

mysql> quit

Now to stop the server,

# /usr/local/mysql-5.1.30/bin/mysqladmin -u root -p shutdown

Now to start it again,

# /usr/local/mysql-5.1.30/bin/mysqld_safe --user=mysql &

Now connect again,

# /usr/local/mysql-5.1.30/bin/mysql -u root -p

You will be now prompted for password and giving the password you are connected to mysql.

If everything is done properly than Congratulations, mysql installation from source is done in your PC.

Appendix:
One more thing, If you don't want to start MySQL server manually after each system reboot set up an automatic startup. Go back to the directory where you extracted the downloaded mysql tarball file. Enter
# cp support-files/mysql.server /etc/init.d/mysql
# chmod 755 /etc/init.d/mysql
# chkconfig --add mysql
# chkconfig --level 35 mysql on

MySQL :: Step by step hacking into MySQL

First of all a quiz.Do you know which database has been used in Facebook?
Guess guess guess.......

its MySQL. This is one of the biggest MySQL implementation in the world. So I think you should have some more respect for MySQL now. If you want to learn more about MySQL than my blog might help you. Here I will discuss on how to make the best use of this open source software,specially on storage engine like how to make your own storage engine etc. Here are the links to my articles on MySQL.

1. MySQL :: Installing in Linux from source

2. MySQL :: Uninstalling


3. MySQL :: Compiling the skeleton engine