Tuesday, April 19, 2011

WebMatrix - New Buzzword in IT Industry

WebMatrix is a free tool that allows you to create, customize and publish websites, Believe me It’s amazingly easy to use.
WebMatrix connects you to a world of popular and free open-source Web applications, including WordPress, DotNetNuke, Umbraco, Joomla!, Moodle, Drupal , and many more(till now 49 apps). You can select a website from built-in gallery, and WebMatrix will handle all the downloading and installation of your new Web site.

Here is the list of Features of WebMatrix which makes it very powerful and #1 development tool for the web development.
Features List of WebMatrix




  • Small, but complete package - It is free web development tool. It is small in size but very powerful tool.


  • Desktop based Web Development and Testing Environment - You will get the same powerful Web server(IIS Express), database engine(SQL CE4), and frameworks(MVC 3.0) that your Web site on the internet uses. This ensures that your transition from development to production is smooth and seamless.


  • Easy to Code - Start with HTML, CSS and JavaScript and then seamlessly connect to a database or add in dynamic server code using the new ‘Razor’ syntax for ASP.NET Web pages.


  • Webmatrix have intellisense - it also supports tag completion and hinting for standard HTML and CSS markup making it easier and faster for you to write code.


  • Simple Publishing - You can find host company to suite your need. Use webMatrix to find your web host which supports webmatrix.


  • Easy to cross bowser testing - You can test your site directly will diffrent browsers using webmartix tool.


  • Last but not least - It will connect you with lots of open source web applications(till the date i am writing this blog - 49 applications incliding most populars WordPress, DotNetNuke, Umbraco, Joomla!, Moodle, Drupal and more)


  • Make your site More Search engine friendly - Run an SEO report and find how to make your site more visible to search engines.


  • Code Helper is the best helping tool - Want to display a Twitter feed? Need to show a video? Code helpers make common tasks easy to do with just a simple tag in your HTML(Yes it is HTML not server side...).


  • Nice Interface with IDE, Database, IIS, FTP, and more - WebMatrix has rich code editor, a database editor, Web server management, Search Engine Optimization, FTP publishing, and many more..


  • Easy and Lightweight Database - Using a database has never been easier! WebMatrix includes a small, embedded database SQL Server CE 4. Copy that database from your machine to web server under bin folder and you are done.

  • Enjoy your Green coding @ code4Green.com

Thursday, April 14, 2011

Compare powershell and STSAdm commands for SharePoint


Here is the Most important STSAdm commands which is used in Sharepoint 2007 for scripting. I have converted those comands into PowerShell, so you can compare and use it. Here is the sample to compare side by side STSAdm and PowerShell commands for Sharepoint:

    STSAdm Command
  • stsadm –o addsolution –filename “D:\Temp\YourSharePointSolution.wsp“

  • stsadm –o deploysolution –name YourSharePointSolution.wsp –url http://myspwebappp –allowgacdeployment –immediate

  • stsadm –o upgradesolution –name YourSharePointSolution.wsp –filename “D:\Temp\YourSharePointSolution.wsp” -immediate

  • stsadm –o retractsolution –name YourSharePointSolution.wsp –url http://myspwebapp –immediate

  • stsadm –o deletesolution –name YourSharePointSolution.wsp

  • stsadm –o activatefeature –name YourFeatureName –url http://YourSharePointWebApp

  • stsadm –o deactivatefeature –name YourFeatureName –url http://YourSharePointWebApp

  • stsadm -o execadmsvcjobs

  • stsadm -o userrole -userlogin "YourUserOrGroupName" -role "Approve" -add -url "http:/YourSPSite"


    PowerShell Command
  • Add-SPSolution “D:\Temp\YourSharePointSolution.wsp“

  • Install-SPSolution –Identity YourSharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment

  • Update-SPSolution –Identity YourSharePointSolution.wsp –LiteralPath “D:\Temp\YourSharePointSolution.wsp” –GacDeployment

  • Uninstall-SPSolution –Identity YourSharePointSolution.wsp –WebApplication http://myspwebapp

  • Remove-SPSolution–Identity YourSharePointSolution.wsp

  • Enable-SPFeature –Identity YourFeatureNameOrGuid –url http://YourSharePointWebApp

  • Disable-SPFeature –Identity YourFeatureNameOrGuid –url http://YourSharePointWebApp

  • Start-SPAdminJob -Verbose

  • New-SPUser – UserAlias ‘YourUserOrGroupName’–displayname ‘Your Display Name’ –web YourSPSite


Here is the complete list of stsadm command and their related PowerShell command: Click HERE

Thursday, March 31, 2011

Sharepoint Code Generation Tool

Code4Green.com has launched its Sharepoint Code Generation Tool Yesterday. Now Sharepoint developers can create Feature , Fields, Content Types, and Document Library using this tool. Visual Webparts is already available in code4green under ASP.net Category - It generates ascx control and ascx.cs file for given fields. You can Generate Sharepoint Features(i.e. List, Fields, Content Type, Doc. Library) using Code4green's Sharepoint Code Generation Tool. Please give you feedback and if you need any specific feature in sharepoint code generation, please feel to write me on Info@Code4green.com Enjoy Green Coding.... :)

Thursday, March 17, 2011

Copy and Paste of Script from Web page is becoming single line text

Hi,
I have been asked so many times with the development groups that they can not copy and paste the syntax code from some web pages with indentation.
Issue If a Syntax is in HTML's Code element, than simple copy and paste will paste as a single line text (in notepad or Visual Studio IDE). So, It will remove all the indentation also.
Solution: Copy the code from web page and paste into Excel sheet. It will keep indentation and color coding for you and then after that copy from excel and paste to your IDE.
Sample: Try to copy Syntax code from http://stackoverflow.com/questions/1404513/random-background-image-for-div page, and paste into notepad or IDE. It will become a single line of code.
But if you will copy and paste into excel and again copy from excel than paste into notepad or IDE than if will come into multiple lines with indentation.

Enjoy your Green Code @ code4green.com

Monday, February 14, 2011

What is a distribution group? Why it throws HTTP status 401: Unauthorized Error in Sharepoint

What is a distribution group?
Distribution group is a sharepoint goup which is used for distributing emails to more than one people. whenevenr we want to relay a email message for a group, than we need a distribution group. It need a email id for distribution group, and when we creates a distribution group in sharepoint than automatically a AD group is created.
In MOSS 2007, AD's Distribution group can not be added into people & groups. So MOSS 2007 has added this feature to link AD's DIstribution group with SP. Now you can create a distribution group in Sharepoint and it will creates group in AD.
There are three different places you can find for disribution group in sharepoint:
1. Central Admin (Central Administration > Operations > Incoming E-Mail Settings )
Configure Incoming E-Mail Settings
Set Enable sites on this server to receive e-mail? Yes, and Settings mode: Advanced
Incoming E-Mail Server Display Address

2. under Central adminitrator > Topology and Services, click on Approve/reject distribution groups. it will show view for approved distribution group.
create a new view for ViewAll and don't put any filter. ViewAll will show all the Dtribution groups. based on their status select group which is in pending stage. right click and click on approve.

3.go to people & users and go to groups & select a group. once group is selected than go to settings > group settings. In "E-Mail Distribution List" section, select yes for Create an e-mail distribution group for this group? , and then give the name for group. Click OK.

4.Create document library/list to recieve a incoming email - Create new document library/list. while creating the new list/lib a. select Allow this document library to receive e-mail? Yes, b. Type the email address under Incoming E-Mail section.

If you don't have proper securty at AD for sharepoint account than you will get these errors:

In Central Admin
Object reference not set to an instance of an object. at Microsoft.SharePoint.EmailIntegration.SPEWSApprovalManager.ExecuteJobInAD(Int32 listItemID)
at Microsoft.SharePoint.ApplicationPages.DMSCmdPage.BtnOk_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Troubleshoot issues with Windows SharePoint Services.
------------------------------------------------------------------------------------------------

While Change Group Settings (people & group > groups > select your group > settings > group settings)

The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.SharePoint.DirectorySoap.SPDirectoryManagementProxy.CreateDistributionGroup(String Alias, String Name, String Description, String ContactCN, RequestInfo Info, DistributionGroupFlags Flags)
at Microsoft.SharePoint.SPGroup.CreateDMS(String dlAlias, String friendlyName, String description, String[] members, String requestor, String justification, Int32& jobId)
--------------------------------------------------------------------------------------------

Setup groups
Distribution group could not be updated because of the following error: The following error has occurred while attempting to contact the Directory Management Service: The request failed with HTTP status 401: Unauthorized.

I will keep posting with my findings.

Enjoy Green coding at www.code4green.com

Hussain Naqvi