Promote Sharepoint to the Web Application Development Platform

Source: Internet
Author: User

This teched Session I spoke with old hou. In MVP community cabana, there were not many listeners compared to several other sessions of the same type.

Summarize the general content and the demo, calculate a record, and leave something for teched, and make an advertisement for some of our components.

To put it bluntly, the main content on the surface of this session is to construct a data tracking collaborative application platform using WSS. In fact, the SharePoint application is assembled using Custom field types. First, the two restrictions of this application platform are explained first:

1. Data tracking applications are actually called data stream applications. Basically, it is a collaborative application that focuses on data transfer, such as site reservation and book borrowing.

2. collaborative applications, that is, applications completed by a group of people or roles. For example, within a group, department, or enterprise.

Microsoft divides the application platform into the following types by type: Lists (Data Storage built by simple data tables) and tracking application (data tracking type), mini lob application (simple small business system), lob (line of business) Application (enterprise core business system ). Based on the number of applications (horizontal axis) and the complexity of building (vertical axis), Microsoft provides the following figure:

Although data list applications are easy to build, they occupy a large number of applications (such as contacts, notifications, discussions, and simple document sharing lights). Although the core business systems of enterprises are complex, however, the number of applications is relatively small.

Let's take a look at the components of an application and the advantages and disadvantages of SharePoint in these parts:

(1) data structure definition. The list of SharePoint containers is a good container, although its storage capacity is limited, but generally enough to meet some daily applications. In addition, the Sharepoint list, like a data table, has multiple built-in data types, and contains some basic "application field types" for building applications, such as hyperlinks, options, and query items.

(2) view. The List View built in SharePoint provides comprehensive functions, including selection, filtering, sorting, and maximum grouping of Data columns. However, the SharePoint view does not have permissions and it is difficult to control the view of different roles through the view.

(3) form. After the Sharepoint list is created, three corresponding forms are automatically generated: View, create, and edit. However, the style and field style of the form are fixed. Even through SPD, the modifications that can be made are very limited, and it is difficult to meet the diversified needs of users.

(4) permission management. SharePoint supports entry-level permissions after it develops to wssv3. However, field-level permissions are not supported. This is troublesome for applications and it is difficult to control who can see and edit certain fields.

(5) business logic. The Sharepoint list is just a container, and the application logic usually needs to be developed or configured. Fortunately, the toolbar and drop-down menu in the list provide convenient extension features and some custom operations can be added. Event Handlers and workflows can also easily control entries in logic to a certain extent.

As a platform for collaboration, WSS is often used for document management, knowledge management, and simple content sharing (that is, applications corresponding to the lists type ); in addition, most users want Sharepoint to easily complete some complex collaborative applications (that is, the second layer of applications in the figure, which is also the main topic of this session ). However, in use, we will find that although SharePoint provides many convenient features, it is difficult to meet our needs in some key aspects and cannot achieve our goal through built-in function assembly, secondary development is required. The main purpose of this session is to easily and quickly assemble the actual collaborative application platform through some developed custom field type components.

I will not introduce the Custom field type too much. This is a new feature of wssv3, which greatly extends the scope of list development. By using Custom field types, you can fundamentally solve the problem of form diversity, and solve the problem of field-level permission control and business logic assistance to a certain extent.

Some existing custom field types are used to complete some specific functions. Finally, an example of a complete application of Custom field types is provided.

Let's look at a few simple examples:

1. content type icon. The content type is also a new feature of wssv3, allowing us to place different structures and content for the same purpose in a list. Once the content type control is enabled in the list, you can create multiple content types of entries, however, it is difficult for these entries to be intuitively separated from each other in the List View (the built-in method can only be distinguished by displaying the "content type" field. Of course, the document type icon in the document library is an exception). With this custom field type, you can set different icons for different content types (in views and new menus ), make the application look more intuitive and professional. (Currently, this icon can also control the click behavior, such as entering the view page and editing page ).

2. External images. When editing news or inserting images on the WSS, the biggest headache is the separation of image uploading and inserting (if on the moss, you can also use the insert image in the publishing function to pin it ). This field uses a secondary development interface of the FCKeditor to browse and upload images to the image library of the website. (the second picture is the image library of the browsing website, you can also upload a new image from a local image library ).

3. email address. This is very simple. It adds the email format verification on the basis of a single line of text. Although the principles and implementations are very simple, it is very useful.

4. Hide and read-only fields. This is a complicated Custom field. You can perform a complex expression calculation based on the value of a field in the entry and the current user to control whether a field is displayed or editable.

5. Password field. This is not ...... A private key is used for encryption during display, creation, and password editing. You must enter the original password and the new password twice during editing.

Then, through a complete venue booking application, demonstrate how to quickly assemble this collaborative application by customizing the field type:

First, the reservation function of a venue must have a list of venues. A custom list is used to create a venue list, which contains the title, region, hotel, and related information of the venue.

1. In many location-related or Type-related fields, we often want two or more drop-down lists to interact with each other. For example, when "Beijing" is selected, We will list the regions in Beijing; select Tianjin to list the regions of Tianjin. This can be done through a custom field type. The associated parent field and associated content can be flexibly defined:

2. As relevant content, a single site will certainly have multiple related content. This is also a common type of table Association in application building. It is associated by a foreign key. In Sharepoint, the query item works very similar. You can set a query item (foreign key) pointing to the master table in the subtable ). However, this type of query item is sometimes not intuitive. You can only view the table in which the entry belongs in the subtable, and it is difficult to see the related content in the table entry. This function can be achieved through a "reverse lookup item" (or a primary-Sub-Table field) type. You can directly create, modify, and delete related sub-table fields on the Edit page of the master table:

In fact, the related content is saved in another list, and there is a query item pointing to the "Site List. The new and edit pages of the primary table editing page directly use the new and edit pages of the subtables, only a few small changes were made (when the form is opened, the check item is automatically initialized and points to the corresponding primary table entry ).

3. The reserved venue is implemented through another list. You can directly enter this list to create new list entries. However, it is more direct and user-friendly, you can directly book the desired site in the Site List (on both the list page and the entry page, you can directly transfer it to the new page of the site reservation list ):

4. In the site reservation list, a query item is set to point to the Site List to indicate the site to be reserved. However, for some reason, if you want to place the Site List and site reservation list on different websites (for example, the site list is on the resource website and managed by the resource manager in a unified manner; the venue reservation list is on the Conference website), you need to use another custom field to view items across websites. This custom field has the same function as the query item, but the SharePoint built-in query item can only view the list of the same website, and this can be viewed across websites, in addition, you can specify a view for the First Time Filtering (to avoid the difficulty of selecting too many items in the query items ). (In fact, cross-site access is provided in SharePoint items, but not open to the interface ). Its setting interface:

5. All Resource Reservation applications must have a requirement, namely, conflict detection. The general practice is to put the conflict detection in the event handler. If there is a conflict, an exception is thrown, but this is not convenient enough, if you can check for conflicts in real time when entering the venue and time, it is best:

This is a custom field type that challenges imagination and subverts the traditional. According to the usual way of thinking, the list field must be used as a specific data storage. However, this "Time conflict detection" Custom field type does not save any data. It only appears on the new and edit pages and provides an operation.

Now we can see the reservations for these venues. The calendar view makes the display more intuitive:

6. Finally, the Administrator must approve a reservation system. "Well, this place will be yours this time ." /"No, this place should be used for it ." The Administrator's choice is nothing more than these two types. When there are few reservations, the administrator can view each entry in order through the SharePoint approval view for approval. However, once there are multiple entries, the lazy Administrator (lazy is the driving force of world progress, hmm) You want to be able to approve multiple entries at a time. "If I can select multiple boxes like my mailbox, let me select the ones I want to approve, just a little more mouse, that's all done ." So another custom field appeared. It only acts on the presentation layer and does not save any data:

With this custom operation, the administrator can spend more time ...... Cough.

So far, a complete venue reservation function has been assembled. Although it is simple, it basically contains all the steps for a collaborative application of data flow. In addition to the 10 lines of code that were finally compiled to complete multiple approvals during the application assembly process, there were almost no code operations throughout the process, this is achieved by customizing the field type and other webpart configurations. This greatly facilitates the operations of administrators, so it pro has more time for chatting and bumping (this is not me, um, I am not it pro, hey, let's talk about you ......).

Of course, there are some small trick in this application, such as how to change the drop-down menu of the List entry and how to change the toolbar menu. Of course, you can use feature, but none of these menus in this demo are completed through feature. Why? Because feature can only be attached to a list type or content type, it is troublesome ...... So how can we do this? I will introduce it later.

These Custom field types will be released sooner or later, and some simple fields may be free. Please follow the company website: www.servbus.com, or send me an email: duwei@servbus.com. (Advertising behavior hitting a technical blog ......)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.