Friday, December 12, 2008

SharePoint SPListItem Update (object model)

Hi,
I found something interesting and it took long time for me to figer out the problem which i am trying to solve from 1 day or more.

for example you have an document library and a word document in it, you have written an event handler which will triger when u do check in for an document.
the event handler should update some specific column which is there in your document.
the senario could be:
columns to be updated:
Column1
Column2
Column3

It happes to so that you do not have all the columns exits for document all the time, but still you need to validate that if those columns exists then do some operation.
how you will check weather thoese columns are null or they have value:
simple as below:

SPListItem item (Assume that you have got an document object in the item of SPList variable).

if((item["Column1"] != null) && (item["Column1"].toString()!=""))
//Then do as below.

Yes you got this correct, but this does not work all the time. so the trick is below:

if (item.Fields.ContainsField("Allekirjoittaja") == true)
{
WriteDebugLog("Field is available");
}

If you r trying to check the field which is not in the document then it will throw and exception of item.SystemUpdate(false);
the error could be as Error is updating the item fields or something like that.
Happy coding.

Something from Process

Software development process
Activities and steps

Requirements
Specification
Architecture
Design

Implementation
Testing & Deployment
Maintenance

Models
Agile
Cleanroom
DSDM
Iterative
RAD
RUP
Spiral
Waterfall
XP
Scrum
V-Model
Supporting disciplines
Configuration management

Documentation
Quality assurance (SQA)
Project management
User experience design

Tools
Compiler
Debugger
Profiler
GUI designer
Integrated development environment

=========== now let's take this in bit more detail =========
What do you understand by Requirements?
Requirements analysis in systems engineering and software engineering, encompasses those tasks that go into determining the needs or conditions to meet for a new or altered product, taking account of the possibly conflicting requirements of the various stakeholders, such as beneficiaries or users.


What do you understand by Specification(Functional Specification)
A functional specification (also, functional spec, specs, functional specifications document (FSD), or Program specification) in systems engineering and software development, is the set of documentation that describes the requested behavior of an engineering system. The documentation typically describes what is needed by the system user as well as requested properties of inputs and outputs (e.g. of the software system).

Architecture
The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships between them. The term also refers to documentation of a system's software architecture. Documenting software architecture facilitates communication between stakeholders, documents early decisions about high-level design, and allows reuse of design components and patterns between projects.[1]

Design
Software design is a process of problem-solving and planning for a software solution. After the purpose and specifications of software are determined, software developers will design or employ designers to develop a plan for a solution. It includes low-level component and algorithm implementation issues as well as the architectural view.

Implementation
Implementation can be achived by Programming the particual requirement using the specific tools and technology.

Testing
Software testing[1] is an empirical investigation conducted to provide stakeholders with information about the quality of the product or service under test[2] , with respect to the context in which it is intended to operate. This includes, but is not limited to, the process of executing a program or application with the intent of finding software bugs.

Deployment
Software deployment is all of the activities that make a software system available for use.

Maintenance
Software maintenance in software engineering is the modification of a software product after delivery to correct faults, to improve performance or other attributes, or to adapt the product to a modified environment

Models (Software Models)

Agile
Agile software development refers to a group of software development methodologies that are based on similar principles. Agile methodologies generally promote: A project management process that encourages frequent inspection and adaptation; a leadership philosophy that encourages team work, self-organization and accountability; a set of engineering best practices that allow for rapid delivery of high-quality software; and a business approach that aligns development with customer needs and company goals.

Cleanroom
The Cleanroom Software Engineering process is a software development process intended to produce software with a certifiable level of reliability. The Cleanroom process was originally developed by Harlan Mills and several of his colleagues including Alan Hevner at IBM[1]. The focus of the Cleanroom process is on defect prevention, rather than defect removal. The name Cleanroom was chosen to evoke the cleanrooms used in the electronics industry to prevent the introduction of defects during the fabrication of integrated circuits. The Cleanroom process first saw use in the mid to late 80s. Demonstration projects within the military began in the early 1990s[2]. Recent work on the Cleanroom process has examined fusing Cleanroom with the automated verification capabilities provided by specifications.

DSDM
Dynamic Systems Development Method (DSDM) is a software development methodology originally based upon the Rapid Application Development methodology. DSDM is an iterative and incremental approach that emphasizes continuous user involvement.

Iterative
Iterative and Incremental development is a cyclic software development process developed in response to the weaknesses of the waterfall model. It starts with an initial planning and ends with deployment with the cyclic interaction in between.

RAD
Rapid application development (RAD) is a software development methodology, which involves iterative development and the construction of prototypes.

RUP
The Rational Unified Process (RUP) is an iterative software development process framework created by the Rational Software Corporation, a division of IBM since 2003. RUP is not a single concrete prescriptive process, but rather an adaptable process framework, intended to be tailored by the development organizations and software project teams that will select the elements of the process that are appropriate for their needs.

Spiral
The spiral model is a software development process combining elements of both design and prototyping-in-stages, in an effort to combine advantages of top-down and bottom-up concepts. Also known as the spiral lifecycle model, it is a systems development method (SDM) used in information technology (IT). This model of development combines the features of the prototyping model and the waterfall model. The spiral model is intended for large, expensive and complicated projects.

Waterfall
The waterfall model is a sequential development process, in which development is seen as flowing steadily downwards (like a waterfall) through the phases of requirements analysis, design, implementation, testing (validation), integration, and maintenance.

XP
Extreme Programming (or XP) is a software engineering methodology (and a form of agile software development)[1][2][3] prescribing a set of daily stakeholder practices that embody and encourage particular XP values (below). Proponents believe that exercising these practices—traditional software engineering practices taken to so-called "extreme" levels—leads to a development process that is more responsive to customer needs ("agile") than traditional methods, while creating software of better quality.

Scrum
Scrum is an iterative incremental process of software development commonly used with agile software development. Despite the fact that "Scrum" is not an acronym, some companies implementing the process have been known to adhere to an all capital letter expression of the word, i.e. SCRUM. This may be due to one of Ken Schwaber's early papers capitalizing SCRUM in the title.

V-Model
The V-model is a software development process which can be presumed to be the extension of the waterfall model. Instead of moving down in a linear way, the process steps are bent upwards after the coding phase, to form the typical V shape. The V-Model demonstrates the relationships between each phase of the development life cycle and its associated phase of testing.
The V-model deploys a well-structured method in which each phase can be implemented by the detailed documentation of the previous phase. Testing activities like test designing start at the beginning of the project well before coding and therefore saves a huge amount of the project time.


Supporting disciplines

Configuration management
In software engineering, software configuration management (SCM) is the task of tracking and controlling changes in the software. Configuration management practices include revision control and the establishment of baselines.

Documentation
Documentation is an important part of software engineering. Types of documentation include:

Requirements - Statements that identify attributes, capabilities, characteristics, or qualities of a system. This is the foundation for what shall be or has been implemented.
Architecture/Design - Overview of software. Includes relations to an environment and construction principles to be used in design of software components.
Technical - Documentation of code, algorithms, interfaces, and APIs.
End User - Manuals for the end-user, system administrators and support staff.
Marketing - How to market the product and analysis of the market demand.

Quality assurance (SQA)
Software testing is as much an art as a science. In large, complex applications, such as operating systems, it is practically impossible to iron out every single bug before releasing it both from a difficulty point of view and due to time constraints. Different software applications require different approaches when it comes to testing, but some of the most common tasks in software QA include
PPQA audits: Process and Product Quality Assurance is the activity of ensuring that the process and work product conform to the agreed upon process.
The following quality control activities are often confused as quality assurance activities:

Peer Reviews: Peer reviews of a project's work products are the most efficient defect removal (quality control) activity.
Validation testing: Validation testing is the act of entering data that the tester knows to be erroneous into an application. For instance, typing "Hello" into an edit box that is expecting to receive a numeric entry.
Data comparison: Comparing the output of an application with specific parameters to a previously created set of data with the same parameters that is known to be accurate.
Stress testing: A stress test is when the software is used as heavily as possible for a period of time to see whether it copes with high levels of load. Often used for server software that will have multiple users connected to it simultaneously. Also known as Destruction testing. Fault injection is especially useful for any software system with exposed interfaces, e.g., protocol implementations.
Conformance testing: Confirms that the software implementation complies with established standards.
Load testing: Establishes the maximum amount of traffic that a target can accept, usually measured in packets-per-second (pps) or calls-per-second or some other rate-oriented metric. Such devices often have very fast hardware-optimized data plane processing, with software-based control and management plane functions. The SQA process is designed to ensure that the software portions of the system properly support the hardware functions.
Usability testing: Sometimes getting users who are unfamiliar with the software to try it for a while and offer feedback to the developers about what they found difficult to do is the best way of making improvements to a user interface.
Robustness testing: Software systems are presented with invalid or unexpected inputs to determine whether they have robust error-handling or input validation. Such systems pass the test(s) if they can tolerate a wide variety of invalid or unexpected inputs across the entire protocol interface specification. Commercially available robustness testing products exist, including Mu Dynamics' Service Analyzer.

Project management
Software project management is a sub-discipline of project management in which software projects are planned, monitored and controlled.

User experience design
User experience design is a subset of the field of experience design which pertains to the creation of the architecture and interaction models which impact a user's perception of a device or system. The scope of the field is directed at affecting "all aspects of the user’s interaction with the product: how it is perceived, learned, and used."

Tools
> Compiler
> Debugger
> Profiler
> GUI designer
Integrated development environment

Wednesday, December 10, 2008

how to set null values for sharepoint DateTime column

If you would like to set the null value for sharepoint datetime column using object model then one update for u.
1. u can't update the sharepoint datetime field by
item["EndDate"] = string.Empty;
item["EndDate"] = null
this both wil not work.
this has been fixed in sharepoint SP1. and if you are using sharepoint SP1 then u can use the null value to set the datetime field value as blank.
item["EndDate"] = null ( only MOSS SP1 or later)
Tx.
Labhesh Shrimali