2008年4月11日

现在,人人都会用MVC的模式,都知道分3个层次来处理系统。分了3个层次,而代码的分界确又是堆砌的,爱堆哪就堆哪,这样和没分层又有什么区别呢?表现上看起来好点罢了。

我看到很多的代码,在aspx.cs页面处理了很多的业务逻辑。在简单的网站,也许你认为没有业务逻辑,所以都可以写在aspx.cs。事实上并非如此。页面的显示视图不一样,也是逻辑。对于输出View的控制所有东西都是逻辑。在业务逻辑层上,很多人喜欢重复调用下数据层的东西,那种重复劳动太值了,多了一层多处理,又没有起到应有的作用。在业务逻辑层还出现GetXXXByUserID之类,就说明你出现了吃力不讨好的事情了。

分层的心态是好的,可没做到份上。事实上,原则应该如下:

表现层,用以处理所有用户输入和数据显示问题;
业务逻辑层,存放所有“业务逻辑”,所有处理,算法等应该放的地方;
数据访问或资源层,存放用于检索、修改或存储数据的所有代码。


简单的说表现层只处理输入和数据显示,当然还包括JS之类的处理。其他一律可以放到逻辑层处理。而数据访问层,说简单就是增删改查四个动作,其他的一律提到逻辑层处理。这样逻辑层的东西就可以具体的根据相同职责来分分合合。这样代码就清晰多了。

哎~,可这个世界就有如字不可教的大量人存在。
posted @ 2008-04-11 10:17 Chatterley 阅读(67) | 评论 (2)编辑

2007年11月6日

大家都知道验证码的作用。验证码是为了防止机器遍历密码而获取帐户的操作权。但如果在客户端来生成验证码,那不等于花瓶吗?这个道理大家都懂,但还是有很多大网站还是这样做。。。。
Sina的Blog生成验证码的代码的Js如下:
function load_chk_img(s) {
  var stamp = new Date().getTime();
  $(s).src = 'http://my.blog.sina.com.cn/myblog/checkwd_image.php?' + stamp;
}

当stamp的值一定时,生成的验证码是相同的。例如:
http://my.blog.sina.com.cn/myblog/checkwd_image.php?10000 对应的7040,只不过显示的7040的形状不同而已。
客户端完全可以修改stamp。从而获取一个Code,根据这个Code来验证。
再用机器去遍历password就OK了,如果密码简单的话,就可以到大流量的vip博客玩一把了,那些vip肯定会大吃一惊。


posted @ 2007-11-06 15:22 Chatterley 阅读(75) | 评论 (1)编辑

2007年10月18日

这两天在公司里玩了会Sea@35,虽然有很多不足,但还是值得自己的人玩一把。特别是几百号人一起上阵的情景。呵呵,满地都是人的感觉就是cool。

有兴趣的人还是值的一玩,毕竟改了些新东西。

posted @ 2007-10-18 23:51 Chatterley 阅读(201) | 评论 (1)编辑

2007年10月11日

今天修改wordpressmu遇到一个关于使用Jquery的bug,在IE下,老显示js有错误。bug显示信息为:Error:expected identifier, string or number。
我于是找到了dashboardswitcher.php里的一段js:
jQuery( function($) {
var switchTime;
var w = false;
var h = $( '#blog-title' )
 .css({
  background: 'transparent url( ../wp-content/mu-plugins/bullet_arrow_down.gif ) no-repeat scroll 100% .2em;',
  padding: '0 25px 2px 5px',
  cursor: 'pointer',
  border: '1px solid #14568a',//这里多了一个","
 })
 .parent().css( { position: 'relative' }).end()
 .append( $('#switchermenu') )
 .hover( function() {
  $(this).css({ border: '1px solid #1a70b4'});
  switchTime = window.setTimeout( function() {
   $('#switchermenu').fadeIn('fast').css( 'top', h ).find('a').width( w = w ? w : $('#switchermenu').width() );
  }, 300 );
 }, function() {
  window.clearTimeout( switchTime );
  $(this).css({ border: '1px solid #14568a' }) ;
  $('#switchermenu').hide();
 })
 .height() - 3;
});

jQuery还真是强大,既然一句话就实现了,包括样式变化,以及switchermenu的显示和隐藏等功能。正为jquery震撼,难怪说jquery改变了js的编码风格。
我在这段代码中找了半天,没有看出什么问题。可能是由于太相信wpmu了,一直只在自己添加的代码里找。外加,没有太在意wpmu中的小细节。而且,它在fireFox下一切都正常。正在无奈的情况下发现了多了一个“,”,呵呵,得意……又找到一个wpmu的bug。原来FF应该可以智能补差,例如<br >它会补充</br>,而对空的变量则会忽略。而IE则没有那么智能,原本期望“,”后有个变量,则自然出现错误。
一个小小的“,”,就可以看出两个browser的智能差距,没用过IE7,不知道它是不是也变智能了。

 

posted @ 2007-10-11 16:59 Chatterley 阅读(93) | 评论 (0)编辑

2007年10月4日

今年国庆可以说是在空虚无聊中度过。原因当然很多,首先是国庆没有回家,如果回家肯定不会这么无聊。不回家的理由也很简单,一个字“懒”。因为家里没有人(父母在外),回去一切都得自理,包括洗衣服、做饭。其次,身边的朋友大都跑其他地方工作了,不是去龙岩,就是回去当公务员,还有的跑三明,福州等等。再次,可能是现在的我没有以前那种激情了,以前一有时间就到处跑,到处玩。而现在,感觉世界不过就那样,没啥意思。最后,女朋友天天上班。
无聊归无聊,无聊总得忙些事情。于是,这几天再次拿起《PofEAA》,看的速度大不如前了,一天就只看那么几页,还好,每次看都有点收获。感觉大师的书些的比较严谨,啥主意和想法都凭证据,啥都是都讲究优劣对比、权衡。从这些就可以看出一个人的水平和书的质量,挑书,自然也要挑选这类的书。个人感觉,这类书对我影响最深。在细看《PofEAA》的同时,还顺便浏览了张询的《软件架构:组织原则与模式》的前面几十页的内容。
张询,给我印象最深的是评《UML三大硬伤》,分析问题有深度,是我比较崇拜的人。因为自己对英文比较感冒,自然而然要看这些人翻译的书,心里比较塌实。看了架构和组织的关系,自然想到自己所在的公司。自己感觉这个方面是公司的重病。个人感觉公司的产品很零散,所有产品可以说是堆积起来,而不是架构起来。一个已有11年的企业,既然每次开发都要从头做起,不得不说是一个悲哀。重复开发,人员流动太大等等许多问题都早早暴露出来。我们作为最底层的员工,只能用眼睛看待一切。
最后,以前一直想学ROR,结果一直没有时间。乘这次大放假的时间,把ROR塔起来。基于MVC架构的Rails,动态语言,内置的Server等,对于开发速度大大提高了。

今天也4号了,希望这次可以把ROR大致轮廓搞清楚,Ruby语法过一遍,有机会虚拟个项目玩一把。。。

posted @ 2007-10-04 20:50 Chatterley 阅读(133) | 评论 (0)编辑

2007年9月30日

今天不小心看到google.cn上有两个地方分别出现,©2007 Google©2006 Google

这应该就是修改了一个地方,而没有应用到所有地方。这种设计缺陷无论是大公司还是小公司,如果设计不好,很容易出现这种问题,给维护带来太多的麻烦了。

有时候设计时,或者Coding时候,为图方便,也会遗留很多这种细节错误。所以一个人的认真态度才是软件开发重要之处
posted @ 2007-09-30 08:59 Chatterley 阅读(138) | 评论 (1)编辑

2007年9月27日

可以参考源代码的哦
地址:
http://www.microsoft.com/resources/sharedsource/Licensing/WindowsAcademic.mspx
posted @ 2007-09-27 10:01 Chatterley 阅读(166) | 评论 (0)编辑

2007年9月20日

OpenID注册地址http://openid.35.com

OpenID优势:
1、有了OpenID,你可以拿OpenID登陆所有支持OpenID登录的网站。这些支持OpenID登陆的网站对你的密码一无所知,保证了你的密码安全。你再也不用记多了username和password。
2、OpenID可以设置委托,可以把自己的域名作为OpenID。例如我把http://www.xmpoint.com注册openid委托,则可以利用http://www.xmpoint.com来登陆所有支持OpenID登录的网站。
3、OpenID可以注册N份个人资料,用于你登录的各个网站的personal profile。

OpenID劣势:
1、你登录的时候,你必须跳转到OpenIDServer去验证你的身份。这是必须的,要不支持OpenID的网站怎么知道你是不是冒牌的。


以后在网络上,域名就是你身份的表示,就象你现在的身份证一样。不同的是自己的身份证不能由自己来定,而OpenID的帐号你可以爱取啥就取啥(前提是你能注册到)。到那个时候,好的域名就更值钱了。

posted @ 2007-09-20 19:44 Chatterley 阅读(213) | 评论 (0)编辑

2007年9月6日

2007年8月3日







Other Products@35
posted @ 2007-08-03 16:42 Chatterley 阅读(137) | 评论 (0)编辑

2007年7月27日

问题前提:mysql版本>=4.1

1、修改mysql目录下的my.ini
#default-character-set=latin1
default-character-set=utf8
2、修改wp-includes/wp-db.php
在对象wpdb中添加函数set_charset($charset):
class wpdb{

 function set_charset($charset)
 {
  // check mysql version first.
  $serverVersion = mysql_get_server_info($this->dbh);
  $version = explode('.', $serverVersion);
  if ($version[0] < 4) return;
  // check if utf8 support was compiled in
  $result = mysql_query("SHOW CHARACTER SET like 'utf8'", $this->dbh);
  if (mysql_num_rows($result) <= 0)
   return;
  if ($charset == 'utf-8' || $charset == 'UTF-8')
   $charset = 'utf8';
  @mysql_query("SET NAMES '$charset'", $this->dbh);
 }
}

3、并修改wordpressmu根目录下的wp-settings.php:
require (ABSPATH . WPINC . '/vars.php');

$wpdb->set_charset(get_bloginfo('charset')); // add at this

4、重新创建wordpressmu的数据库(重新安装wordpressmu)。

posted @ 2007-07-27 12:43 Chatterley 阅读(208) | 评论 (0)编辑

2007年7月13日


下载地址:ZendFramework-1.0.0.zip
              ZendFramework-1.0.0.tar.gz
posted @ 2007-07-13 16:33 Chatterley 阅读(98) | 评论 (0)编辑
 
一篇很好介绍如何如何利用VC来扩展php。

地址:http://www.phpe.net/articles/410.shtml
posted @ 2007-07-13 16:11 Chatterley 阅读(61) | 评论 (0)编辑

2007年7月9日

 microformats原来还有此等威力,当然还是Xml,XPath的好用之处。
什么是microformats,在microformats.org上这样描述:Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards.

microformats网站:http://microformats.org
一篇很好的文章:使用 microformats 分离数据与格式

posted @ 2007-07-09 10:14 Chatterley 阅读(66) | 评论 (0)编辑

2007年6月26日

1 Deploying Windows SharePoint Services and Custom Components
Configure a target computer for Windows SharePoint Services development.
Create Windows SharePoint Services service accounts.
Configure database rights for Windows SharePoint Services service accounts.
DbCreator
SecurityAdministrator
Configure machine rights.
IIS_WPG
STS_WPG
Enable forms authentication on the IIS virtual server.
Deploy a Web Part to the Windows SharePoint Services server.
Register an assembly as a safe control in the Web.config file.
Configure Web Part permissions.
Enable a Web Part to access resources by creating a custom security policy.
Create and deploy a Windows SharePoint Services solution package.
Deploy a site definition to a Windows SharePoint Services front-end Web server.
2 Deploy a site definition manually by copying appropriate files and folders to the server and resetting IIS.
Deploy a feature to a Windows SharePoint Services front-end Web server
Deploy a feature manually by copying appropriate files and folders to the server and resetting IIS
Install and activate a feature by using STSADM.
Deploy a Web service to a Windows SharePoint Services front-end Web server.
Deploy a Web service so that it is available within the context of any Windows SharePoint Services site.
Deploy a Web service external to the Windows SharePoint Services context.
Deploy user controls to a Windows SharePoint Services front-end Web server.
Deploy a user control so that it can be used by any Windows SharePoint Services component. 2 Creating Site and Feature Provisioning Components
Create a feature definition
Specify a feature that depends on another feature to activate
Specify an Event Receiver to handle events for a feature
Localize a feature using a resource file
Create an action to add an option to the site settings menu
Add a new master page when a feature is activated
Cache the master page in a document library
Create a site definition
Define the top and side navigation areas for a site
Specify a list definition to use in a site
Hide a list definition from the Create Page
Specify a Document Template in a site definition
Specify a file for use in a Document Template
Create a site definition module
Specify a file to be cached in memory on the front-end server
Add a UI element to the beginning of the top navigation area in a module
Force a Feature to install when a site is created by using the site definition
Specify the configurations of lists and modules in a site definition
Create multiple configurations for a single site definition
Specify that the site created will only exist as the root Web site in a collection
Create pages and layouts for a site
Create a custom Page Layout that has multiple Web part zones
Customize the fields that are displayed on the mobile view of a Windows SharePoint Services page
Modify the page layout for a site using master pages
3 Creating Metadata and Workflow Provisioning Components
Create a site column
Specify a site column in a site definition in a Feature
Add a column to a Provisioned Site by using the API
Create a list definition
Prevent a list from being created on a site by hiding it on the list Create Page
Add a new view to a list definition
Specify a view that shows all files and all subfolders of all folders
Create a Custom Field Type
Define the Custom Field Type to be displayed for inclusion in lists and document libraries
Display the Custom Field Type differently for a new item form and an edit form
Create a Workflow definition
Attach a workflow to a list on creation
Collect default values for a workflow
Package a workflow in a feature
Create a Content Type
Add multiple Content Types to a single list
Apply a Content Type to multiple file types
Inherit properties from one Content Type to another
Update an existing content type
4 Developing Windows SharePoint Services Components by Using the .NET Framework
Implement a business process by using a workflow.
Create a basic workflow by using the SharePoint Designer.
Call custom services from workflow by using Visual Studio 2005
Handle Windows SharePoint Services events by developing an event receiver.
Handle a list event.
Cancel an operation.
Handle a feature event.
Develop a Web Part.
Upgrade a Web Part from Windows SharePoint Services-version 2 to version 3.
Handle postback data by using the control life cycle.
Troubleshoot a Web Part failure.
Handle exceptions within a Web Part.
Convert a user control into a Web Part.
Implement caching by using the Windows SharePoint Services cache.
Create a personalized Web Part property.
Create a shared Web Part property.
Create a Web Part that uses Windows SharePoint Services cascading style sheet (CSS) styles.
Enhance the Web Part configuration UI by using a custom tool part.
Share data between Web Parts.
Create a Web Part that is a data provider.
Create a Web Part that is a data consumer.
Filter information from one Web Part to another.
Elevate application permissions by using impersonation.
Enable a custom Windows SharePoint Services administration page to access the Windows SharePoint Services object model.
Schedule tasks by using the SharePoint Timer service.
Create a job by using the SPJobDefinition class.
Submit a job to the SharePoint Timer service.
5 Manipulating Site Content by using the API
Manage an alert.
Create an alert for a user.
Remove an alert from a user.
Change the frequency of alerts.
Enhance the Windows SharePoint Services search service.
Create a custom SPQuery object.
Perform a cross-site search.
Customize user access and permissions.
Add a user to a site group.
Remove a user from a site group.
Change a user's permissions to edit a list.
Manipulate items in lists.
Create a list item.
Update a list item.
Delete a list item.
Enumerate list items.
Add a photo to a picture library.
Add a recurring event to a calendar.
Delete a thread in a discussion board.
Manipulate documents in lists.
Upload a document.
Copy a document between document libraries.
Attach a document to a list item.
Move a document across sites.
Manage records by using the records repository.
Enable the records repository for the Send to menu.
Submit a file to the records repository.
Manipulate source data by using record properties.
Retrieve a series on a file from the records repository.
Manage document versions.
Check out a document.
Check in a document.
Rollback a document version.
Display all versions of a document.
 6 Manipulating Site Configuration by Using the API
Manipulate a list structure.
Dynamically add a custom action to a list.
Create a list object and add a column to the list object.
Create a custom view for a list.
Create a dynamic column type on a list.
Create a document template and assign it to a document library.
Customize Web Part behavior based on feature availability.
Dynamically handle events.
Dynamically register an event receiver for a site event.
Dynamically register an event receiver for a list event.
Dynamically register an event receiver for a feature event.
Manage site hierarchy.
List the IIS virtual servers on a Windows SharePoint Services server farm.
List the sites available to the current user.
Create a site.
Customize navigation in a Windows SharePoint Services site.
Add an item to the QuickLaunch menu.
Modify an item on the top navigation menu.
Manage groups and groups membership.
Create a custom site group and set permissions for the group.
Add a cross-site group to a site group on different site.
posted @ 2007-06-26 14:07 Chatterley 阅读(640) | 评论 (0)编辑

2007年5月21日

下面是获奖名单:

Books (General):Agile Software Development: The Cooperative Game, Alistair Cockburn

Books (Technical):Head First Object-Oriented Analysis and Design, B.McLaughlin, G.Pollice and D.West

Change and Configuration Management(变更及配置管理):AccuRev 4.5

Collaboration Tools(协作工具):Confuluence

Database Engines and Data Tools(数据库引擎及数据工具):Visual Studio 2005 Team Edition for Database Professionals

Design and Modeling(设计及建模):stpBA Storyboarding for Microsoft Visual Studio 2005 Team System

Development Environments(开发环境):NetBeans IDE

Enterprise Tools(企业工具):Cape Clear ESB Platform

Libraries, Frameworks and Components(库、框架及组件):NetAdvantage for .NET

Mobile Development(移动开发):Carbide .c++ Professional Edition

Project Management Tools(项目管理工具):Rally Enterprise

Security(安全):AppScan

Automated Testing Tools(自动测试工具):AgitarOne

Bug and Defect Tracking Tools(缺陷跟踪工具):TestTrack Studio

Utilities(杂类应用):VMWare Lab Manager

Web Development(Web开发):Adobe Flex 2

Websites/Developer Networks(网站/开发者网络):SUN Developer Network

原文地址:http://www.matrix.org.cn/resource/news/Jolt_92f5060e-d8d0-11db-9bed-29012b8c745e.html
posted @ 2007-05-21 23:56 Chatterley 阅读(84) | 评论 (0)编辑

2007年4月4日

我经历了开发商业系统和产品两种开发形式,在我个人里,发现了些自己感觉极其不舒服的东西。
商业系统开发,简单一句话,就是客户和开发人员的需求的一个平衡。客户希望得到的系统是功能越强大,各个方面都达到自己的200%的满意,而开发人员则站在自己的角度尽量舍去不必要的功能,为了是自己能有更大的利润。往往花大量的时间去取的平衡,而忽略了系统的一些东西,最后开发出来的系统往往都不尽人意。在中国国情里,我只要能交出东西,就万事OK了。有时候即使能在很短时间内完成的功能,非得磨上几天。在开发上,尽量减少“不必要”的东西,例如文档和注释等等。这些就导致了一些IT的特有现状。一个词“悲哀”来形容。
产品开发,则是要实现一个真正的商品。公司自己要拿这些产品来卖钱。因为是公司自己的角度,不存在和客户之间的矛盾,自然而然会去避免上面的一些问题,然而另一方面的问题就暴露出来了。在开发产品时,产品经理自然要把产品描述的很清楚,需求,设计都要做的很全面(过度),从而导致了文案化。公司花费在这些东西的成本过于庞大。如果产品好买的好,也就OK了,否则,就只能面临资金紧张,倒闭等问题。然而,开发人员毕竟是拿工资的,自然就会去消极怠工,希望这个产品能开发久些。原本可以在半年开发完成的,在开发人员手上非得磨个8-9个月。如果外加管理不好,往往产品组(程序管理组)和开发部协调不好,又会导致产品畸形。

从上面的问题,这些问题都或多或少的存在。对于开发商业系统,如果能有具有开发技能的客户参与到商业系统的开发,那么可以缓解一些问题。而开发产品,如果能把产品流水线化,那么我想也可以或多或少地解决一些问题。当然也可以把产品利益相关话,产品开发买钱如果关系到产品开发里的每个人,产品开发就不会象现在这样了。

一句话,感觉开发那么久,开发还是没有采用敏捷思想来解决一些问题。国内的开发还是处于国外十几年前的状况,或者更远。。。。在这种开发体制下,无论哪个人开发,无论是管理和开发人员,都不会感到舒服。。

posted @ 2007-04-04 21:17 Chatterley 阅读(87) | 评论 (1)编辑

2007年4月3日

一切都来晚了,想哭,但已经没有眼泪。
posted @ 2007-04-03 23:04 Chatterley 阅读(88) | 评论 (0)编辑
 
Show一下利用Asp.net Ajax做的项目


posted @ 2007-04-03 14:58 Chatterley 阅读(270) | 评论 (0)编辑

2007年4月2日

2007年3月22日

好久没有来这里写点东西了,怪想念这里的。

现在还有很多人来加我的QQ,想问我SP的问题。可人在江湖,身不由己。我不在过多关注SP,不过有空还是会看看SDK(english version)。为了生存,我换了份工作。而现在的这份工作,由于保密性比较高些,几乎都与外界失去了联系,所以很多人都以为我消失了。现在的我不上MSN了,QQ也很少上了。上QQ的唯一目的,是看谁给我留言了。看完留言,我就下QQ了。望兄弟姐妹们见谅。

现在来说说,我这三个月来都在干什么吧。我最近在做一个关于Asp.net Ajax的项目。项目可以订阅RSS,可以对自己喜欢的东西进行整合到自己的Space里面。其界面效果很象winform。我从不会Javascript,到现在几乎掌握了JS,能完成JS能实现的一些东西,当然前提是离不开资料。感觉在把弄JS的唯一难度是如何去跨平台,我们的程序必须在IE和fireFox下运行。我也深深的理解了IE的“笨”,也因为这个项目喜欢上了fireFox。现在,项目的第一迭代开发几乎完成了,可以歇一口气了。我也终于知道了原来webform也可以达到winform的效果。我参与开发的Hannover2.0项目,界面看起来还是挺绚的哦。(有机会让大家也瞧瞧,但这个机会几乎很渺茫)

以后有机会,我还会重新回到网络世界,好久没有看资料了。Microsoft的技术不知道又发展到什么地步了。goooo了一下,感觉现在大家都在研究Vista了,看来以后也要多去学学Vista了。(kunnnn了,sleep去)
posted @ 2007-03-22 00:25 Chatterley 阅读(80) | 评论 (1)编辑

2007年3月11日

日期 比赛 地点
2007年3月18日 F1澳大利亚大奖赛  澳大利亚
2007年4月8日 F1马来西亚大奖赛  马来西亚
2007年4月15日 F1巴林大奖赛  巴林
2007年5月13日  F1西班牙大奖赛 西班牙
2007年5月27日 F1摩纳哥大奖赛 摩纳哥
2007年6月10日  F1加拿大大奖赛 加拿大
2007年6月17日 F1美国大奖赛 美国
2007年7月1日 F1法国大奖赛  法国
2007年7月8日 F1英国大奖赛  英国
2007年7月22日 F1德国大奖赛  德国
2007年8月5日 F1匈牙利大奖赛 匈牙利
2007年8月26日 F1土耳其大奖赛 土耳其
2007年9月9日 F1意大利大奖赛  意大利
2007年9月16日  F1比利时大奖赛  比利时
2007年9月30日 F1中国大奖赛  中国
2007年10月7日 F1日本大奖赛  日本
2007年10月21日 F1巴西大奖赛 巴西
posted @ 2007-03-11 00:58 Chatterley 阅读(390) | 评论 (0)编辑

2006年12月5日

出处:http://msmvps.com/blogs/omar/archive/2006/11/09/How-to-become-a-really-experienced-developer-overnight.aspx
作者:Omar AL Zabir
How to become a really experienced developer overnight


I get a lot of request from a lot of people who see my works and get inspired and ask me how can they do the same? The questions I generally get are following:

  • How can I become a developer like you?
  • How can I develop projects like you did?
  • What do I need to learn in C# to become like you?
  • Does Microsoft Certifications help? Should I go for the exams?
  • What did you do to become MVP? I want to become MVP too.
  • I am 23 (or 24) and I want to become like you. What do I need to do?

Generally the questions are like this. Everyone asks me for a "shortcut" way to becoming a really good developer. So, here's the magical secret for becoming a really good developer and achieve everything I have achieved:

Work 18 hours per day, 7 days a week, 360 days a year for 13 years.

Yes! That's the secret. It's pretty easy. The only thing you need to do is "work" and do nothing else and you will achieve everything that I have achieved. Pretty easy. I did that, so you can do it too! Piece of cake.

If you want to go for the "long" way then here're the things you can try:

  • Take part in open source projects or make several yourselve. This is the best way to learn really useful things.
  • If you can, try setting up your own company. I have setup 3 companies so far. 2 were not that succesful, 1 is very successful. It helped me learn so many things that I would have never learnt by working in other's companies as an employee.
  • Read articles everyday. There are thousands of articles to read from www.codeproject.com and msdn.microsoft.com. I still read almost all the articles that get published in codeproject every week. If you read 10 articles per week and do it for a year weeks, you have the knowledge of 480 articles! Who can beat you then?
  • Not only read articles, but try out the attached source codes. Make similar projects yourselves and use the ideas presented in the articles in your own project. I spend everyday at least 1 hour in trying out new technologies. This not only increases my knowledge but also makes me more experienced in doing things better and helps me do my office work better and faster.
  • Get into companies which gives you exciting projects to work on and you get to do something in everything. For example, join a company which gives you the freedom to design your modules, develop it, test it, document it etc. The idea is to gain experience from all stages of development. Make sure the company has enough bright stars to learn from. If you just become another cow in a big dairy farm, no benefit.
  • Don't leave a company if you are underpaid but you do a lot for the company. Have patience. Build yourself up and you will one day get what you deserve. I used to get $250 per month in my first company which used to do outsourced projects for a really big company in US. I worked day and night in that company and worked in 8 projects in 7 years. I did not leave the company only because of the technologies I could learn and apply and the variety of things I could do there. Best of all, I could work on many outsourced projects myself from various countries which exposed me to a wide variety of technologies. So, when I left the company and joined another one, with the vast experience I had gathered from my previous underpaid company, my salary became $200/day in the new company. See the difference. If I had left earlier seeking higher salary instead of technologies, I would not have learned all the cool things and I would not become so expensive as I am now. 
  • This is very important for those who cost $200/day now. Don't change yourself once you start earning this much. Be the same person as you were when you used to get $200/month. Remember, it was the attitude and the burning desire to learn and grow that made you become what you are now. If the burning sun inside you becomes a dying candle, you lose.
  • Don't start your career in a company where you are given nice specs to read on, you have lead developers to decide all input/output/pseudocodes, you have a solid QA team to test your work, you have managers and administrators to take care of every management and administrative issues etc. In such a company, the only thing you become is a "smart typist". You basically translate English to C#. The right side of your brain does not develop at all. Start your career with small companies which deal with lots of challenges and you get the chance to burn your brain and fingers out. The sweet smell of your roasted brain is far better than the sweet scent of your polished cubicle inside a decorated corporate office.
  • I have seen the following evolutionary cycle of developers and see where you fit in:
    • Beginner: Does not wear shoes, comes to office on sandles. Looks very sober. Shirt is outside pant.  When you ask them, do you know .NET events and delegates? They say, "uh, ummm, no I don't think so. Is it birthday events?"
    • Beginner+: Gives you "I know it all" look whenever you talk about programming. Wears shiny shoes, full sleve shirt is nicely put inside dockers pants. Back brushed hair wtih "Set Wet" gel and always on $300 sunglasses. When you ask them, "do you know .NET events and delegates?" They say, "Events and delegates are coooool man! You can do anything with them and mark my word man, "anything". I haved used them in sooooo many projects. Did you just learn about .NET events and delegates?"
    • Intermediate: Clothing turns a bit pale. Sunglass is old-school. No hair gel. Anytime you speak about some terms like EJB, Spring, Design Patterns, their eyes sparkle like the brightest star in the November sky. They start doing a lot of off-the-record work inside office. They start going to online groups, start working with friends on open source projects, start reading MSDN Magazines etc. If you ask them, "Can you make it?" They always reply, "Sure, you will get it tomorrow." But usually you get it after a month.
    • Intermediate+: Generally you get it within 1 or 2 weeks overdue schedule.
    • Advanced: They wear the same "I am a Geek" or "Microsoft Windows XP" logo T-shirts everyday (until it stinks and you can smell it as soon as they enter the office) and shiny sports shoes. They start talking about software development processes, RUP, Extreme Programming, Agile Development etc. If you ask them to do something, they reply "Give me a functional specification, a technical specification, test plans, milestones, release plans, mockups and N number of developers and I will get it done."
    • Very advanced: Does not wear shoes, comes to office on sandles. Looks very sober. Shirt is outside pant.  When you ask them, do you know .NET events and delegates? They say, "They seem to suffer from bi-directional strong reference problem which prevents garbage collectors from collecting the listener properly and the only way to release the reference is to bring down the app domain"
  • Do take Microsoft Certifications without cheating. You will learn a lot.
  • Write articles & blogs. Share everything you learn. Someone out there will benefit from it someday. Don't hesitate thinking that you don't know much to write about.
posted @ 2006-12-05 23:08 Chatterley 阅读(363) | 评论 (0)编辑

2006年11月29日

好久没来这里了,自从Microlink出来。
现在的公司不能上网,刚搬了次家。网线要下个月才能接上。。。。。
希望博客朋友见谅。

由于公司的技术需要,最近在学AJAX,所以以后可能暂时不把精力放在SP上了。
所以比较新的一些东西,我并没有去研究,去发掘。所以你遇到的问题我未必能解决。



posted @ 2006-11-29 21:55 Chatterley 阅读(59) | 评论 (2)编辑

2006年11月8日

今天,选择离开了Microlink。
从去年的十月份走过来,公司经历了2次转型。
总结在这一年里的收获:
在技术上
1、学会了SharePoint
2、更了解了Asp.net(无论是1.0,还是2.0)。
3、真正体会了软件过程体系。
4、知道了CM如何工作。
5、体会了敏捷开发。
6、知道了如何进行团队协作。
在商业上
1、看到了一个公司是如何成长的
2、知道了影响公司的一些重要的因素的微妙关系,包括业务,资金,资源,管理。

路才真正开始……

posted @ 2006-11-08 18:01 Chatterley 阅读(40) | 评论 (0)编辑

2006年10月26日

原本打算把SPSiteManager用于MOSS2007,结果好象不行。于是把SPSiteManager修改了一下。
主要修改两处:
1、Analys.cs中的查询语句,SPS2003的ContentDatabase中的sites表有Fullurl字段,而现在变为了PortalURL。
2、它原本的程序把spsitemanager_syntax.xml嵌入到程序集中,现在单独取出,只要相同目录就可以工作。这样,还可以通过它来查询命令参数。

其分析功能强大,从Virtual Server开始到SiteCollections、Site、Web、DocLib、Folder、List等。
它有点类似stsadm工具。
具体操作例如:spsitemanager -o analyze -url http://vsts01:8000/ -targeturl http://vsts01:8000/ -sdd vsts01_allvs_level_0_sdd.xml
具体的命令参数可以参考附件中的spsitemanager_syntax.xml文件。

SPSiteManager.rar

详细功能及源码请参考其官方blog:krichie

运行要求:机器必须安装了MOSS2007。

posted @ 2006-10-26 18:18 Chatterley 阅读(225) | 评论 (0)编辑
 
     摘要: 一个网站定义定义了一个种类型的SharePoint网站。安装了MOSS2007后,会在本地的目录C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates中放置各种网站定义模板。STS定义了Team Site(工作组站点),Blank Site(空站点), 以及 Doc... 阅读全文
posted @ 2006-10-26 10:43 Chatterley 阅读(1748) | 评论 (2)编辑

2006年10月21日

条款一
原话:当你需要考虑 不指向任何对象 的可能性时,或是考虑 在不同时间指向不同对象 的能力时,你就应该采用pointer。前一种情况你可以将 pointer设置为null,后一种情况你可以改变pointer所指对象。而当你确定 总是会代表某个对象,而且 一旦代表了该对象就不再能够改变,那么你应该选择reference。

考虑四种情况:
1、pointer:声明object*
2、const_pointer:声明const objcect*
3、reference:声明object&
4、const_reference:声明const objcet&

pointer,可以指向object对象,也可以指向从object继承的对象,只要是前面的对象都可以指向。
const_point,可以指向固定对象,一但指向了某个对象,它就不能够指向其他对象了,当然对象里面的变化,它不关心。reference和const_reference也是同样的道理。

很多人会问,那么pointer和reference有什么区别呢?
或许看起来没有什么区别,你就这么想吧,pointer到对象,是指向对象。而reference就是对象。这时候又有人问那么reference和直接声明的对象又有什么区别呢?看看下面的用法:
C#的程序员可能有以下幻想
object&  ro = new objcet ;//VC7.1下声明int& iValue=5;静态编译出现Error。
object  o = new object;
但事实上用法应该是这样的,因为在C++里的只能把new的对象给指针,例如object* po=new object。
object  o;
object&  ro = o;//
这个时候,他们没有什么区别,只不过是名字不同而已,一个为o,另一个为ro,这时候那个对象有两个名字。

这时候可能又会想那么const_refencence又是怎么回事啊,那就是它所指代的对象不能变化(和const_pointer的区别),即对象状态为const。
其实原本想划几个图来表示,那就可以更加直观了。可这个机子没工具,以后再补拉。





posted @ 2006-10-21 13:10 Chatterley 阅读(117) | 评论 (1)编辑

2006年10月20日

Google Web APIs service:Google提供给外界定制自己的服务。
首先,你必须得先到http://www.google.com/apis/去注册一个Account,并获取一个License Key。
其次,创建各种类型项目,进行web引用,其地址:http://api.google.com/GoogleSearch.wsdl
再次,编写你要定制的代码。
最后,显示的结果:

唯一可惜的是,一个帐户一天只能访问1000次。
源码:GoogleSearch.rar

posted @ 2006-10-20 16:15 Chatterley 阅读(174) | 评论 (0)编辑

2006年10月18日

好久没有看C++,最近又拿起买了几年的B.S的那本TCPL。我又提起了对C++的兴趣。然而,学习Boost库是学习C++领域里是不可缺少的步骤,至少我是这么认为的。所以我就Download了其1.33.1版本,发现安装有各种方法,但是对与VS2003,用下面的方法是比较便捷的,特别是对于要设置环境变量的那些方法。
下面是我安装Boost1.33.1库的过程:
首先安装VS2003和下载Boost1.33.1库我在这里就不多说了。那就开始按下面步骤执行:
1、打开控制台窗口,请使用vs2003在开始菜单中的“Visual Studio.net工具->Visual Studio.net  2003 命令提示”打开控制台,这样VC.net的的编译环境就设置好了。

2、假设boost安装包的解压的目录为{BOOSTDIR}中。
我的路径{BOOSTDIR}为C:\C++\Library\Boost_1_33_1
先编译出bjam.exe,它被用于安装boost库
cd {BOOSTDIR}\tools\build\jam_src
即:cd  C:\C++\Library\Boost_1_33_1\tools\build\jam_src
输入build.bat

3、利用编译出的bjam.exe程序编译并安装boost库
cd {BOOSTDIR}
即:cd  C:\C++\Library\Boost_1_33_1
用FileExplorer浏览到{BOOST_SRC}\tools\build\jam_src\bin.ntx86\bjam.exe(即:C:\......\bjam.exe)
用Ctrl+C 把路径Copy下来,也就是把C:\C++\Library\Boost_1_33_1\tools\build\jam_src\bin.ntx86\bjam.exe

4、输入C:\C++\Library\Boost_1_33_1\tools\build\jam_src\bin.ntx86\bjam "-sVC71_ROOT=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7" "-sTOOLS=vc-7_1"  "-sPYTHON_ROOT=D:\Program Files\Python24" "--prefix=C:\C++\librarys\boost" install

下面的命令的各选项的说明:
prefix    将boost安装到的路径(生成的头文件和库文件都会放到该路径中)。
重定义以下变量(利用-s设置,即Set):
VC71_ROOT  vc2003的安装路径,如果未将vc2003安装到默认位置,你必须指定该项。
TOOLS         使用的编译工具,vc2003对应的是vc-7_1(可以查看{BOOSTDIR}tools\build\v1下看是否有其对应文件,也就是在vc-7_1后多一个-tools.jam的文件(例如vc-7_1-tools.jam)。
PYTHON_ROOT        python的安装目录,如果未将BOOST安装到默认位置,你必须指定该项。
BUILD         编译结果选项,默认会生成尽可能多的版本,如调试版/发行版,静态库/动态库,单线程/多线程。
posted @ 2006-10-18 15:14 Chatterley 阅读(909) | 评论 (1)编辑

2006年10月16日

今天在用Microsoft.Web.UI.WebControls.TreeView中发现了这个bug。
递归过程是加载目录树,用递归的方法一层层加载目录。
我创建一个DataTable来递归:

using System;
using Microsoft.Web.UI.WebControls;
using System.Data;

namespace TestWeb
{
    
/// <summary>
    
/// Chapters 的摘要说明。
    
/// </summary>

    public class Chapters
    
{
        
private DataTable m_chapters;
        
        
public Chapters()
        
{
            
//
            
// TODO: 在此处添加构造函数逻辑
            
//
            m_chapters = LoadData();
        }


        
public DataTable LoadData()
        
{
            DataTable dt 
= new DataTable();
            dt.Columns.Add(
new DataColumn("ChapterID",typeof(System.Int32)));
            dt.Columns.Add(
new DataColumn("ChapterName",typeof(System.String)));
            dt.Columns.Add(
new DataColumn("ParentChapter",typeof(System.Int32)));

            DataRow dr 
= dt.NewRow();
            dr[
"ChapterID"= "1";
            dr[
"ChapterName"= "root";
            dr[
"ParentChapter"= "0";
            dt.Rows.Add(dr);

            dr 
= dt.NewRow();
            dr[
"ChapterID"= "2";
            dr[
"ChapterName"= "chapter1";
            dr[
"ParentChapter"= "1";
            dt.Rows.Add(dr);

            dr 
= dt.NewRow();
            dr[
"ChapterID"= "3";
            dr[
"ChapterName"= "chapter2";
            dr[
"ParentChapter"= "1";
            dt.Rows.Add(dr);
            
            
return dt;
        }


        
/// <summary>
        
/// 获取目录结构
        
/// </summary>
        
/// <param name="nodes">TreeView的节点集</param>

        public void InitTree(TreeNodeCollection nodes)
        
{
            
//获取根结点ID            
            int rootChapterID = 1;            
            
//获取根接点数据            
            TreeNode rootNode = new TreeNode();
            rootNode.Text 
= "Root";
            rootNode.ID 
= "1";
            nodes.Add(rootNode);

            InitTree(nodes[
0].Nodes,rootChapterID);
        }

        
/// <summary>
        
/// 获取目录结构
        
/// </summary>        
        
/// <param name="nodes">TreeView的节点集</param>
        
/// <param name="parentNodeId">相对父节点Id</param>

        private void InitTree(TreeNodeCollection nodes,int parentNodeId)
        
{            
            DataView dvTree 
= m_chapters.DefaultView;       
            dvTree.RowFilter 
= "ParentChapter = " + parentNodeId;
            
if(dvTree.Count==0)
                
return;
            TreeNode tnChild;            
            
for (int i = 0; i < dvTree.Count; i++
            
{
                DataRowView drv 
= dvTree[i];
                tnChild 
= new TreeNode();
                tnChild.Text 
= drv["ChapterName"].ToString();
                tnChild.ID 
= drv["ChapterID"].ToString();                
                nodes.Add(tnChild);
                
int iParentId = Convert.ToInt32(drv["ChapterID"]);                                
                InitTree(nodes[i].Nodes, iParentId);
            }

        }

    }

}


我跟踪调试发现如下过程:
1、首先加载parentNodeID=1的所有结点,包括2个结点,其ChapterID分别为2,3。

2、可见事实上也是Count=2,如下图

3、递归第一次parentNodeID=2。

4、验证parentNodeID=2,也正确。

5、当第一次递归完成了,按道理要递归下一个parentNodeID=3了。

6、这时候确实也回到了上一级,也就是parentNodeId=1的时候。这里i的值是还没有++,++后i为1。

7、这时候bug出现了,dvTree.Count应该和第2步一样为2,可这里怎么就成了0了呢?
我猜,在实现编译器的时候,应该把dvTree保存为临时的DataView,这里把递归第一次的dvTree拿来用了。每一次递归都必须保存前一级别的DataView。事实上,却没有,DataView被丢了。上一级别的DataView和自身一级别的DataView原本就是不同的。
 

附上代码: TestWeb.rar
posted @ 2006-10-16 22:18 Chatterley 阅读(424) | 评论 (3)编辑

2006年10月13日

今天看了《深入浅出设计模式》的第一章
这篇文章读起来很轻松,而且也比较容易接受。它不象以前谈论的设计模式,感觉全是文字和代码。从头到尾看起来要晕个n回。我读的过程中往往会只看第一章,就不想再看后面的内容……
《深入浅出设计模式》这本书,它的风格很象我们在处理实际问题上的讨论形式,层层引入来解释问题,没有深入,但确实达到了浅出的效果。在第一章里,一开始并不介绍设计模式,到最后才引出策略模式。总有一点“哦,策略模式原来是这样”,对于初学设计模式的人,大有裨益。
所以向初学设计模式或感觉设计模式很高深的人,推荐这本书。

posted @ 2006-10-13 15:38 Chatterley 阅读(306) | 评论 (1)编辑

2006年10月8日

列表模板和网站模板类似,是你根据自己的需求定制了列表和网站,而你定制的列表和网站可以复用。
那么我们就可以把它做为模板保存起来。目的把模板用于其他的网站或列表中。下面简单介绍列表模板:
列表模板包含files, views, fields,和列表关联的Workflow信息, Web Parts,列表相关的content(可选)呆会将证实大家看,看其是否是包含这些数据。
列表模板是以.stp文件存储,事实上是Cab包文件,模板的操作过程很相似,下面以列表模板为例:
1、进入“网站设置”->网站管理的“网站库和列表”->“自定义‘共享文档’”->“将文档库另存为模板”

进入后,填写模板信息

2、转到“网站设置”->“列表模板”

可以把ShareFileTemplate.stp下载到本地。

3、要查看.stp文件,必须从网上下载一个Cabinet Manager打开.stp文件

4、我们打开模板其实是一个manifest.xml文件,其内容主要包括:

它切实包含了以上的那些内容。

网站模板和列表模板的差别是网站包括的数据是整个网站。
如果你从获取一个.stp的网站模板,也可以通过如下的命令来添加模板:
stsadm.exe -o addtemplate -filename Template_File_Name -title Template_Title [-description Template_Description]

系统默认的共享文档库模板:manifest.rar

posted @ 2006-10-08 16:13 Chatterley 阅读(818) | 评论 (7)编辑

2006年9月29日

如果你以前已经了解了WSSv2,现在又想知道WSSv3到底增加了什么功能。
那么可以通过MSDN上的这篇文章去增进对WSSv3的了解。

篇名:探寻 SharePoint Services 中为开发人员提供的重大改进功能
链接:http://www.microsoft.com/china/MSDN/library/Office/sharepoint/WSS30Preview.mspx?mfr=true

主要包括:
1、与ASP.NET2.0集成
2、页面模板
3、使用母板页
4、WSS中的WebPart
5、开发自定义WebPart
6、内容存储的增强功能
7、WSS中的工作流
8、站点定义、功能和解决方案
9、Internet样式安全

posted @ 2006-09-29 10:17 Chatterley 阅读(170) | 评论 (0)编辑

2006年9月28日

难道Office又是另外一个Eclipse?
只不过Eclipse偏向于开发用而已,只是"偏向"。而Office则是偏向于应用。

预言,以后的企业级应用肯定离不开Office。
再一次看到了Microsoft的野心……
posted @ 2006-09-28 18:11 Chatterley 阅读(79) | 评论 (2)编辑

2006年9月27日

WebPart对于学习和研究SharePoint的人,已经不是什么新鲜的概念了。但对于学习.net Framework的人,可能会发现在System.web.ui.webcontrols下会发现多了WebPart的踪影。WebPart作为WebControl中的一种,比WebControl更高级一些,它可以在线Drag and Drop,并可以在线设置它的属性。
以前利用VS2003开发WebPart,得安装WebPart Template For VSNet。当然也可以在VS2005下安装WebPart Template来开发WebPart。在这里我就不介绍用WebPart Template For VSNet来开发WebPart了。

在VS2005下就可以不用安装WebPart Template来开发WebPart。下面我具体介绍其过程:
1、创建 Web Control Library
首先浏览C# Project Templates,然后选择Web Control Library,输入“SampleControl”。
要开发WebPart用于SharePoint,就必须引用Microsoft.SharePoint.dll(必须是安装MOSS的服务器上的)。
最后添加引用如下图:


2、编写WebPart的代码
你开发的WebPart,根据自己开发的功能选择相应的SP(SharePoint)命名空间,具体命名空间,请参考SDK。
开发WebPart必须继承WebPart类。

//--------------------------------------------------------------------
// File: SimpleWebPart.cs
//
// Purpose: A sample Web Part that demonstrates how to create a basic
// Web Part.
//--------------------------------------------------------------------

using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebPartPages;
using Microsoft.SharePoint.Utilities;
using System.Web.UI.HtmlControls;

namespace Xdian.WebParts.SampleControl
{
    
/// <summary>
    
/// This Web Part changes it's own title and implements a custom property.
    
/// </summary>

    [XmlRoot(Namespace = "MyWebParts")]
    
public class SimpleWebPart : WebPart
    
{
        
private const string defaultText = "hello";
        
private string text = defaultText;

        
// Declare variables for HtmlControls user interface elements.
        HtmlButton _mybutton;
        HtmlInputText _mytextbox;

        
// Event handler for _mybutton control that sets the
        
// Title property to the value in _mytextbox control.
        public void _mybutton_click(object sender, EventArgs e)
        
{
            
this.Title = _mytextbox.Value;
            
try
            
{
                
this.SaveProperties = true;
            }

            
catch
            
{
                Caption 
= "Error Could not save property.";
            }

        }


        
// Override the ASP.NET Web.UI.Controls.CreateChildControls 
        
// method to create the objects for the Web Part's controls.      
        protected override void CreateChildControls()
        
{
            
// Create _mytextbox control.
            _mytextbox = new HtmlInputText();
            _mytextbox.Value 
= "";
            Controls.Add(_mytextbox);

            
// Create _mybutton control and wire its event handler.
            _mybutton = new HtmlButton();
            _mybutton.InnerText 
= "Set Web Part Title";
            _mybutton.ServerClick 
+= new EventHandler(_mybutton_click);
            Controls.Add(_mybutton);
        }


        [Browsable(
true), Category("Miscellaneous"),
        DefaultValue(defaultText),
        WebPartStorage(Storage.Personal),
        FriendlyName(
"Text"), Description("Text Property")]
        
public string Text
        
{
            
get
            
{
                
return text;
            }


            
set
            
{
                text 
= value;
            }

        }


        
protected override void RenderWebPart(HtmlTextWriter output)
        
{
            RenderChildren(output);
            
// Securely write out HTML
            output.Write("<BR>Text Property: " + SPEncode.HtmlEncode(Text));
        }

    }

}

3、编写WebPart定义文件(.dwp)
这个文件是xml文件,任意文本文件更改其扩展名为.dwp就可以了。
我的WebPart的程序集文件为SampleControl.dll。命名空间为Xdian.WebParts.SampleControl。所以我的SampleControl.dwp文件如下:

<?xml version="1.0"?>
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
   
<Assembly>SampleControl, Version=1.0.0.0, Culture=neutral,PublicKeyToken=0e79ac0ff7e9e2cb</Assembly>
   
<TypeName>Xdian.WebParts.SampleControl.SimpleWebPart</TypeName>
   
<Title>SampleWebPart</Title>
   
<Description>Chatterley Create The first WebPart</Description>
</WebPart>

4、生成强名称程序集合
在这点,我在VS2005下,没有找到解决方法,因为在C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin下没有sn.exe这个工具了。
我跑到VS2003的机子下,在cmd下浏览到VS2003下的bin目录。用sn.exe随机生成了一个key.snk。输入sn.exe -h可以看参数。然后在项目文件下的Assembly.cs下加入这么一行文字:
[assembly: AssemblyKeyFile(@"C:\key.snk")]
我是把key.snk放在C:盘下的。最后生成的程序集,可以通过sn.exe -Tp来参看其PublicKeyToken。我采用的方法是用gacutil.exe放入C:/Windows/Assembly下,然后看去属性中的PublicKeyToken。

最终生成的程序集和配置文件如下:


5、修改WebConfig。
我想大家肯定会在那么多的Config混乱,你就把它放入你想添加WebPart到的SharePoint网站下。如下我把它放如8000端口的网站下(某个GUID网站下)。

当然你也可以把你的WebPart放如全局上,那么你就得修改C:\Program Files\Common Files\Microsoft Shared\web server extensions下的相应文件(不推荐)。

在WebConfig下,添加如下的配置信息:

<SafeControls>
<SafeControl Assembly="SampleControl, Version=1.0.0.0, Culture=neutral,PublicKeyToken=0e79ac0ff7e9e2cb"     Namespace="Xdian.WebParts.SampleControl"     TypeName="*"  Safe="True"/>
</SafeControls>

6、添加WebPart到网站的WebPart Gallery中。
你必须要有网站管理员的权限。进入http://vsts01:8000/下的网站管理。在WebPart管理的列表中,点击“上载”。浏览到我的SampleControl.dwp,然后输入配置信息,上传。最后在WebPart Gallery显示一条信息如下:



7、把WebPart添加到网页显示。
进入编辑网页。找到自己的SampleControl,然后添加(和SPS2003的操作有所不同)。
最后终于把WebPart显示在自己的网站上,不过不要开发太多的WebPart,网站对WebPart的承受能力是有限的。一个网站大概可以承受100个WebPart左右。如果你的网站超过的话,那么你的网站速度会明显变慢。








posted @ 2006-09-27 09:19 Chatterley 阅读(1473) | 评论 (6)编辑

2006年9月24日

在干IT这个行业,总得疾步前行地去学习技术。要学的技术有两种,一种就是老技术,自己以前没有涉及到的。一种则是新技术,没天都会出现。
在学习的时候总想什么都学,然而什么都只是了解。没有把这些知识用于实践,东西太多了,使我看不到自己的方向。总感觉自己天天都在学,但什么都不会。虽然有很多想法,但是如果放下学习的东西,去实践它,那么过不了多久,自己有落伍了。
喜欢技术总是好事,但这样无休止的下去也不是办法。到最后还是得放弃逐日,因为太阳是永远也追不上的。原本以为乘着年轻,可以什么都学。但人即使再年轻,最终还是心有余而力不足啊。从现在开始,我应该有所选择,总得放弃自己该放弃的东西。总有一些自己比较看好的东西,例如MDA和SharePoint。但是一切都是联系的,例如SharePoint和WF,SharePoint和Asp.net,还有Service、Search……一个东西又联系着其他技术。往往也就是这样,刚开始在网上寻找自己关注的东西,到最后发现最后看的并不是自己最初想要的。
或许我喜欢学习,所以学习东西感觉比别人快(自恋)。但在动手方面,我总是畏首畏尾。总想给自己下战书,但最终还是没有那么做。
最后,自制才是最重要,不要把一切都看着无所谓。其实细节才是关键,好象哪个blog上的签名就写着“细节决定胜败”。只有自己给自己划个圈子,时刻提醒自己只在这个里面。虽然外面的世界很精彩。
有时候想静静坐下来好好规划规划,但每次都是被自己的庞大的规划的东西吓着。看了B.S的书才知道,一切都是从小做起,想一想,也是。要不然Microlink怎么这么不顺利,其中一点应该也是一开始就想到了太多,毕竟人脑和能力,财力,物力都有限。就象要登上1000米的高峰,不是想一下就能到顶的。
发现自己想太多了……

posted @ 2006-09-24 12:49 Chatterley 阅读(45) | 评论 (1)编辑

2006年9月20日

虽然说SPS2003可以建立强大的门户网站,但在国内主要还是内部使用。例如我们公司的SPS2003网站就不对外开发,其主要用于公司内部的资料、信息的共享!
对外发布的门户网站在国内还比较少,我见到三种:
1、原风原貌:
http://www.oceanstudio.net
主要提供于学习SP用,几乎不提供美工,只是内容共享,交流。
2、比较简单,清新:
http://www.dreaman.cn
主要是小型企业的发布网站(门户),提供一些资料、信息共享。
3、大型的政府应用,豪华:
http://www.suifenhe.gov.cn/
这个网站是我看过做的比较好的。主要用于政府信息发布,共享,交流等。这是我在国内看到比较大的政府SharePoint应用。
4、企业内部应用(原图):
不对外开放http://sharepoint.microlink.net.cn


在国内,占大多数的应用还是企业内部,因为企业主要是利用SPS2003来分享的企业内部资料和信息。
SP平台还要整合企业内部的各种数据。因为安全性的原因,所以它们大多数不对外面开发。其中,不对外开发其中最重要的一个原因是对SP技术的不成熟,如果能对安全性和访问区域进行很好控制,企业还是希望能内外兼用的。

posted @ 2006-09-20 10:58 Chatterley 阅读(325) | 评论 (0)编辑

2006年9月19日

1、WebPart的开发,WebPart的开发在网络上的资料也最多,当然编写量也相对小一些,毕竟是一个控件,实现的功能比较有限。
2、ConsoleApplication开发,主要是引用Windows SharePoint Service的程序集(在C:/Windows/Assebly下)或WSS 的webservice(在http://ServerName/_vti_bin/下)来操作SharePoint站点里的数据。ConsoleApplication可以定制服务器或群管理的功能。
3、WindowsApplication开发,同ConaoleApplication,不同在于两种界面的表现不一样。大多数喜欢可视化操作,作为客户端,WinForm的WSS应用也是一个好的选择。
4、WebSite开发,同上,表现形式为WebForm形式。
5、WebApplication,这种是WSS功能比较强大的,其创建在WebServer的_layout目录下,对整个WebServer的所有SPWeb都可用。下面将具体介绍WebApplicaion。
6、最后,就是开发WebSite Template了。它就象WSS上提供的网站模板,例如Wiki,Blog等。
大型的企业应用,无非就这几种应用程序的整合。

展示几个动手的结果图:

ConsoleApplication结果图:

[ConsoleApp图]

WindowsApplication结果图:

首先要登陆验证
[WinApp登陆图]
其次显示站点的文档,可以浏览并进行相应操作:
[WinApp结果图]

下面介绍第5的WebApplicaion例子:


首先、创建WebApplicaiton(请在IIS中加入一个MIME Type:扩展为.tmp  类型为 Common/Type)
[WebApp创建项目]

其次:打开VS2003或VS2005创建如下图的项目(asp.net应用程序),注意路径或Http路径要选择在创建的WebServer下的_layouts目录,否则就成为普通的asp.net应用程序了:



再次,添加引用(三个是不同的,请查看路径列):


最后,进行Coding,被忘了在UI上加FormDigest验证控件,输入http://servername/projectname/page看看其效果:

程序的功能
输入:一个用户名
输出:这个用户所属的网站和权限。

图为我在RootWeb上执行的效果,和SubSite下执行的效果是一样的。也就是说,程序的功能对于网站集来说是共享的。

那么我们就可以在我们创建的SharePoint网站添加一个URL连接到这个页面的功能。

引用地址:
http://www.cnblogs.com/Trigon/archive/2006/09/19/508346.html


 

posted @ 2006-09-19 12:07 Chatterley 阅读(1470) | 评论 (1)编辑

2006年9月14日

翻译来至《Understanding WF in WSS and Office 2007 v1.doc》
作者:David Chappell, Chappell & Associates(鼎鼎大名)

翻译片段,全文请查看:http://www.davidchappell.com/blog/index.html

在大多数组织级中,运用最多的人力工作流的离子就是提交审批。一些文档必须通过某一部分人来审批通过或拒绝,或许在文档里添加备注信息来解释意图。从用户角度,这里的例子将展示如何在WSS中实现提交审批工作流。在学习这个例子之前,我们必须先定义如下人员角色,角色包括::
    >>工作流作者:创建工作流模板的开发人员或信息工作者
    >> WSS管理员: 安装工作流模板并关联文档库和列表的人。
    >>工作流发起人:开始运行工作流,触使工作流实例创建的人。
    >> 工作流参与者:参与到工作流实例执行,以提供业务支持的人。
下面将会描述到,每一种角色会在创建,安装,实例化和使用工作流中分别参与到。

创建工作流

对于创建WSS中工作流程,Microsoft提供两种选择。开发人员可以利用Visual Studio 2005 和 WF Workflow Designer来创建, 信息工作者利用Office SharePoint Designer的规则(rule-based)来创建。 这两种方式创建的工作流模板必须部署到WSS服务器上。Workflow编写将在后续中详细介绍, 现在,假设工作流模板已经被创建。

关联WorkFlow到文档或列表

要是模板可以用,则必须先把模板安装到WSS系统中。然后关联到某一文档库、列表或文档类型. 这样,流程就可以从这个库或列表中开始执行。工作流以同样的流程操作文档或列表记录,所以一个工作流模板可以附加到文档或列表记录上。 (当然也可以创建只关联文档,或只关联记录的工作流模板)。当工作流不能从文档类型中显式的启动的时候,工作流可以从定义的文档类型的文档或记录来启动。
用Office SharePoint Designer创建的工作流安装和关联操作将自动被完成。如果用WF Workflow Designer 和 Visual Studio, WSS管理员必须自己安装工作流模板. 一旦安装完,模板必须关联到某一文档库、列表或文档类型。一些也可以有比管理员权限少的用户来操作。无论谁创建关联的必须给它取一个唯一的名字,这样允许它被用户引用。对于工作流创建者是否让创建关联的人来设置流程参数,这是可选的。例如:指定必须始终参与流程用户一个默认的列表这样的选项。一个同样的模板可以关联多个文档库、列表或文档类型。当然必须一个个创建每个关联。 关联被创建后并且选项也设置好了,一个工作流触发者可以从关联中创建一个工作流程实例了。这将在下面内容里介绍。

启动工作流

WSS提供三种选择来启动工作流实例. 三种方法创建的实例都是每次在工作流开始阶段运行。(事实上,如果一个关联所创建的实例正在运行,那么就不能从那个关联创建另外实例)。三种方法是:
 >>工作流可以通过WSS用户手工启动。
 >>工作流可以配置为当文档或记录被改动时自动运行。
 >>工作流可以配置为当文档或记录被创建的时候自动运行。例如:Microsoft Word,用户可以保存一个新的文档到文档库中,这样就会触发一个实例运行。工作流触发者可以用Microsoft Word 2007 或 Word早期版本启动。不用依靠任何Microsoft应用程序工作流启动是完全有可能的.
这个场景是用第一种方法来启动工作流. 图中显示WSS用户的一个文档库中的一个文档。要从这个文档来启动工作流实例,用户点击文档,通过上下文菜单选择“ Workflows”。

它将触发到下面这个页面:

在标题“Start a New Workflow”下,是从这个文档来触发开始执行的所有工作流名字。在这个例子中,它有两个选择“Approval”和“Collect Feedback”但如果一个管理员关联了其他工作流模板到这个文档,那么他们的名字也会显示在这里。在这个例子,触发者选择“Approval“, 页面将呈现如下:

不象前面几个页面,这个页面的内容完全由工作流自己定义的。当一个工作流启动(例如, 当一个工作流实例被创建),它能选择性的显示它的用户指定显示的相应信息。对于提交的工作流程,显示如上图。这些信息包括每个审批人名字, 审批的时间和要通知的人员列表.。一旦这些信息被提供,用户点击右下角“Start“按钮。流程开始执行,请求每个参与评审这份文档的人,当这些人进入这个页面,它将看到这份文档。
当一个流程启动,它也可以选择发送email给启动的人。同样,当工作流完成时,工作流会通知文档的创建者。在这个例子中,对于这个实例,当审批流程结束的时候,审批工作流会发送。当然,也可以发送给参与流程的工作者,在这个例子中,当需要参与评审这份文档的时候,相关人也会收到email来通知他们。

posted @ 2006-09-14 16:04 Chatterley 阅读(631) | 评论 (0)编辑