On this page...
Archive
| March, 2010 (1) |
| February, 2010 (5) |
| November, 2009 (4) |
| October, 2009 (2) |
| October, 2008 (2) |
| July, 2008 (3) |
| June, 2008 (4) |
| April, 2008 (1) |
| January, 2007 (3) |
| December, 2006 (2) |
| October, 2006 (1) |
| September, 2006 (1) |
| August, 2006 (4) |
| July, 2006 (2) |
Categories
Archives
| | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|
| 28 | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 14 | 15 | 16 | 17 | 18 | 19 | 20 | | 21 | 22 | 23 | 24 | 25 | 26 | 27 | | 28 | 29 | 30 | 31 | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
Links
|
The growing popularity of cloud computing can easily be explained by the high ROI that users get. In contrast to using SOA, with cloud computing, users receive a great number of benefits with minimal capital expenditures. According to many studies, the main advantages of cloud technologies are the reduction in the costs of building and extending on-premises resources, the reduction in the effort and costs of IT management, and the increase in flexibility and scalability. There is no question that cloud computing is going to play a big part in the future hosting, scaling and managing of Web applications. Microsoft introduced a new operation system, Windows Azure, as “a cloud service operation system that serves as the development, service hosting and service management environment for Windows Azure platform”. The goal of Windows Azure is to provide developers “with on-demand compute and storage to host, scale and manage Web applications on the Internet through Microsoft® data centers”. As a software development outsourcing company, Murano Software has always been on the cutting edge of technology. This has enabled us to develop successful Web-based software solutions quickly and make our customers happy. That’s why we probed into Microsoft’s cloud computing immediately after the initial presentation of Microsoft Windows Azure - Community Technology Preview (CTP). We aimed at designing such a solution that would ensure real-time Web collaboration for multiple users. The solution had to be based on the Windows Azure platform and generalized into a framework. The implementation of this solution gave us a good sense of Windows Azure technologies, capabilities and limitations. 1. Capabilities and limitations of various Azure technologies During the exploration phase of the project, we analyzed the capabilities and limitations of various Azure technologies. The main parts of Microsoft’s Windows Azure platform are the following cloud technologies: - Windows AzureCompute service
- SQL Azure (Learn more)
- .NET Services (Learn more)
The Compute service runs applications and provides two different “instance” (virtual machines) types for developers to use: Web Role Instances and Worker Role Instances. Web Role can accept incoming HTTP and HTTPS requests, but can’t initiate its own request for output. Windows Azure can’t ensure that multiple requests from the same user will be sent to the same Web Role. So the Web Role must be stateless to make an application scalable, and any client-specific state has to be written to Windows Azure storage, SQL Azure or passed back to the client after each request. Worker Role can’t accept requests from the outside. As a rule, it gets input via Queue (see figure 1). Worker Role can send output to outside via Queue or outside connections, and it is used for batch work. Windows Azure storage is exploited to exchange data between different parts of an application, and it provides developers with blobs, tables and queues. Blobs are used to save binary data up to 50 gigabytes. Tables aren’t relational tables. They contain a set of entities with properties. A table has no fixed structure, so one table can contain entities with different amount of properties. Different entities can even have some properties that have equal names, but different types. A single table can hold terabytes of data. Windows Azure storage offers a way to partition a table between many servers to improve performance. It can be done by using different partition keys for different groups of data. The main goal of Queue is to allow communication between different parts of Windows Azure applications. So Queues provide a way for Web Role Instances to communicate with Worker Role Instances. Data that’s part of a Queue’s message can reach up to eight kilobytes, which isn’t much, in fact. 2. Preliminaries (Solution concept) We have to solve several tasks to find a solution that will allow multiple users to cooperate: - What technologies of Windows Azure platform have to be used to process server side work?
- How to notify a user of changes made by other users in a system.
2.1. Technologies of the Windows Azure platform we use Microsoft suggests we use Web Roles only for simple work processing, while Web Roles and Worker Roles should be used in conjunction to process time-consuming work. We decided to implement both variants in our solution to process simple and complex work. Then we implemented a simple mechanism of switching between the two variants, which entrusted a decision on task complexity to a developer. When we use Web Role only, everything is simple. Let’s look at the variant when Web Roles and Worker Roles are used in conjunction (see figure 1). Figure 1. This is the general scheme of the Compute service work originally offered by David Chappell. Sending a lot of data to Worker Role makes Queue vulnerable. We decided to use a blob to save both input and result data for Worker Role. A link to this blob can be saved to Queue. Thus we avoid the Queue’s restriction. Users communicate with Web Role using WCF, so each operation contract in Web role is the work requested by the user. If Web Role carries out simple work then everything is clear. But how will Worker Role know what kind of work it has to perform? Taking into account that our solution has to be generalized into a framework, we decided to implement the following interface: public interface ITask : ICloneable
{
// Date and time of task created
DateTime CreatedDate { get; set; }
// Task’s unique identifier
Guid TaskId { get; set; }
// Property defines usage of background processing
bool IsBackgroundProcessing { get; set; }
// Current state of a task: Success, Skipped, Postponed, Failed, Unknown
TaskState State { get; set; }
// Property used for saving task’s result
object ResultData { get; set; }
// Property used for saving task’s input data
object InputData { get; set; }
// Property used transfering exception, occured while task execution
Exception ExecutionException { get; set; }
// Method defines essence of the task
object Execute();
}
Figure 2. General task interface
Developers have to implement a class that inherits from the interface. Execute method of the class determines work that has to be processed by an application based on our framework.
Using the interface gives us the following advantages:
- A developer needs only to implement any logic in Execute method without any changes in the framework.
- Class can be serialized and sent to Worker Role from Web Role via Queue. Thus any free Worker Role can get the class, deserialize it and run Execute method.
- Implemented class can be performed either by Web Role or Worker Role. A developer can choose which type of Role processes work. The IsBackgroundProcessing property determines what kind of processing has to be done.
Our framework implements various applications to allow multiple users to work together while the code is not changed inside the framework.
Any modern application can’t work without a database. Microsoft provides two types of storages: SQL Azure and Windows Azure storage. Usage of SQL Azure is similar to SQL Server. So Azure storage is more interesting for us as part of the Windows Azure platform. We decided to use Windows Azure storage in our solution. We implemented a mechanism that allows creating tables in Azure storage in the simplest way. This is a BaseEntity class implemented in the framework.
public abstract class BaseEntity : TableServiceEntity
{
protected BaseEntity()
{
CreatedDate = DateTime.UtcNow;
}
public DateTime CreatedDate { get; set; }
protected abstract void RebuildBuildRowKey();
}
A developer only needs to implement his own class that inherits from BaseEntity to determine a table in Azure storage.
public class ShapeEntity : BaseEntity
{
public string ShapeType { get; set; }
public long Color { get; set; }
public double Thickness { get; set; }
public double Opacity { get; set; }
public string XYPoints { get; set; }
public string BoardName { get; set; }
// This method can be overriden to implement
protected override void RebuildBuildRowKey()
{
throw new NotImplementedException();
}
}
A developer implements context that creates all tables.
public class PaintContext : TableServiceContext
{
public const string BoardTable = "Boards";
public const string ShapeTable = "Shapes";
public PaintContext(string baseAddress, StorageCredentials credentials) : base(baseAddress, credentials)
{ }
public IQueryable Boards
{
get { return CreateQuery(BoardTable); }
}
public IQueryable Shapes
{
get { return CreateQuery(ShapeTable); }
}
}
2.2. User notification
The solution that allows multiple users to cooperate has to include a mechanism to notify users of changes. Let’s call any work requested by a user a task. We considered three cases:
- One table is used for all tasks. Each task has a status showing if a task is completed or is in use. Each Web role makes requests to this table and checks the presence of tasks completed. If there is a completed task, then the task’s result is sent back to the user.
- Web Role creates new Queue for each user who makes request to it. The notification “task completed” will be added to all users’ Queues when a task is completed. Web Role checks these Queues to see if there is any notification of a completed task in loop. Web Role gets a link to a blob, which contains result data from the notification and sends it to the user.
- .Net Service Bus can be used to notify users or Web Role of the task’s completion.
We decided include the first and third cases in our solution. The first option is easy to implement, but produces a high load on the Storage Service, while a lot of Web Role Instances are constantly pulling the table. But the table contains all history of performed work. It can be used in a decision-making process about the sequence for the different tasks performing the same actions. Usage of .Net Service Bus is more complex in implementation, but it allows you to notify a user of the task’s completion either directly or through Web Role.
2.3. Other features implemented in the framework
It is worth mentioning that Worker Role is a virtual machine (VM). This VM uses one of the processor’s cores. There may arise a situation when our processor’s core isn’t being used fully. For example, Worker Role is calling outside services, such as the storage service or other services in the Internet, is waiting for a response. The processor is idle while waiting for a response. We implemented a simple mechanism to manage several threads under one Worker Role Instance. It allows you to load Worker Role as much as possible.
3. Overview of solution generalized to framework
Web Role accepts a request and selects one of the classes inherited from the task, depending on the called operation contract. Then the class's TaskId, InputData and IsBackgroundProcessing properties are filled by new Guid, Input data and IsBackgroundProcessing flag from the request. This class is put to a task manager where the class’s properties are saved to the Task table. Then the task manager either runs the class’s Execute method or sends the class to Worker Role.
Let’s look at the case when Web Role runs Execute method by itself. Web Role calls Execute method of the current instance of class and saves the results to a blob. It saves a link to this blob and updates the status into a Task table for the current instance of class. Web Role returns the result data to the user as a result of the called operation contract.
Now, let’s look at the case of using background processing. Task Manager saves the class’s InputData to a blob with the name “InputData”+TaskId, and a link to that blob is saved to Queue with the serialized instance of the class. Any free Worker Role gets a serialized class from Queue, deserializes it and fills Input data from the blob. Then Worker Role calls Execute method of the class. The results of Execute method working are saved to a blob with the name “ResultData”+TaskId. A link to the blob and the status “Task completed” are saved to the Task table. Web Role checks the Task table in loop and returns the results from the blob when the status of class has changed to completed state.
The other way of notification is using.Net Service Bus by Web Role. In this case, Worker Role, which is to be notified of class’s Execute method completion, creates a request to Service Bus. .Net Service Bus raises an event when the class’s Execute method has finished work, and all Web Role Instances subscribed to the event have been notified. Notified Web Role gets results from the blob and sends it to the customer. An address to the blob is stored to notification. If Web Role expects some results data, but there isn’t any data to return to the user, Web Role puts the class to Worker Role to repeat the performance.
We have investigated the case when only one of the collaborating users makes a request to Web Role to do some work and is notified of the task's completion. But other users have to be notified of changes made by the requested work, too.
There are three options that can be used by a developer:
- A developer can implement an individual operation contract in WCF that checks the Task table and returns all changes if there are any in loop.
- A developer can use .Net Service Bus for notification of users directly.
- A developer can implement a class that inherits from ITask. This class can take results requested by the user using some processing.
In the second case, users subscribe to event from .Net Service Bus. This event is raised if there are any changes in the system made by other users. The changes can be transmitted either inside event arguments or via calling the individual operation contract in WCF. So a developer can implement any algorithm of getting concrete results.
You can see the architecture of a scalable cloud application based on our framework in figure 4, as well as the sequence diagram in figure 3.
Figure 3. Sequence diagram shows processing of user’s request using Service Bus.
Figure 4. Architecture of a scalable cloud application based on our framework
The main framework capabilities are as follows. The workflow of performing any work depends on a scenario selected by a developer and can be expanded to achieve more complex goals. The flexibility of the workflow is controlled by the properties determined in the ITask interface. The rest of the logic and code remain the same for different kinds of goals. The behavior depends only on the type of the class inherited from ITask that is created in Web Role for each particular client request. Usage of .NET Service Bus adds flexibility to the Silverlight Client – Web Role communication.
Our solution for user notification is an alternative to polling duplex for Windows Azure platform, which was in a stage of development at that moment.
Demo applications
To show our framework in action, we implemented a cloud application that allows multiple users to draw many-colored shapes on the same board. Each user can see the changes made by others. It’s a real-time collaborative drawing cloud application, using Silverlight and Microsoft Windows Azure, and you are welcome to test-drive it at http://multidraw.cloudapp.net. The framework can be easily adapted for any similar task. A good sample of an application that can be created with the help of our architecture is a multi-edit grid that allows a multiuser edition of the same grid. You can see the demo at http://multidraw.cloudapp.net/grid/SomeSession.

Figure 5. Screenshot of Multidraw application working in different browsers
Conclusion
We looked into new implementation of cloud computing presented in the Windows Azure platform by Microsoft. We developed a universal framework architecture that allows you to implement similar tasks with multiple-user interaction easily. We implemented working prototypes that allow multiple users to draw many-colored shapes on the same board and edit the same grid.
By Alexander, a Senior Java/PHP Developer on Murano Software’s team CSS3 features are really good for implementing modern UI tendencies, such as rounded corners, shadows and transparency. Today, most browsers support CSS3 or provide their own ways to achieve the same features. Let's review the most popular CSS3 features. Round corners Round corners were a pain for a lot of developers, since border radius is not supported by all browsers. Most often, images and techniques like "sliding doors" were used. For IE, we can use VML to emulate border radius support. Actually, it is already implemented by Remiz Rahnas and Nick Fetchak as tiny IE behavior. So we are downloading border-radius.htc, putting it in the CSS directory and simply including it in our CSS rule: .my-block {
background: #000; color: #fff;
-moz-border-radius: 10px; /* Firefox */
-webkit-border-radius: 10px; /* Safari, Chrome */
-khtml-border-radius: 10px; /* KHTML */
border-radius: 10px; /* Opera 10.50 beta and other CSS3 compatible browsers */
/* for IEs */
behavior: url(border-radius.htc); /* teaching IE to understand border-radius */
}
Box shadows
Box shadows were even worse than rounded corners. There were some good techniques to achieve a flexible box shadow solution, but most of them were too complicated.
In addition to implementing IE behavior for round corners, Remiz Rahnas and Nick Fetchak made another one for box shadows. So, to support box shadow in IEs, you need to download ie-css3.htc and include it in the CSS rule:
.my-block {
background: #fff; color: #000;
-moz-box-shadow: 10px 10px 10px #000; /* Firefox */
-webkit-box-shadow: 10px 10px 10px #000; /* Safari, Chrome */
-khtml-box-shadow: 10px 10px 10px #000; /* KHTML */
box-shadow: 10px 10px 10px #000; /* Opera 10.50 beta and other CSS3 compatible browsers */
/* for IEs */
behavior: url(ie-css3.htc); /* teaching IE to understand border-radius and box-shadow */
}
Opacity
Opacity is another property often used by designers to put some fancy semi-transparent labels on images or do something similar. The problem is, again, that Internet Explorer does not support alpha transparency directly. The solution is to use a filter:
.my-block {
opacity: .5; /* CSS3 compatible browsers */
filter: alpha(opacity=50); /* IE < 8 */
-ms-filter: "alpha(opacity=50)"; /* IE 8 */
-khtml-opacity: .50; /* KHTML */
-moz-opacity: .50; /* Firefox */
}
RGBA
The problem with opacity is that it cascades. So, for example, it does not fit if you need nontransparent text inside a semi-transparent box. RGBA comes to the rescue here. RGBA is a way to specify color by component: red, green, blue and (the sweet part!) alpha transparency. Here we'll need to use IE conditional comments to apply some styles exclusively to IE.
This one is for all browsers. If a browser does not support rgba, rgb will be used:
.my-block {
background: rgb(255, 255, 255);
background: rgba(255, 255, 255, .5);
}
This one is for IEs:
.my-block {
background: transparent;
filter:progid:DXImageTransform.Microsoft.gradient(startColorStr=#7FFFFFFF,endColorStr=#7FFFFFFF); // IE<8
-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#7FFFFFFF,endColorstr=#7FFFFFFF)"; // IE8
zoom: 1; // triggering hasLayout to avoid block problems
}
Here we are using a gradient filter that accepts two RGBA values in format #AARRGGBB as start color and end color. AA is the hex transparency value, while RR, GG and BB are hex color components. rgba(255, 255, 255, .5) equals #7FFFFFFF: 0.5 * 255 = 127 (truncated) that is 7F in hex. For RR, GG and BB, we are just converting component value to hex.
By Alexander, a Senior Java/PHP Developer on Murano Software’s team Facebook, as you may already know, is working to open source their PHP to C++ translator, called HipHop. There is a lot of buzz about it, so I think a summary will be handy. Main points: - It's free and open source.
- HipHop is already used by Facebook, so it's tested with their huge code base.
- Process is: PHP → С++ → GCC → binary.
- HipHop is not JIT. You should translate and compile all code on every deployment.
- Binary can work as standalone server (using libevent). Also, it can work in command line.
- Standalone server uses one process and many threads.
- It's not based on Zend Engine. Instead, C++ code compatible with PHP 5.2 is used.
- Extensions are converted to thread-safe C++ (standard PHP extensions are being developed in C).
- Many extensions already have been converted. These are used by Facebook.
- If you want to use HipHop, prepare to convert additional extensions yourself.
- Some PHP magic methods are supported, but the performance is the same as in PHP.
No support for: - Windows.
- PHP 5.3 (will be implemented later).
- eval().
- create_function().
- preg_replace with /e modifier.
- function_exists() before function declaration.
Dynamic PHP functionality supported: - Dynamic function call including call_user_func().
- Dynamic methods and properties.
- Dynamic variables, extract().
- Dynamic include().
- Redefinition of functions, classes and constants.
- __toString(), __get(), __set(), __call().
Thoughts: Facebook made a great tool to make their codebase run faster without rewriting it in C or C++. They do have a reason for it, and there is no doubt they (with their really high loads) need it. What does it mean for the rest of us? A little. All major PHP frameworks and CMS, including Drupal and Wordpress, cannot be compiled by HipHop. Moreover, PHP execution itself is a bottleneck in a very few cases, like Facebook’s, where data storage and other infrastructure is perfectly optimized. If your application works slowly, and you aren't getting loads comparable to Facebook’s, HipHop most likely will not help you. The problem is within the database or algorithms used. Sources used:
We are proud to announce the release of the Rich Cloud Application (RCA) that Microsoft hired us to develop for showcasing Azure and Silverlight. This application is a proof-of-concept, simple product support and feedback system that provides these features: - Issue-tracking system that supports attachments and hierarchical user comments
- Peer-to-peer messaging for user collaboration
- 5-star rating system for user comments and point rating system for issues and users
- Item search, both in-place and with external providers, such as Microsoft FixIt
- User profile management and usage statistics
Click below to take a look at screenshots of the application in action or try it online at http://pso.cloudapp.net! The application provides a great set of best practices for building scalable Windows Azure applications with rich Silverlight UI. It shows how to implement MVVM in Silverlight 3, work with Azure Storage from Silverlight just like any WCF data source, and use Live ID authentication with Silverlight and Windows Azure. Let me remind you that the application uses Azure Storage. It is a fast and scalable non-relational storage that has a lot of advantages, but also imposes a set of limitations. For instance, you can't get a number of entities in a table or perform a wildcard search. And we are going to write a series of blog posts where we will describe how to get around these limitations. If you don't want to wait, I have good news for you :) The full source code is available for download at MSDN Code Gallery under MS-PL license. Thus you can reuse these components in your applications! And one more piece of good news: Our team is working on a new version of the application. The new version will be finished in the middle of March and will provide SQL Azure support and include a lot of nice features made possible with release of Silverlight 4 RC, such as printing support, integration with a microphone and a webcam, and UDP multicast to peer-to-peer collaboration. So stay tuned and subscribe to our blog to get fresh news about the Rich Cloud Application!
By Alex, a Senior .NET Developer on Murano Software’s team Murano Software is becoming a permanent participant in the Microsoft Incubation Week events. Last week (Jan 25-29), our company participated as a development partner in Microsoft SharePoint 2010 Social Fest at Microsoft’s Silicon Valley campus. We provided seven top Microsoft BizSpark startups with outsource development support, SharePoint expertise and advice. Just as it was during other Microsoft Incubation Weeks, the mission of our team, led by Dimitri Nikouline, this year was to create working solutions for our clients in the shortest terms of the event. Our developers and startup representatives were working day and night, in a warm and competitive atmosphere, being eager to try the new features and implement their ideas. . This was even more challenging, since the products - Microsoft Visual Studio 2010 and Microsoft SharePoint 2010 - are Betas now, and there was no strong knowledge base, except samples in Microsoft blogs and related Internet resources. But our company, always being on the cutting edge of the development technologies, successfully defeated all of these challenges. In addition to the true interest in the newest technologies and software development passion, we got through these challenges because of intensive communication and team spirit. Working with the different startup clients, we established a single workspace for all involved to resolve issues faster and exchange tips, ideas, and links. Although these startups work in different areas of business intelligence and communications, they all are looking forward to the integration with SharePoint as an opportunity to upgrade their working and beneficial products to the enterprise-level applications. This wide range of interests resulted in a large variety of integration tasks successfully resolved by our guys during that week, from the UI widgets customization to search, synchronization and user profile management.  Huddle The winning project, Huddle, is helping businesses across the world to work online in a common workspace, share and edit the documents, involving the external users in their workflows. Our guys did a great job using Silverlight and SharePoint 2010 features, customizing the UI and the back-end logic by means of timer jobs. Calinda Software Calinda Software, the second winner with their MindUp product, are focused on making e-mail communications structured and easy, so no attachment gets lost, and the history of sent and received messages can be seen on a visual map. With SharePoint 2010, the e-mail environment transparently becomes integrated with document libraries and lists in MOSS. Our commitment to their success was a service, allowing users to search for people with specific skills and give the relevancy estimates for these search results. GetConfer Confer is a company that offers a microblogging Web application to simplify communications between employees of a big company. In order to extend its functionality on the enterprise SharePoint installation, we worked together on mechanisms to map Confer's users to SharePoint users. Cortex Intelligence Cortex Intelligence provides a market intelligence service for Microsoft SharePoint 2010 users, letting them access external data, such as market data, news and so on. During the event, our guys worked on integrating the microblog functionality of SharePoint with external data providers, allowing them to post blog articles and put links to external articles into the user's microblog. Leverage Software LeverageSoftware's DesignSpace platform transforms sets of e-mail threads into a social workspace that the users can share with other colleagues in their company. We helped them to integrate with the people search functionality of SharePoint 2010. Liaise Liaise allows SharePoint 2010 users to transparently update their SharePoint items (tasks, lists and so on) with the information parsed from the e-mail messages they send, save attachments in document libraries and so on. We made a prototype solution, putting task summary information in the calendar, automatically updating any change to the task list. Loqu8 Loqu8 Prelude is a tool that’s integrated into Microsoft applications (Office, Media Player, Control Panel, etc.), showing users contextually relevant information when they are hovering a word. During Microsoft Incubation Week, we worked on the integration of their tool with SharePoint’s platform.
By Sergey, a quality assurance manager on Murano Software’s team If you have ever tried to upload a file under Selenium RC, you must know that it is impossible to type in the file upload text field. This caused by a JavaScript security restriction. JavaScript is not allowed to modify the value of <input type="file"> form fields. http://wiki.openqa.org suggests to work around this by running the tests in the experimental “chrome” mode for Firefox. But it is mentioned that there is no way to do this on any other browser. I have tried to use the “chrome” mode for Firefox and the “iehta” mode for IE, but my tests turned out very unstable. Fortunately, there is another workaround. For Firefox and IE, you can set the focus inside the file upload field by using JavaScript.
selenium.getEval("this.browserbot.getCurrentWindow().document.getElementById('FileUploadFieldId').focus();")
Then use the selenium.keyPressNative () method to type the file path, i.e. C:\Some Folder\TestFile.txt. The method simulates a user pressing and releasing a key by sending a native operating system keystroke. I created a helper method to type the file path. It handles upper case and lower case letters, back slashes, spaces and periods.
import java.awt.event.KeyEvent
protected void typeNative(String filePath) throws InterruptedException
{
for (char c : filePath.toCharArray()) {
if (c == ':') {
selenium.keyDownNative(Integer.toString(KeyEvent.VK_SHIFT));
selenium.keyPressNative(Integer.toString(KeyEvent.VK_SEMICOLON));
selenium.keyUpNative(Integer.toString(KeyEvent.VK_SHIFT));
}
else if (c == '\\') {
selenium.keyPressNative(Integer.toString(KeyEvent.VK_BACK_SLASH));
}
else if (c == '.') {
selenium.keyPressNative(Integer.toString(KeyEvent.VK_PERIOD));
}
else if (c == ' ') {
selenium.keyPressNative(Integer.toString(KeyEvent.VK_SPACE));
}
else {
KeyStroke key = KeyStroke.getKeyStroke("pressed " + Character.toUpperCase(c));
if (null != key) {
// should only have to worry about case with standard characters
if (Character.isUpperCase(c)) {
selenium.keyDownNative(Integer.toString(KeyEvent.VK_SHIFT));
}
selenium.keyPressNative(Integer.toString(key.getKeyCode()));
if (Character.isUpperCase(c)) {
selenium.keyUpNative(Integer.toString(KeyEvent.VK_SHIFT));
}
}
}
}
}
If you're using Selenium RC and Java, you can exploit java.awt.Robot, instead of using the selenium.keyPressNative() method. See the code sample below.
For Safari, there is no rendered field in the HTML page into which you can simply type keys. Safari requires that the user interact with a “File Upload” dialog box. To get the dialog, you can put selenium.click() on the file upload field. But here you will meet another unpleasant surprise. The “File Upload” dialog box will be loaded in a modal window, so the executing of your code will be held up until the modal window is closed.
To handle that, you need to invoke the type native method in the other thread one step before clicking on the file upload field and set a delay to wait until the modal window with the “File Upload” dialog box appears. See the code sample that uses java.awt.Robot.
protected void chooseFile(String element, String filePath) throws InterruptedException
{
new FileChooserThread(filePath).start();
selenium.click(element);
}
To invoke the type native method, just add new class containing the code below to your project.
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
public class FileChooserThread extends Thread
{
public FileChooserThread(String file) {
super(new FileRunner(file));
}
}
class FileRunner implements Runnable
{
private String fullName;
public FileRunner(String fileName) {
this.fullName = fileName;
}
public void run() {
try {
Thread.sleep(2000);
Robot robot = new Robot(); // input simulation class
for (char c : fullName.toCharArray()){
if (c == ':') {
robot.keyPress(KeyEvent.VK_SHIFT);
robot.keyPress(KeyEvent.VK_SEMICOLON);
robot.keyRelease(KeyEvent.VK_SHIFT);
}
else if (c == '\\') {
robot.keyPress(KeyEvent.VK_BACK_SLASH);
}
else if (c == '.') {
robot.keyPress(KeyEvent.VK_PERIOD);
}
else if (c == ' ') {
robot.keyPress(KeyEvent.VK_SPACE);
}
else {
KeyStroke key = KeyStroke.getKeyStroke("pressed " + Character.toUpperCase(c));
if (null != key) {
// should only have to worry about case with standard characters
if (Character.isUpperCase(c)) {
robot.keyPress(KeyEvent.VK_SHIFT);
}
robot.keyPress(key.getKeyCode());
robot.keyRelease(key.getKeyCode());
if (Character.isUpperCase(c)) {
robot.keyRelease(KeyEvent.VK_SHIFT);
}
}
}
}
robot.keyPress(KeyEvent.VK_ENTER);
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
}
The final remark is addressed to the focus. This workaround will work only if the system focus is into the file upload field. I had to start the selenium server with the -multiWindow parameter to set the system focus into the browser window.
By Vladimir, a .NET developer on Muranosoft’s team. The new Microsoft Visual Studio 2010 raises the development of SharePoint projects to an absolutely new level. You won’t need to install any special extensions like those in Visual Studio 2008. Visual Studio 2010 supports all the necessary tools, which really help to improve the development process. So let’s take a look at the new SharePoint development features that Visual Studio 2010 offers. New Project Templates First of all, the VS 2010 supports many different templates for the SharePoint projects, such as: • Blank Site Definition • Content Type • List Definition • State Machine Workflow • WSP Import • Business Data Catalog Model • Deployment Module • Event Receiver • Sequential Workflow • Web Part After selecting any of these templates, you have to go through some steps to configure your development environment, of course. SharePoint Solution Architecture Any project type will include two key nodes that you can’t remove, relocate or rename. There are Features and Package nodes. These ones will be available in a project, even if your project doesn’t contain any feature or package definition. The “Features” node contains all your project features. If you want to add a new feature, just right click on this node and select “Add Feature.” You can use the new Feature Designer tool to manage a corresponding feature. The “Package” node contains only one *.WSP file, which describes the deployment rules of your SharePoint project. Double clicking on this file affects the Package Designer tool, which allows you to configure all deployment aspects. In addition to these nodes, the VS 2010 contains the package explorer, which also allows you to manage your SharePoint items. For example, you can group files into features or packages, raise the Features/Packages designer, or move files from one feature or package to another. Changes in the Server Explorer Now the Server Explorer supports a new node called SharePoint Connections. This node contains the URL to all your SharePoint sites. You can add the new site by clicking on the SharePoint Connections node, clicking “Add Connection” and entering the URL to the SharePoint site. This will allow you to browse the contents (such as features, lists and sites) and configure the SharePoint server settings. Development Some few features are directly linked with a development process. These include the new Client Object Model, LINQ to SharePoint, Sandboxed Solutions and “External Data Lists.” - Client Object Model allows us to have direct access to the object model by using JavaScript, Silverlight or .NET code without calling Web Services.
- LINQ to SharePoint provides an ability to use usual LINQ-queries to manipulate with SharePoint lists. Now we can forget about foreach’es and other redundant code in many cases.
- Sandboxed Solutions allow us to deploy our Web Parts without having an administrative privilege. It was one of the biggest problems in previous versions of the SharePoint environment. This is achieved by running solutions in a separate process that is restricted by .Net CAS policy. So the framework can control solutions and shut down any of them automatically.
- External Lists (formerly known as the Business Data Catalog) is a powerful mechanism to organize collaboration your SharePoint project with other applications or data sources. You should describe an entities structure and link with a data source. After that, you can use received data in your SharePoint project.
Debug and Deploy Process As you may know, the debug and deploy processes were quite difficult in the previous versions of Visual Studio. The newest one dramatically changes this work, offering us an absolutely new way. Now you shouldn’t deploy your package on the server, deactivate and uninstall all features, retract the solution manually, etc. You shouldn’t install an additional Visual Studio on your SharePoint server, either, just to debug your code. After configuring your SharePoint solution, you just press the F5 button and the installation of your package will be done automatically, even if an old solution has been installed on the server. All work (deactivating, retracting, etc.) will be done automatically. Amazing, isn’t it? After installing the new package, the Visual Studio’s debugger will be attached to the Windows SharePoint services process. To enable this, you should run you project in the debug mode (when you first debug, VS suggests to modify your web.config file accordingly). Please note, you could use it on your development side, not on the SharePoint server side! Resources If you want to get more information, you can watch this video or follow this link to read the official documentation. There is another great article about new tools for SharePoint development in the VS 2010, written by Steve Fox, senior technical evangelist. Also, I suggest you take a look at the short training courses provided by Channel 9. Enjoy!
Numerous research reports and analyses have been devoted to the benefits and challenges of using virtual software development teams. The most significant and indisputable benefit of the distributed-development model is the ability to staff your team with the talent of the highest caliber at a much lower price than an on-site team. This is actually the main reason why millions of startups, small companies, midsize businesses and global tech companies have remote workers within their teams. Additional advantages of virtual teams include a 24-hour development cycle, an increase in productivity and a shorter time-to-market. While some experts in global software development share their success stories, their opponents complain that the quality of software developed by a distributed team often suffers from time lags, language and cultural differences, lack of control, and communication problems. The negative impact of the distributed-development model on software quality is one of the most widely spread beliefs in software project management so far. Microsoft’s ESM group (Empirical Software Engineering and Measurement Research Group) members were concerned about the issue and recently decided to run their own study. In their empirical study, they looked for statistical evidence that components developed by distributed teams resulted in software with more errors than components developed by collocated teams. Guess what? Christian Bird, University of California, Davis; Nagappan Premkumar Devanbu, University of California, Davis; Harald Gall, University of Zurich, and Murphy found that the differences were statistically negligible! The study measured diverse component characteristics, such as code churn, complexity, dependency information and test code coverage. “Teams that were distributed wrote code that had virtually the same number of post-release failures as those that were collocated,” the report says. Moreover, the ESM group wanted to verify the results and conducted an anonymous survey, asking engineers if they ran into problems. Most people preferred to talk to someone from their own organization 4,000 miles away, rather than someone only five doors down the hall but from a different organization. Organizational cohesiveness played a bigger role than geographical distance. In other words, if your local and remote team members work in the same management environment and have access to the same resources, you will most likely reap the benefits of your virtual team, rather than face the negative side. That’s why, at Murano, we were always big believers in the dedicated team model where an offshore provider manages administrative and logistical issues while the offshore team becomes a cohesive part of the client’s engineering organization.
|