Archive for the ‘ASP.Net Frameworks’ Category

Print This Post This page as PDF Email This Post Microsoft SharePoint Server Mini Calendar Webpart

Saturday, August 1st, 2009

Dot Net team at OffshoreSoftwareDevelopmentIndia.com has developed Microsoft SharePoint Server Mini Calendar Webpart. This MOSS 2007 Mini Calendar Webpart allows administrator to select any of the list to configure with the calendar. Calendar displays all the tasks, events in the calendar. Upon selecting the list, all the events/tasks will show in Mini calendar by highlighted background to the date. On mouse hover to that date, a popup will appear with all the events/tasks for that day. On clicking that link of the events/tasks, the page will redirect to that task/event page.

It is easy to install. Easy to configure. With rich functionalities.

Working with MOSS Mini Calendar:

There is often need to share information about important dates, appointments and meetings. The MOSS Mini Calendar provides all information.

When you import MOSS Mini Calendar on site it looks like as follows:

Mini Calendet for MOSs

(Fig. 1)

When click on Modify Shared Web Part (right top corner) of Fig. 1, it looks like as follows:

Mini Calendet for MOSs

( Fig. 2 )

What you see on right side of Fig. 2 are custom properties of the mini calendar.

  1. About us: When click on this, it displays company details in popup window.
  2. Select a list: It contains variety of contents like documents, form and templates, master page gallery, web part gallery etc.
  3. Select a display column: It contains different columns like name, title, created by, modify by related to selected list item. What you want to display on calendar please select from this list.
  4. Select a view to filter calendar items: select which items to display related to calendar item.
  5. Select a date column to base the calendar on: Means which items to display related to date column (e.g. created, modify).
  6. Select a Background Color: It sets calendar date cells background color.
  7. Select a Body Text Color: It sets calendar date cells text color.
  8. Select a Border Color: It sets calendar border color. It also sets calendar?s title back color.
  9. Select a Border Font Color: It sets calendar?s title fore color.
  10. Select a Highlight Color: It sets color on that cells where there are some events display in popup window by moving mouse over on cell as follow-
  11. Mini Calendet for MOSs

  12. Select a Highlight Font Color:
  13. Mini Calendet for MOSs

  14. Select a Day Header Background Color: It sets the calendar?s day header background color.
  15. Mini Calendet for MOSs

  16. Select a Day Header Fore Color: It sets the calendar?s day header font color.
  17. Mini Calendet for MOSs

    By setting all above properties, click on OK button it display as Fig.1. Now When you take mouse over the highlight cell it display popup window as follow ?

    Mini Calendet for MOSs

    When click on any items it goes to that particular page.

    Calender Webpart Configuration: Webpart Properties

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Mini Calendet for MOSs

    Prerequisites:

    1. We need to make sure that timer job is running from:
    2. Administrative Tools >> Services >> Windows SharePoint Services Timer

      Mini Calendet for MOSs

      If service is not started please start it.

    3. Check whether solution is deployed or not.
    4. From - Central administration >> Operations >> Solutions

      Mini Calendet for MOSs

    5. If it is deployed then they can go ahead and activate feature manually by going to site collection
    6. Site Actions >> Site Settings >> Modify All Site Settings >> Site Collection Features.

      Mini Calendet for MOSs

Print This Post This page as PDF Email This Post Create Extension for Microsoft Office Accounting

Saturday, August 1st, 2009

Dot Net team at OffshoreSoftwareDevelopmentIndia.com has created many Extensions for Microsoft Office Accounting. Here you will find how to create Microsoft Office Accounting extension.

Create Application Extension for Microsoft Office Accounting:

You can create your own application which can be integrated to your accounting company. You need to follow given steps for creating New Application which can be integrated to MOA.

Assumption: You might have created your company in MSOA and you have to pass company name in step - 9 at the place of “yourCompany.sbc”.

  1. Create Windows based Project.
  2. You have to add references of following DLLS.
    • ILoader: c:\WINDOWS\assembly\GAC_32\ILoader\2.0.5201.0__31bf3856ad364e35\ILoader.dll
    • SBAIAPI: c:\Program Files\Microsoft Small Business\Small Business Accounting 2007\Assemblies\SBAIAPI.dll
    • SBAIUI: c:\Program Files\Microsoft Small Business\Small Business Accounting 2007\Assemblies\SBAIUI.dll
  3. Now you need to Import two namespace for MOA
      - using Microsoft.BusinessSolutions.SmallBusinessAccounting.UI;
      -using Microsoft.BusinessSolutions.SmallBusinessAccounting;
  4. Provide the Information related to your Loader
      - const string loaderFULLNAME = “Loader, Version=2.0.5201.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″;
  5. Provide the details related to your Assembly
    • const string loaderNAMESPACE = “Microsoft.BusinessSolutions.SmallBusinessAccounting.Loader.Loader”;
  6. Create object for ISmallBusinessInstance.(It is an interface so no needs to create New Instance for this
  7. Load the assembly which was initialized before.
  8. Assembly assem = Assembly.Load(loaderFULLNAME);

  9. Load the assembly which in your system using Loader
  10. ILoader ldr = assem.CreateInstance(loaderNAMESPACE) as ILoader;

  11. Create string object and initialize with .sbc file which is stored in Your MYDocument. You can provide other path also.
    • string sbaFile = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) Path.DirectorySeparatorChar + “Small Business Accounting” Path.DirectorySeparatorChar + “Companies” + Path.DirectorySeparatorChar + “yourCompany.sbc”;
  12. Load the file in your application using loader.
  13. - sbi = ldr.GetSbaObjects(sbaFile).SmallBusinessInstance as ISmallBusinessInstance

  14. Now your sbi object (instance of SmallBusinessInstance) is ready to Use.

Manage customer details using SmallBusinessInstance Object

Now it’s time to implement SmallBusinessInstance object to access the details related to Customers. [sbi is an object of SmallBusinessInstance]

How to view existing customers?

  • Create object of DataTable. And initialize the Details of sbi.CustomerAccounts.DataView.Table to the object of DataTable.
  • You can use this DataTable object and assign that object to DataSource of GridView or ComboBox to view the details related to Customers.

How to create New Customers?

  • Create an object of ICustomerAccount. And assign the value of sbi.CreateCustomerAccount(); ICustomerAccount cust = sbi.CreateCustomerAccount();
  • Now you can access the Properties on Customer Account (e.g. Name, Active);
  • You cannot access the property of Address, Email and Fax directly from this object you need to create the object of ICustomerVendorAddress , ICustomerVendorEmail and ICustomerVendorFax respectively
    • ICustomerVendorAddress: You have to create object of ICustomerVendorAddress and initialize it. ICustomerVendorAddress address = cust.CustomerVendorAddresses.GetByType(CustomerVendorAddressType.Business); where you can find different CustomerVendorAddressType. Like (Business, Home, Postal, etc) Now you can access the properties of Address.
    • ICustomerVendorEmail: You have to create object of ICustomerVendorAddress and initialize it. ICustomerVendorEmail emailAddress = cust.CustomerVendorEmails.GetByType(CustomerVendorEmailType.Email1); where you can find different CustomerVendorEmailType. Like (Email1, Email2, and Email3). Now you can access the properties of Email
    • ICustomerVendorFax: You have to create object of ICustomerVendorAddress and initialize it. ICustomerVendorFax faxNumber = cust.CustomerVendorFaxes.GetByType(CustomerVendorFaxType.Business); where you can find different CustomerVendorFaxType. Like (Business, Home and Other). Now you can access the properties of Fax.
  • Now you can save the Customer. cust.Save();

Manage Payment details using SmallBusinessInstance object Now you can implement the Payment module of customer in following ways.

How to Create New Payment for Customers?

  • For payment of customer you have to specify for which customer you need to make payment.
  • You need to provide AccountId of customer for Payment.
  • Create ICustomerAccount object and initialize it with sbi.CustomerAccounts
    ICustomerAccount cust = (ICustomerAccount)sbi.CustomerAccounts.GetByPrimaryKey(AccountID);
  • Create object of ICustomerPayment and initialize it with sbi.CreateCustomerPayment()
    ICustomerPayment payment = sbi.CreateCustomerPayment();
  • Now assign the value of payment.Customer as cust
    payment.Customer = cust;
  • Now provide the details of Amount.
  • And finally save the record
    payment.Save();

Manage Invoice details using SmallBusinessInstance object. You can manage the details of Invoice using the APIs of Microsoft Accounting.

How to View existing Invoice?

  • Create object of DataTable. And initialize the Details of sbi.SalesInvoices.DataView.Table to the object of DataTable.
  • You can use this DataTable object and assign that object to DataSource of GridView or ComboBox to view the details related to Invoice.

How to create New Invoice?

  • For Invoice of customer you have to specify for which customer you need to create invoice.
  • You need to provide AccountId of customer for creating Invoice.
  • Create object of ISalesInvoice and initialize it with sbi.CreateSalesInvoice(false). ISalesInvoice invoice = sbi.CreateSalesInvoice(false);
  • Create object of IItemLine.

IItemLine line;

  • Initialize the object of IItemLine with invoice.CreateSalesInvoiceLine(parameters) IItemLine line = invoice.CreateSalesInvoiceLine(DocumentLineType.ContractItemLineType) as IItemLine;
  • Now assign the value for LineItem property of IItemLine object line.LineItem = sbi.ItemAccounts.GetByPrimaryKey(ProdId) as IItemAccount;
  • Provide the Quantity and other details of IItemAccount object.
  • Finally save the details of Invoice

invoice.Save();

Print This Post This page as PDF Email This Post Beginning with 3 Tier architecture - Asp.net -C#

Friday, February 20th, 2009

By Nikhil

By default Microsoft .NET Framework provides various ways to build application. There are many ready made frameworks and many open sources frameworks available to build application for Asp.Net, C#.

Please refer following 3 Tier application framework and structure for beginners and small scale application in C#, Microsoft .NET.

Please for any further information drop us an email at,
info@offshoresoftwaredevelopmentindia.com

This system is created with the concept of 3-Tier. We have divided the system in several folder or directories. Details related to the Folders are as follow as per the role of it in System.

This folder is used to store different type of file relate to design. This folder is used to save following thing.

Master Pages

CSS

JS file

In this directory we are creating the folders and file for Admin and Front-end GUI. For both the modules there are different designs.

This directory is used to store the forms for the System. In this situation this directory stores two types of files.

ASPX file and

CS file

Controls

In this directory we are storing the controls which are going to be used in the system. This directory is having different sub-directory like, admin, frontend and general.  

 

App_Code

This folder is a system folder which has library code for the system. Code and class files related to the system are kept in this folder. 

All the Images related to the Project is kept in this folder

As this module is language independent, XML files of different languages are kept in this folder.

 

Flow of Structure from UI (User Interface) to BLL (Business Logic Layer)
and DAL (Data Access Layer)

In above diagram user interacts with Forms (UI). Form may contain some user controls that is inherited or created form the existing controls. Data moves from Forms to BLL and from BLL to it moves to DAL. And now data moves from DAL to database. The Data gets reverse to display proper information to the user.

We have created following namespaces to develop this module.

Maven.UserControls

Maven.HelperClasses

Maven.BLL

Maven.DAL

This namespace is used to create the controls on your page. You can create the control in asp. Page using the following code

Register the control in your aspx page.

<%@ Register Namespace=”Maven.UserControls” TagPrefix=”admin” %>

Now you can use the controls from this namespace using the TagPrefix as ?admin?. For Example

Using User Controls

<admin:RolePage runat=”server” CheckPageFor=”Add” ID=”chk” />

Different types of controls used for developing this Module.

Control Name

Use

ChkRole

This control is used to get whether the User has right to use this page or not. If not he/she will be redirect to Dashboard.aspx page

RoleButton

This control inherits Button class. This controls gets Enable and Disable as per the roles and rights of logged in user

RoleAddEditPanel

This control inherits Panel class, This class is used to know whether the user has permission to Edit or Add page. If user hasn?t rights Panel will be Disabled otherwise it would be Enable.

RoleGridView

This control inherits the GridView Class. If the user has view right this will give Data else it will give Error Message

RoleUser

This class is used to manage the Page role wise and display the Login Name in Header

 

This namespace is used by different classes for different purposes. This namespace has following functionality. This class has Enum for better representation.

We can divide this namespace in following type of classes and Enum.

Enum

This class is having Enum for better presentation of code. There are different types of Enums in these classes,

CommandName ? To know which type of command is fired or used.

RoleFor ? To check for the role of user

ChkPageFor ? To check for the mode of page for Add or Edit

RoleText ? To check which type of role does the user have

Static classes

You can directly call this classes? methods with className.MethodName()

ErrorMessage ? This class is used to get the ErrorMessage.

Language ? This class is used to translate the language.

Base Classes

You can call these classes with the help of object.

List of these classes is as follow:

SQLHelper ? This class is used for Database operation. Insert, Update and Delete

SQLParamete ? This class is used to create and use the Parameter for the Stored Procedure.

XMLHelper ? This class is used for XML file operation. Insert, Update and Remove Node

Mail ? This class is used to send mail

Error ? This class is used for Error and Exception. This class redirects the Page on Error Page when there is any Exception.

This is the Business Logic Layer of the User Management Module. All the class in this Namespace is used as a bridge between User Interface and Data Access Layer.

This is the Data Access Layer for the User Management Module. All the class in this namespace is used as a bridge between data access layer and Database.

These are the User controls which have GUI. We can call these controls as follow

Registering User Control

<%@ Register Src=”~/controls/general/litral.ascx” TagName=”Label” TagPrefix=”admin” %>

Creating Control

<admin:Label runat=”server” ID=”lblUserName” ControlName=”UserName” FormName=”USER” IsRequired=”true” />

In above control FormName is the Node just after Language and befor Control Name

Different types of User controls are created as follow:

Control Name

User

Button

This is the user control to work as button. The Text for this control is retrieved from Language.xml file

Literal

This control is used to display the Text on the Web form. We can Retrieve the details from the Language.xml file.

OperationPanel

This Control Panel is used to display the button for Add, Delete and Moderate Functionality.

 Note: Images will be updated soon.

Print This Post This page as PDF Email This Post ASP.NET MVC Framework

Sunday, January 11th, 2009

By Rupen

Microsoft has released the MVC source to support the MVC structure with ASP.Net. The ASP.NET MVC Framework is a Model-view-controller framework.

What is ASP.Net?

Asp.Net is the web application framework developed by Microsoft. Software developers can create dynamic websites, web applications and web services using the ASP.Net. ASP.Net is based on .Net framework, which runs on CLR ? Common Language Runtime. Developers can write ASP.Net code various .Net languages like C#, VB.Net and many more.

What is MVC structure?

MVC is architecture with model-view-controller. This architecture differentiates the business layer and presentation layer.

Model part represents the Business data layer, which manipulates the application data.
View part represents the Presentation layer, which displays the design for user interface.
Controller part represents the Business logic layer, which communicates with Model part and View part.

What is ASP.Net MVC framework?

MVC architecture support with the ASP.Net is delivered by Microsoft with the source file under the name of ASP.Net MVC framework. The ASP.NET MVC Framework is a Model-view-controller framework architecture.

This manages the model, view, controllers using interface based contracts. Server ? Client post back communication uses the ASP.Net routing mechanism.

Views can be standard .aspx pages or different view engines can be used based on XSLT files.

Model maps to the database with entries into tables. All the data access and data manipulation tasks delivered through Model.

Controller handles the communication and updates the Model part, delivers necessary information to view part to render the user interface.

The ASP.NET MVC framework fully supports existing ASP.NET features like forms/windows authentication, URL authorization, membership/roles, output and data caching, session/profile state management, health monitoring, configuration system, the provider architecture, etc

ASP.NET MVC features:

- Provides complete control over your HTML markup
- Enables rich AJAX integration
- Intuitive website URLs
- Clear separation of concerns which results in web applications that are easier to maintain and extend over time.
- Testability ? including support for test-driven development.

For more information please visit following link,

http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx

To download the ASP.Net MVC framework visit following link,

http://www.asp.net/mvc/download/

To learn the ASP.Net MVC framework visit following link,

http://www.asp.net/mvc/learn/

Print This Post This page as PDF Email This Post MOSS21 / Things to remember for webpart development.

Saturday, January 10th, 2009

This article will help you to develop webpart quickly and easily. Remember following things during the werpart development. That will speed up the creation and deployment of the webpart.

Things to remember when creating and deploying webpart to the site:

  • Give Assembly name and namespace name for that right click on the project name in solution explorer and select properties. On Application tab give assembly name and namespace name.
  • On Build tab in output path give the bin directory path of the site on which you want to deploy the web part.
  • Open AssemblyInfo.cs file and add system.security namespace and also add [assembly: AllowPartiallyTrustedCallers()] and then save the file.

MOSS Webpart

  • Open the web.config file of the site on which you have to deploy the web part. Site bin directory is under the vitual directories. Path is C:\Inetpub\wwwroot\wss\VirtualDirectories.
  • In web.config file add safecontrol entry under safe controls section.

MOSS Webpart

  • Also Change the trust level: and change it to Full (Write Full trust level).

MOSS Webpart

  • Deploy the web part.
  • When you deploy the web part the dll of the web part that you have created had been created in the bin directory of that site folder under virtual directories.
  • On the site go to the web parts section. Click on the site settings menu under site action dropdown list and select web part click new tab and select the web part check mark the web part that you have deployed. And click on populate gallery button now you can add a web part on the web part zone.

MOSS Webpart

MOSS Webpart

  • Now you can add the web part on the web part zone.

Print This Post This page as PDF Email This Post MOSS20 / Integration of Outlook with the SharePoint

Wednesday, December 10th, 2008

Dot Net team at OffshoreSoftwareDevelopmentIndia.com has developed many extensions for Outlook with the SharePoint. This blog is for how to integrate Outlook with SharePoint Server.

Integration of Outlook with the SharePoint:

To use Outlook 2007 to view Share Point Server 2007 resources, we must connect the Share Point Server 2007 resources to Outlook 2007. The steps that described below uses a document library as an example but we can use these steps to connect other resources, including Calendar, Task List, Discussion Board, or Contact List.

Notes:

Share Point Server 2007 permission carry over to Outlook 2007. For example, if you have permission to edit a document or list on a team site, you can also edit the document or list in Outlook 2007.

Steps to integrate Outlook with the Share Point:

  • On a SharePoint Server 2007 site, go to the Shared Documents Document Library. A link to this library should appear on the left navigation menu (Quick Launch).

Integration of Outlook

  • On the Action menu, click Connect to Outlook.

Integration of Outlook

  • In the Connect this SharePoint [Resource] to Outlook window, click yes.

Integration of Outlook

The Shared Documents library appears in a folder in the Mail pane, under the SharePoint Lists.

Note:

When you connect resources to Outlook 2007, the resources appear in their respective sections of the Outlook 2007 navigation pane. Calendars appear in the Calendar pane, under Other Calendars; Tasks appear in the Tasks pane, under Other Tasks; Contact Lists are similar to Document Libraries and appear in the Mail pane, under SharePoint Lists.

Send a Sharing Message:

If you have resources connected to Outlook 2007, you can share the connection with others through a Sharing Message.

  • In Outlook 2007, right-click the listing, and then click Share” [SharePoint resource].”

Integration of Outlook

  • In the message window, add recipients to the To line, type a message, and then click send.
  • Recipients click a link in the message to connect to the resource.

Note:

In order for recipients to access the shared resource, an owner of the resource must provide appropriate access permission.

Connect from a Sharing Message:

  • Open the Sharing Message in Outlook 2007.
  • In the Open group on the Outlook 2007 Ribbon, click Connect to this [SharePoint Resource].

Integration of Outlook

Edit Document Library Files in Outlook 2007

When we connected to the corporate network, changes you make to most resources in Outlook 2007(Calendar, Task List, Discussion Board and Contact List) are automatically updated on the SharePoint Server 2007 site.

  • In Outlook 2007, double-click a Document Library file to open it.
  • In the Opening File dialog box, click to Open.

Integration of Outlook

  • In the Message bar, at the top of the document, click Edit Offline. (The file opens as read-only until you click Edit Offline).

Integration of Outlook

  • In the Edit Offline dialog box, click Ok.
  • The file is stored on your computer, in your SharePoint Server 2007 Drafts folder.

  • Edit the file. When you have finished, save your changes and then close the file.
  • In the Edit Offline window, click Update.

Integration of Outlook

Tips

  • To ensure others do not make changes to the file while you are working on it, check it out in SharePoint Server 2007 before you being editing. Be sure to check it in when you have finished.
  • To find working copies of SharePoint Server 2007 documents that have not been updated to the SharePoint Server 2007 site, in the Outlook 2007 Mail pane, under SharePoint Lists, look in the SharePoint Drafts search folder.

Remove a Connected Document from Outlook 2007

When you have finished work on a SharePoint Server 2007 file, you can remove it from Outlook 2007. This keeps your SharePoint Server 2007 Lists folder organized and helps you focus on current needs.

  • In the SharePoint Lists folder, select the library or list from which you want to remove a file.
  • In the window to the right of the Mail navigation pane, select the file you want to remove. To select multiple files, hold down CTRL while you click file names.
  • Right-click the selected file and then click Remove Offline Copy.

Integration of Outlook

Delete a Resource from Outlook 2007

When you no longer need a resource, you can remove it from Outlook 2007. This keeps Outlook 2007 organized and helps you focus on current projects.

  • In the SharePoint Lists folder or in the respective sections for Calendars, Task Lists, and Contact Lists select the resource you want to remove.
  • Right-click the folder and then click Delete [Resource Name].

Integration of Outlook

Print This Post This page as PDF Email This Post MOSS19 / Integration of Excel Services with SharePoint

Saturday, November 15th, 2008

Dot Net team at OffshoreSoftwareDevelopmentIndia.com has developed many extenions for Excel Services with the SharePoint Server. How to integrate Excel Services with SharePoint, has mentioned in this article.

Excel Services provides a server-side paradigm for Excel in which spreadsheets published to SharePoint can calculate and render on the server, letting users pull results down to their browsers. In this new scenario, analysts can publish their worksheets to SharePoint, and allow Excel Services to kick in, meaning that anybody who browses to the site containing the spreadsheet can access the full functionality of the sheet whether or not they have Excel installed. In this scenario, the formulae that analysts enter become the code that everyone will run. You don’t need a developer to reemployment the formulae or create a new application.

Creating and Configuring SharePoint for Excel Services:-

First of all create the Blank Site. At the top right of the screen you can see the Site Action menu dropdown list. Select “Create” from the dropdown and you will be taken to a screen containing several categories of options for creating various types of item (See below Figure).

Integration for Excel Services

Integration for Excel Services

Select “Document Library” from this screen to create a new Document Library. On the Document Library screen, give the new document library a name and a Document Template. Choose any name you like (the examples use “Analytics,” and select “Microsoft Office Excel Worksheet” as the document template).

And Click on Create.

Integration of Excel Services

Running Excel Services:

Before Excel Services will work with this repository; you must make sure that the services are up and running correctly. To do this, return to the Central Administration screen, and select the Operations tab. From here, select the “Services on Server” screen. You’ll see a list of services at the bottom of the screen. Make sure that “Excel Calculation Services” is started. If it isn’t, use the link beside it to start up the service.

Additionally, you’ll have to configure a trusted file location for your Excel workbooks. You do this by returning to Central Administration, and selecting the “Create or configure this farm’s shared services” link. You’ll see the “SharedServices1 (Default)” entry on this screen. Drop this down, by clicking the arrow to the right of it, and select the “Open Shared Services Admin Site” option. This opens the administration screen for these shared services. On the right side of this screen you’ll see the “Trusted File Locations” link which you can use to set up where you can store the Excel files securely. Select “Add Trusted File Location” and you’ll see the screen below.

Integration of Excel Services

Integration of Excel Services

Integration of Excel Services

Integration of Excel Services

Use the URL address of the document library that you set up earlier (for example: http://win2k3sp:17964/sites/DevX1/Analytics) and make sure to specify the Location Type as “Windows SharePoint Services.” Click “OK” and the SharePoint will create the trusted file location as shown in Figure.

Creating and Publishing a Spreadsheet:-

Now you need a spreadsheet to use for shared calculations. For this example, you’ll build a very simple example spreadsheet that serves to demonstrate how the calculation services work. The spreadsheet performs a simple analytics calculation, called a “P/E Ration,” which simply divides the price of a stock by its earnings. It’s a useful analytic that tells you how many years you’ll need to own a stock before it pays for itself in earnings. So, for example, if your stock costs $100 and earns $10 a year, it will take 10 years to pay for itself in earnings. This ratio (or analytic) is usually seen as a great indicator of the value of a stock. In a real-world scenario, the user will provide a stock ticker, and the application would retrieve the values for price and earnings from a database. The spreadsheet could then divide price by earnings using a formula. For simplicity, this example doesn’t use a database?you’ll simply provide the spreadsheet with the price and earnings values. The P/E will be a simple Excel formula that divides the named ranges for the Price and Earnings values.

I’ve added a chart to show the relative values of Price and Earnings, and you can see the spreadsheet in Figure.

Integration of Excel Services

When you’ve completed the spreadsheet, publish it to SharePoint using the Excel Services option on the “Publish” menu see Figure.

Integration of Excel Services

When you select this, the “Save As” dialog will appear. You can use this dialog to specify the save location this should be the location that you configured as a Trusted Location earlier. However, before you do this, you should select the “Excel Services Options” button at the bottom of the dialog. You use these options to specify the items within the sheet that you want to have available to browsers. This is important, as you may have some proprietary stuff that you do not want to publish. You can simply uncheck that from this dialog and it will not be published to SharePoint, and thus kept private.

You’re now ready to publish. For the file name, specify the path to the SharePoint site that you set up earlier. The dialog will refresh and show you the document library. You can then save the document into the library. (See below Figure).

SharePoint publishes your workbook into the document library. If you browse to this document from IE, you’ll see an Excel-like generated interface. Remember, your clients do not need to have Excel installed to use the application that you’ve just built in Excel that’s part of the magic of using SharePoint and Excel services.

Integration of Excel Services

Integration of Excel Services

You may open the worksheet from the Document Library (See Figure).

Integrations of Excel Services

In this article you saw the procedures to configure and use Excel Services with SharePoint 2007. This is a terrific and incredibly useful service that allows you to publish your Excel documents to a server library and let users run them, taking advantage of the Excel’s calculation power and formulae. This is important on a number of fronts. First, it prevents version drift of documents a common problem for companies that use a lot of spreadsheets. Having a centralized repository means that all users can share the same version. Additionally, because the calculations can now run on the server, many users don’t even need to have Excel installed! They just need to be able to browse to the SharePoint repository and render the sheet within their browsers. The user who specifies the calculations also becomes the developer of the functionality available to the end users. So, instead of having a developer translate Excel spreadsheets and formulae into a language suitable for Web applications and building a custom UI, your formula experts can simply publish their spreadsheets to Excel and have end users consume them directly.

Print This Post This page as PDF Email This Post MOSS11 / Creating a Solution for SharePoint Server

Wednesday, September 10th, 2008

SharePoint team and Project server team at offshoresoftwaredevelopmentindia.com has great experience of creating web application based on MOSS 2007 and Project server 2007. That includes customization and development of webpart, site definitions, theme development, extension development, module creation. The team has developed CRM application, Job portal, Project management, to CMS applications based on MOSS 2007 and project server 2007.

Team would like to share same experience. This can help who wanted to begin with the sharePoint development and Project Server development.

There are list of articles start with SP and from number 1 to … Always start with the article SP1 and read next article to start working on MOSS easily and quickly.

Creating a Solution:

A solution package is a cabinet (.cab) file with a .wsp file name extension and a manifest file. It can contain the following components:

  • Site definitions
  • Feature definitions and their corresponding element definitions and files
  • Web Part files (*.webpart, *.dwp)
  • Template files and root files, which can include the following:
    1. _layouts files
    2. Resources(*.resx)
    3. Resource files(for example, *.doc or *.xls)
  • Assemblies, which can include the following:
    1. Safe control entries
    2. Resources
  • Code access security policies

Solution files have a hierarchical structure a manifest file is at the root while feature, resource, or site definition directories are contained in subdirectories. In turn, feature definitions define where associated files are located inside of the solution.

The solution creator can define the remaining structure; however, it is recommended that files for a particular feature or site definition be placed in that feature or site definition’s subdirectory.

Note:

The directory structure inside of the .wsp file determines the final directory structure on the front-end Web server file system.

To create a solution package, perform the following steps:

  • Create a solution manifest.xml file.
  • The solution manifest (always called manifest.xml) is stored at the root of a solution file. This file defines the list of features, site definitions, resource files, Web Part files, and assemblies to process. It does not define the file structure if files are included in a solution but not listed in the manifest XML file, they are not processed in any way.

    Following is the structure of a manifest.xml file.

    XML

<Solution SolutionId=”4AFC1350-F354-4439-B941-51377E845F2B” xmlns=”http://schemas.microsoft.com/sharepoint/”>

<FeatureManifests>
<FeatureManifest Location=”FeatureLibrary\feature.xml”/>
</FeatureManifests>
<TemplateFiles>
<TemplateFile Location=”ControlTemplates\Featurelibraryform.ascx”/>
</TemplateFiles>
<RootFiles>
<!– These files go into the 12\ directory and can be used for Web services and global resources –>
<RootFile Location=”ISAPI\MyWebService.asmx”>
</RootFiles>
<Assemblies>
<Assembly DeploymentTarget=”GlobalAssemblyCache”
Location=”ms.samples.sharepoint.myFeature.dll”/>
</Assemblies>

</Solution>

In addition, you can add a DwpFiles element to specify .webpart or .dwp files, or a ResourceFiles element to specify resource files, site definitions, application resources, and code access security policies.

  • Optional. Annotate your feature.xml files with tags.

In the <ElementManifests> tag in your feature.xml file, add <ElementFile Location=”…”/> for all of the extra files in your feature, such as .aspx pages (for example, allitems.aspx) or master pages, and so on.

Note:

This step is required only if your solution contains features.

  • Create your solution package (the .wsp file).

Because the solution file is essentially a .cab file, use the makecab.exe tool to create the solution package. The makecab.exe tool takes a pointer to a .ddf file, which describes the structure of the .cab file. The format of a .ddf file is basically in the same style as the .inf file you declare a standard header and then enumerate, one file per line, the set of files by where they live on disk, separated by where they should live in the .cab file.

Xml

.OPTION EXPLICIT; Generate errors
.Set CabinetNameTemplate=MySolutionFile.wsp
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory
.Set CompressionType=MSZIP;** All files are compressed in cabinet files
.Set UniqueFiles=”ON”
.Set Cabinet=on
.Set DiskDirectory1=Package
build\manifest.xml manifest.xml
build\ MySolutionFile \feature.xml MySolutionFile \feature.xml

Installation Instructions:

Prerequisites:

- Installation package: LHH.PageLayoutsAndLists.wsp

- Flash Player installed on the client to access the site.

From cmd go to: “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin”

  • Adding Solution:

Run this command:
Stsadm.exe -o addsolution -filename C:\Temp\LHH.PageLayoutsAndLists.wsp

  • Deploying Solution:

Run this command
Stsadm.exe -o deploysolution -name LHH.PageLayoutsAndLists.wsp ?local -allowgacdeployment

  • Activating Features:

From LHH Portal Site go to Site Actions >> Site Settings >> Modify All Site Settings

Site Collection Features
Activate:
LHH Content Types
LHH Master Page and Page Layouts

  • Referencing content types:

Go to “Site Actions” >> View All Site Content >> Pages
Click on “Document Library Settings”
Click on Advance Settings >> Allow Manage Content Types (True) >> Ok

Then Go to

Site actions -> Site setting -> modify all settings

Site collection administration -> site collection feature

solution site settings

Then you will see the site collection feature list, active our feature from the list. We will have all the features available.

solution site features

Print This Post This page as PDF Email This Post MOSS10 / Publishing Page Layout using a Feature

Sunday, August 10th, 2008

SharePoint team and Project server team at offshoresoftwaredevelopmentindia.com has great experience of creating web application based on MOSS 2007 and Project server 2007. That includes customization and development of webpart, site definitions, theme development, extension development, module creation. The team has developed CRM application, Job portal, Project management, to CMS applications based on MOSS 2007 and project server 2007.

Team would like to share same experience. This can help who wanted to begin with the sharePoint development and Project Server development.

There are list of articles start with SP and from number 1 to …. Always start with the article SP1 and read next article to start working on MOSS easily and quickly.

Publishing Page Layout using a Feature:

This is the post on creating site columns, publishing content types and page layouts using features:

This post describes how to create a publishing page layout and deploy it using a custom feature. Now that we have a custom publishing site columns as well as custom publishing content types defined using a feature, the next step is to create the page layout.

Publishing page layouts map to the custom fields of a publishing content type. The files are placed in the Master page gallery (Site Actions > Site Settings > Modify All Settings > Galleries section > Master pages and page layouts).

Creating the page layout:

The page layout can be created by using Visual Studio 2005. It’s really an .ASPX page and some basic Intellisense works for the SharePointWebControls and PublishingWebControls.

If you need information on how to create your custom page layout there is a very good article on MSDN:

Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 1 of 3): Understanding Web Content Management and the Default Features.

Important to remember here is that you are dependant from the Master Page that will be used together with your page layout. In this article I’m using the default Blue Bland one; so all the default Content placeholders are available.

Snippet of the page layout (download all the files from the link at the bottom of the post):

Publishing Page layout Usinf Feature

Tip: to quickly create and test a page layout for my custom content types I sometimes use SharePoint Designer 2007 (SDP). Create the page layout by choosing “New > Page Layout” in the Master pages gallery. Be sure to choose your custom page layout:

Publishing New PageLayout

Then open the page using SharePoint Designer. Add your HTML and design elements and drag your custom properties to the page. HTML page design is really not my thing so this is an easy way to add some tables and layout to the page. Once you have the page ready in SPD, save the file, check in and test it by creating a new page.

You can now use the HTML and controls from this page when creating your custom page layout using Visual Studio.

Note that SPD saves the page directly into the SharePoint database and not on the hard drive. So this is just a fast way to start up the creation of your page layout but it does not allow you to deploy the page easily to other servers.

Creating the provisioning xml schema:

To provision the page layout and any used CSS, images or other files we create a XML file that will be picked up by the feature and install the files in the corresponding libraries in your publishing site.

In my example I have one custom page layout with just one image. I could as well have several images and CSS files installed using the same feature. I guess you get the idea with this image sample.

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>

<Module Name=”ProductPageLayouts” Url=”_catalogs/masterpage” Path=”PageLayouts” RootWebOnly=”TRUE”>

<File Url=”ProductDetail.aspx” Type=”GhostableInLibrary”>
<Property Name=”Title” Value=”$Resources:pagelayout_product_name;” />
<Property Name=”MasterPageDescription” Value=”$Resources:pagelayout_product_description;” />
<Property Name=”ContentType” Value=”$Resources:cmscore,contenttype_pagelayout_name;” />
<Property Name=”PublishingPreviewImage” Value=”~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/DefaultPageLayout.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/DefaultPageLayout.png” />
<Property Name=”PublishingAssociatedContentType” Value=”;#$Resources:contenttype_productbase_name;;
#0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB0645
84E219954237AF3900ADB88465BE2C439798977662094183BC;#”/>
</File>

</Module>
<Module Name=”ProductLayoutImages” Url=”Style Library” Path=”Styles” RootWebOnly=”TRUE”>
<File Url=”images/line.jpg” Name=”product/images/line.jpg” Type=”GhostableInLibrary” />
</Module>

</Elements>

(Note: the value for PublishingAssociatedContentType above contains a break for HTML display reasons. You should put the value in one line).

I must say not much is available in the MSDN documentation about the schema for provisioning publishing pages. Like in other cases I looked at the PublishingLayouts feature delivered with the MOSS 2007 installation. This is a hidden feature that provisions the standard page layouts, master pages, etc for a MOSS Publishing site. You can find the feature here: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingLayouts.

Some clarifications to the schema elements:

<Module> element:

<Module Name=”[your module name]” Url=”virtual path destination of the module elements ” Path=”path from within this feature”>

PublishingAssociatedContentType property:

This property specifies to which the page layout you are installing is mapped to. The syntax is
;#ContentTypeName;#ContentTypeID;#

GhostableInLibrary:

Every element has the property Type=”GhostableInLibrary”. This property is important because it will install the file in the Master Page gallery, but the actual file content are still stored on the hard drive and not directly in the SharePoint database (as is the case if you create your page layout using SDP).

Wrapping it up: creating the feature:

I’m using one single feature to create my custom publishing fields, custom publishing content type and custom page layout(s).

The feature now has the following structure:

Three XML files are referenced by the feature schema in the order in which they should be installed.

  • myfields.xml: this file defines all my custom site columns.
  • ProductContentTypes.xml: this file defines my two custom publishing content types and uses the custom field defined in myfields.xml.
  • PageProvisionedFiles.xml: this file contains the provisioning for page layout and associated image.

I think the order in which these files are referenced in the feature schema are important because the site columns must be created before the content types, and the content types must be created before the page layout can reference it.

So, I have no proof that this really executes in the order defined in the feature schema but I do assume it is the case. Maybe someone has found some documentation on this?

Feature schema:

<?xml version=”1.0″ encoding=”utf-8″?>
<Feature Id=”787DCDC4-97F9-4f64-A771-D2A8B86DCADB”
Title=”My publishing content type”
Description=”$Resources:feature_description;”
Version=”1.0.0.0″
Scope=”Site”
DefaultResourceFile=”_Res”
Hidden=”FALSE”
xmlns=”http://schemas.microsoft.com/sharepoint/”>
<ActivationDependencies>
<!– Add a dependency to the Publishing site–>
<ActivationDependency FeatureId=”F6924D36-2FA8-4f0b-B16D-06B7250180FA” />
</ActivationDependencies>
<ElementManifests>
<ElementManifest Location=”myfields.xml”/>
<ElementManifest Location=”ProductContentTypes.xml”/>
<ElementManifest Location=”PageProvisionedFiles.xml”/>
</ElementManifests>
</Feature>

That’s it, the feature is complete.

All that needs to be done is copy the feature directory to “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\MyContentTypeFeature” and run the install command.

stsadm -o installfeature -filename MyContentTypeFeature\feature.xml

This command can be used to install and test the feature. For a production environment I would recommend creating a SharePoint solution that installs the feature and all its files.

Print This Post This page as PDF Email This Post MOSS9 / Creating Publishing Content Types

Thursday, July 10th, 2008

SharePoint team and Project server team at offshoresoftwaredevelopmentindia.com has great experience of creating web application based on MOSS 2007 and Project server 2007. That includes customization and development of webpart, site definitions, theme development, extension development, module creation. The team has developed CRM application, Job portal, Project management, to CMS applications based on MOSS 2007 and project server 2007.

Team would like to share same experience. This can help who wanted to begin with the sharePoint development and Project Server development.

There are list of articles start with SP and from number 1 to …. Always start with the article SP1 and read next article to start working on MOSS easily and quickly.

How to Create Site Columns:

Before going into detail on the creation of content types via features it is important to understand how Content type IDs work.

You should read the following MSDN page that explains about ContenTypes IDs and their inheritance based model: http://msdn2.microsoft.com/en-us/library/aa543822.aspx

Since this post shows how to create Publishing Content Types we need to find from which existing content type we want to base our own. I did some research on the features that are installed and activated when you use the Publishing site. In there we can see that the base content type from which we want to inherit is the “Page”. This Content Type has an ID of:

0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB0
64584E219954237AF39

So in order to create our own ID we can add two hexadecimal values, or, we can add “00″ followed by a GUID. I prefer this approach as it is unique and identifies custom content types more easily.

So my content type ID can be:

0×010100C568DB52D9D0A14D9B2FDCC96666E9F20079481
30EC3DB064584E219954237AF3900ADB88465BE2C439798977662094183BC

The bold text is the Page content type ID to which I append “00″ and a new GUID.

Content Type Schema:

Second important piece of information is the Content Type schema. I could not find any information specific to publishing content types on MSDN or the MOSS SDK. So again the solution is to use the available information together with some nosing in the publishing features installed by MOSS in the 12 hive. ContentType schema on MSDN: http://msdn2.microsoft.com/en-us/library/aa544268.aspx

In the following sample I’m creating two content types: a product content type and a hardware product content type. You will see that the hardware product content type inherits from the product content type by appending 00 + a new GUID to the ID.

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>

<!– Product base content type –>
<ContentType ID=”0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007
948130EC3DB064584E219954237AF3900ADB88465BE2C43979
8977662094183BC” Name=”$Resources:contenttype_productbase_name;” Description=”$Resources:contenttype_productbase_description;” Group=”$Resources:group_productcontenttypes;” Sealed=”FALSE” Version=”0″>
<FieldRefs>
<FieldRef ID=”{F44BFBB0-4725-4167-B976-F85F84131AA3}” Name=”ProductCategory” Required=”FALSE” />
<FieldRef ID=”{EB19D87C-5DEE-4a73-85E0-506293D422D9}” Name=”ProductName” Required=”TRUE” />
<FieldRef ID=”{D73843E5-0D9F-4400-BC75-1A4C2BD27900}” Name=”ProductIntro” Required=”TRUE” />
<FieldRef ID=”{894635F9-1DF8-46f1-BC47-46EFF09FEF3D}” Name=”ProductDescription” Required=”FALSE” />
<FieldRef ID=”{D89C9409-2A97-4a7a-81F5-7D45E7CD8D6B}” Name=”LaunchDate” Required=”TRUE” />
<FieldRef ID=”{6036ECDE-521A-4dbe-94B4-40E0E4EF7029}” Name=”ProductImage” Required=”FALSE” />
<FieldRef ID=”{F31DF817-D220-4449-BD6F-2F1B7C0823ED}” Name=”ProductPrice” Required=”TRUE” />
</FieldRefs>
<DocumentTemplate TargetName=”/_layouts/CreatePage.aspx” />
</ContentType>

<ContentType ID=”0×010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3D
B064584E219954237AF3900ADB88465BE2C439798977662094183BC00B2DE
F3B02D274199BFF43C6D2F129D99″ Name=”$Resources:contenttype_hardwareproduct_name;” Group=”$Resources:group_productcontenttypes;” Sealed=”FALSE” Version=”0″>
<FieldRefs>
<FieldRef ID=”{6A08E31A-0620-45df-BAC1-54A4D0FBFDCE}” Name=”ProductManual” />
</FieldRefs>
<DocumentTemplate TargetName=”/_layouts/CreatePage.aspx” />
</ContentType>

</Elements>

Now we need to add this to the feature and install it together with what was done in part I of this series.

The complete feature can be downloaded here.

Refer:

http://www.katriendg.com/aboutdotnet/2007_4_2_publishing-content-types.aspx