Saturday, September 22, 2012

Use VS 2010 User Controls with VS 2008 and SharePoint

The Microsoft Visual Studio .NET logo.
The Microsoft Visual Studio .NET logo.
(Photo credit: Wikipedia)

How to register an assembly of newer VS 2010 into older VS 2008 Code

I use a project template that allows creation of Web Forms and Controls with the visual designer, is configured for WSPBuilder and code signing, and has some standard assembly references. If you aren't interested in the details of how to make your own, you can just download mine from here (http://www.elumenotion.com/Downloads/WSPTemplate.zip) and place it into yourDocuments\Visual Studio 2008\Templates\ProjectTemplates folder or you can keep reading!   A Visual Studio project template defines the base configuration of a new project. If you've ever used VS, you have used a project template. When I am starting from scratch, I usually use the C# Class Library project template because it makes the fewest assumptions about what I am doing and therefore imposes the fewest restrictions. One problem with this approach is that the Class Library template lacks the item templates for ASP.NET. Among these are the templates for Web Forms and User Controls. I like the productivity tools provided by these item templates, especially the visual designers. Fortunately, it is easy to add the Web Form and User Control item templates to a Class Library!   In Solution Explorer, right-click the project node and choose Unload Project to expose the project file for editing and then edit the file.  
The file opens in the editor. Insert the <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> element beneath <ProjectGuids> element and save the file.
    Right-click the project in Solution Explorer and select Reload Project. Now when you add a new item to the project you have the option to include any of the standard ASP.NET Web items.   I use the WSPBuilder tool to create web solution packages that I can install and deploy on SharePoint farms. WSPBuilder is simple to use, but it requires that the project files are in folders within the project that match the deployment target's structure (the 12 hive). The next step is to create the folders shown below.  
    When you run WSPBuilder it creates a solution manifest based on the files that are actually in the project. So, if I don't include any files in a particular folder, the presence of the folder in the solution won't affect the package. So, I usually just start out with the set of folders I am most likely to use ahead of time.   Most projects require a few feature receivers or other code that has to deploy to the Global Assembly Cache. This requires that the assembly has a strong name, which in turn requires a strong-name key. The next step is to configure code signing. You can read more about that process here: http://msdn.microsoft.com/en-us/library/ms247123.aspx.   WSPBuilder will also specify in the solution manifest that the assembly should deploy to the GAC if it finds it in a GAC folder beneath the project root. To enable this create the folder in the project and set the output path. To learn how to do this, see:http://msdn.microsoft.com/en-us/library/kb4wyys2.aspx. At this point, the project structure looks like the following:  
    Finally, before I can write any code, I need to add references to the SharePoint and various System.Web assemblies.  
    That's a lot of work to go through every time I want to create a new solution. In a team environment over the course of a year you could waste days doing this by hand. Worse, different members of the team might do things differently resulting in confusion for all. If you save the result as a project template you can avoid ever having to do these steps again. You can also share the template with your teammates. To export the project as a template, select File|Export Template and complete the wizard. The result is a ZIP file. If you give it to a teammate and they put it into their Documents\Visual Studio 2008\Templates\ProjectTemplates folder, they will have it as an option when they create a new project.  
You can download the result here: http://www.elumenotion.com/Downloads/WSPTemplate.zip    

Building in SharePoint 2007 with Visual Studio 2008

 SharePoint 2010   SharePoint has been over the years growing in popularity for connecting Microsoft Visual Studio applications to people and process. It is a collaboration software for enterprises, as dubbed by Microsoft. It is used by developers, IT professionals and end users for efficient sharing of website content developed without training and in minimum timeframe. Fortune 500 companies have often used fast and friendly technologies like SharePoint with Visual Studio to develop and collaborate in social networks for employees. Hence it remains chiefly a corporate venture.  

How to build Visual Web Parts for SharePoint 2007

SharePoint 2010 Enterprise - 'Create Site' screen

This article covers a basic tutorial on how to build Visual Web Parts for SharePoint 2007 as shown in the link https://vimeo.com/11285888 .   

The main steps to follow are : 

  1. First create a sample empty website with Visual Studio 2008 and check that the browser and web server are working correctly displaying it. The web server is IIS Server. Any browser should be compatible. 
  2. Create a new project. Select WSPBuilder as the project. If you have installed SharePoint, the WSPBuilder option will come under Workflow projects under Visual C # or Visual Basic Language projects group. Change the name of the new project to something you want. 
  3. You get the project solutions explorer to list project files. Select the project name and right click to add new item. You can add windows forms, web forms, reporting, data and code object items. But in the WSPBuilder Items, there are many features like Web Part Feature, Sequential Workflow feature and State Machine feature alongwith event handler and other item templates. Select the Web Part Feature and Add. 
  4. In the feature settings, set the scope of the Web Part to site, since we would be adding the web part to the site. Also you may need to rename the feature and add description. 
  5. Now you get the feature folder having the manifest XML file of feature and elements. Also you get the CodeBehind file where you can add and manipulate data to be bound and displayed into the site. 
  6. Add GUIDType in the csproj Project File. The details are given in next section. This is to certify all .NET Web Forms to go with older VS 2008, so that after registering the new assembly with GUIDType in Project File, you can add VS 2010 Web User Control Items from Add Item templates. 
  7. Now Design a View Page with Data Controls. 
  8. Add/Edit Event Handlers of Controls. 
  9. Add your custom code to event handler. For example databind the datasources of data objects. 
  10. Now clear and recode the WebParts CodeBehind file. It has sample code as inherited from Microsoft Sharepoint Library. On the same namespace, inherit the WebPart Item class from System.Web.UI.WebControls.WebPart . 
  11. Now you need to load the WebPart Control file WebPartUserControl.ascx . For which you just need to specify the relative path of your control file among the control templates inside your project. 
  12. Build the project so that Assembly dll is created. 
  13. Now you must add an assembly reference to the project dll file inside the User Control ASP code. For that use Reflection.exe drag drop the assembly created for your project. It will reflect the four part assembly reference which you copy paste in the ASP code of Visual Web Part User Control .ascx file. 
  14. Now build and deploy. Refresh your site and the Sharepoint Site has this new user control added for activation. 
  15. Activate the Web Part and use your site with new control behaviour.      

Friday, September 21, 2012

How to create professional forms with Joomla


Joomla logo
Joomla logo (Photo credit: Wikipedia)






Joomla is a popular content management system (CMS) that adds user-friendly forms and components to web applications without the programmer's streak. It is suited to the plugin friendly open source technology like Php and Wordpress. Today in this post we will have an overview of how easy it is to create forms in Joomla. 

There are three main components of a web application from the MVC Architecture perspective. The View that is the Graphical User Interface, which we will be looking at how to create. The Model is the Data Model that saves the information into database, MySql in our case. Controller is the necessary scripts that Joomla and any other CMS platform allows to process the data from input and output it as desired. 

Getting started on Joomla

Before giving a technical demo on forms on Joomla, this is section on how to get started installing Joomla for the novices.
First you install a copy of Joomla on your local server. You can set up a server on your desktop. Call it localhost as it always is localhost. XAMPP is a good server to get you started. Installation of XAMPP is explained in detail on http://ahsannabi.com on Zen Cart Installation

1. Firstly install XAMPP or other Windows or Linux based Web Server.  I have used XAMPP for Windows based PHPMyadmin and Apache which are included in the same Web Server Pack.
2. Extract the compressed archive and save the folder in the htdocs folder of XAMP or your own Web Server’s webroot folder. Rename the folder to something shorter and simpler with the name Joomla. Usually the name is suffixed by version number. For example, for Joomla 1.6 the folder name is Joomla16.
3. Download files for Joomla! from the main Joomla! site http://www.joomla.org . Install the files in correct folder , in our case C:\xampp\htdocs\joomla16 . You install by just extracting the zipped files downloaded into the specified folder of web server. The extraction wizard prompts for where you want files to be located. Here you specify it.
Here are some documentary details getting started on Joomla! from their official website http://docs.joomla.org/Use_Joomla!_on_your_own_computer
     
4. Create database Joomla16 using PHPMYADMIN
5. Open the Joomla! site in your browser. In our case the address is 
http://localhost/joomla16
because htdocs contains the folder joomla16 that is accessed by the web server.

6. Now on the browser the Joomla! Installation screen displays. Here, Select language, Look into the Pre-installation check and Press Next to continue.
7. Configure the database as shown below


The database configuration screen illustrates the layout of the display and shows the answers for the database configuration here. It also illustrates that there is a fair amount of on-screen help.

This sets up and configures the database, where all the content for the site is stored.
8. Skip the FTP configuration. Press Next
9. Give Site name, your email and the password to use the admin of the site, and get sample data.

Professional Forms Tutorial

Bearbeitung von Benutzern
Bearbeitung von Benutzern (Photo credit: Wikipedia)

We refer to this tutorial for help https://vimeo.com/5585401 . 

 Joomla CMS shows us tabs for forms and scripts. On the forms menu, you can create a form page. On each form page you create untitled elements, give them title to suit meaning of functionality. Add sections and multi-part forms with paginations. Edit labels, add text boxes, password fields, number and calendar fields, image fields, file upload sections, and submit buttons to submit form data to special scripting module. 
The independence and flexibility with the forms is that you can drag drop one form part into another from the form component tree and see the resulting form object composed of sub-objects through preview. This is what is special of Joomla. You can assign sub-tasks to your teams and integration is just drag drop form elements in the form component tree.

The steps for creating professional form in Joomla as in the demo above include:
1. On manage forms go to quick mode.
2. Click on quick form button
3. Add Title and Description of the form, name is automatically added to the form.
4. Check the box of "last page is thank you page" so that after submitting the form you get a thank you page which you can always customize.
5. Check the box of mail notification page, so that on submitting the mail notification is made.
6. Add a number of mail recipients.
7. Add the submit button and pagination of the form is multipart or cannot be squeezed to a single page.
8. Advanced features of form are also on the next tab next to Properties tab. 

There are many themes of aesthetic value to consider when designing web forms with Joomla. 


Sunday, September 16, 2012

How to create a popular blog?

Three points for a successful blog:

 Technology Edge, Original Fluency, and Social Connection
A 'Two Way' Whiteboard at Newhouse III
(Photo credit: Vin Crosbie)


I am a successful blogger with a well-read blog ahsannabi.com . I enjoy 80 - 100 visitors per day on good days of blog reading. I even have rare blog nomination for WordAds, hundreds of subscribers and forefront Google Ranking. How did I achieve all this. Three points: Technology, Fluency and Connection

Technology

First of all choose a blog application as a Content Management System (CMS). Some of the more popular blog creating applications are Blogger from Google, Joomla and Wordpress . A mature blog creating CMS contains customized themes for displaying the contents and design in a wide variety of ways with flavours and colours suited to the blog purpose. Some good examples of themes are Socialia for Social Welfare Organizations, Minimatica for company main product line, Colorful for displaying a company profile, and many available as free and purchaseable versions.
The quality of a theme or a component used in a blog depends upon its reusability. The more popular a component, the more its rating in stars. If frequent users of a component in a blog do not feel satisfied with that component, they will simply uninstall it hence decreasing its popularity scale and rating.

This is icon for social networking website. Th...This is icon for social networking website. Th...

A blog has many popular components or plugins listed in CMS like
Calendar, RSS Feeds
News FeedsSubscribers List
Share Buttons, Social Networking Plugins, Games, Tag Cloud, Search Engine Optimization Plugins

    Fluency

    A 'Two Way' Whiteboard at Newhouse III (Photo credit: Vin Crosbie)
    A good blog is a easy-to-read blog. A better blog is an attractive blog. The best blog is as captivating as it can be. Based on the topic, the blog should cover all the main points required for the justification to the topic in a simple, lucid style. On the internet, people do not have much time to read as in a book. Writing-a-blog style is often personal, funny, appealing to the senses, in a small shell, BEAUTIFUL!
    Main points of the blog should stand out, possibly in bullets, or subheadings, with some hanging indented extractions of text and occasional quotations. Any images or illustrations should often be mentioned in detail. A picture is worth a thousand words. Make your words speak with an illustration and make your illustration prove your words.
    There are ways how to achieve fluency.
    1. Increase your typing speed.
    2. Follow your instincts
    3. Write from your experience and knowledge
    4. Write different and interesting
    5. Get the knack of explaining away complex issues simply
    6. First look at a picture and describe
    7. First read a story and narrate
    8. First make a decision and show pros and cons
    9. First make an opinion and then quote
    10. Always be yourself

    Connection

    As you grow your blogplant, you get encouraged by more and more visits. Just dont shy away. Open up. Follow comments, respond, off course to non-spams. After you reach a maturity and volume in your writing and originality, advertise your blog. Go to facebook, twitter, and other social networking sites. Join different groups. Post something relevant about your blog. For this join relevant groups and social networking pages.
    Identify the main keywords of your blog and highlight them, link them to wikipedia definitions and other google cross references. This is linking strategy for better blog visiting. A rule of thumb: For every hundred backlinks on your blog, you earn one backlink of your blog by someone else without asking him! Thats my experience. Dont worry if your backlinks are not that effective. Let the tools help you out. Wordpress has its own backlink and tagging engine. If you want to add the same into any blog content management system that does not support autolinking, just copy-paste the html from Wordpress into that blog. Simple. Make both ends meet.

    Wordpress, Technorati, GBC stickers
    Wordpress, Technorati, GBC stickers (Photo credit: Titanas) 


    Always keep copies of your blogs. Copying is allowed in blogs. You may quote from other blogs. Just mention references. That's it.
    Finally, once your blog is really popular, with towering statistics, own a domain. Get some advertisements and make money on its own!

    Thursday, September 13, 2012


    Among the trendy Cloud Computing Platforms, Amazon Web Services is going as the best. We will see today how much have these platforms performed in the cloud competition.


    Amazon offers PHP Applications, Windows Azure, and its own flavored additions of Hadoop and other Web Services for shared distributed computation costs across operating systems and cross language with enormous documentation. Amazon has presence in Mobile, Web and Social Applications. Major and minor brands have had successes and topping up profits through Cloud Based Applications in Amazon. For example, Samsung  introduced its Smart Hub Application and within a short span made profits of US $ 24 million or more. Washington Post increased its reader base by more than half through its WaPo Labs presence on Amazon clouds. They introduced Social Reader App on Facebook which coordinated with other social apps with Amazon as Data Engine as base. The smaller to larger enterprises could scale up or down by the press key of a command line. Among the many products and services of Amazon.com, the most popular in Cloud Platforms are EC2,   MapReduce, and LoadBalancing for Computation Flexibity; Amazon Relational Database Service, SimpleDB and DynamoDB for Database cost-cutting-edge, and other Search, Storage and Networking Services.


    Google is fast becoming the ubiquitous freeware of bigdata associated with the largest email and search engine group. The App Engine of Google is enhancing business consumer experience. It allows programmer and data customization for user friendly Web Applications over the Google Platform.Currently the most popular Google Web Apps employing cloud's big data are GMail, Google Search for general and specific types of documents and App Engine with their Advanced Programmer Interfaces, Google Docs, which has recently shifted to Google Drive, a desktop application to synchronize online Google Docs files. Google aims to reorganize the untapped world of books, scholarly articles, newsgroups, images, business and industrial documentation, etc. It has this philosophy of being an informal user friendly interface for all the informational needs.


    Salesforce.com is another advanced business-purpose suite employing cloud technology to enhance the business presence over the new web of cloud environments. It has its own robust servers and a lot of customization facilities for business based applications.The Cloud capabilities of salesforce.com spread to Sales, Marketing, Chat Support, Human Resource Management, Help Desk Services, and other customized Web Applications based on single or multiple user platform. Major giants like Cisco and Symantec have employed Salesforce for its services. In a recent survey, Salesforce confirms its commitment to increased user satisfaction, speedy case resolution, and efficient information access. Hence popularity among new leads and retention in customers relation creates more revenue and sales productivity. Salesforce is ideal for well-established businesses that want a comeback into the market competition to get the major market share.
    Google App Engine has some of its sister open source ventures, one is AppScale. It also has coding and debugging independence of customization. AppScale also supports MapReduce, Hadoop, and any cloud API that can support Ubuntu Lucid Image. The brains behind AppScale are from IBM Research, National Science Foundation and other state bodies.