Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

How-To Tutorials

7018 Articles
Packt
19 Feb 2013
6 min read
Save for later

Rich Internet Application (RIA) – Canvas

Packt
19 Feb 2013
6 min read
(For more resources related to this topic, see here.) RIA — Canvas (Become an expert) If you started your career in web design or development in the late 90s to early 2000s, there is definitely a good chance that at some point, you've been asked to do a zany, cool, and bouncy website using (then) Macromedia Flash. After it was acquired by Adobe in 2005, Flash transformed from being a stage-based, procedural script-running, hard-coded, and embedded object to a Rich Internet Application ( RIA). With the arrival of Adobe Flex as an SDK for Flash's Action Script 3.0, the company tried to lure more developers into Flash development. Later, Adobe donated Flex to the Apache foundation. All this, and yet no browser vendor ever released the Flash plugin integrated with any of their products. Flash-based applications took time to develop, never had any open source frameworks supporting the final product, and came across many memory-hogging security threats. The biggest blow to this technology came when Apple decided not to support Flash with any of the iPad, iPhone, or iPod devices. The message was loud and clear. The web needed a new platform to support Rich Internet Applications, which can be seamlessly integrated in browsers without any third-party plugin requirement at the visitors' end. Presenting HTML5 Canvas. Getting ready The HTML5 canvas element provides a canvas (surprise!) with a specified height and width inside a web page, which can be manipulated with JavaScript to generate graphics and Rich Internet Applications. How to do it... It is just the same as it was with video or audio. <canvas id="TestCanvas" width="300" height="300"> Your browser does not support Canvas element from HTML5. </canvas> The preceding syntax gives us a blank block element with the specified height and width, which can now be identified with some JavaScript by the ID TestCanvas. <script> var test=document.getElementById("TestCanvas"); var col1=c.getContext("2d"); col1.fillRect(0,0,20,80); col1.fillStyle="#808"; </script> A variable named test is defined with the method document.getElementByID() to identify a canvas on the web page. The getContext object, which is a built-in HTML5 object, is defined in another variable called col1. The value 2d provides properties and methods for drawing paths, boxes, circles, text, images, and more. The fillRect(x,y,width,height) method provides four parameters to draw a rectangle on the x and y coordinates. Similarly, the fillStyle() method defines the fill color of the drawing. The output is as follows: The origin of the x and y coordinates lies at the top-left corner of the canvas, unlike the graph paper (which most of us are used to), where it lies in the bottom-left corner. Appending the graph for multiple columns by additional getContext variables can be done as follows: <script> var test=document.getElementById("TestCanvas"); var col1=test.getContext("2d"); col1.fillStyle="#808"; col1.fillRect(10,0,20,80); var col2=test.getContext("2d"); col2.fillStyle="#808"; col2.fillRect(40,0,20,100); var col3=test.getContext("2d"); col3.fillStyle="#808"; col3.fillRect(70,0,20,120); </script> We get the following output: The getContext variables can be defined with different methods as well. To draw a line we use the moveTo(x,y) and lineTo(x,y) methods: line.moveTo(10,10); line.lineTo(150,250); line.stroke(); The moveTo() method defines the starting point of the line and the lineTo() method defines the end point on the x and y coordinates. The stroke() method without any value assigned to it connects the two assigned points with a line stroke. The stroke() and fill() are the ink methods used to define the visibility of the graphic. To draw a circle we use the arc(x,y,r,start,stop) method: circle.beginPath(); circle.arc(150,150,80,0,2*Math.PI); circle.fill(); With the arc() method, we must use either the fill() method or the stroke() method for a visible area. For further exploration, here are a few more canvas methods that can be tried out: Text for canvas: font: This specifies font properties for text fillText(text,x,y): This draws normal text on the canvas strokeText(text,x,y): This draws stroked text without any fill color Here are the syntaxes for the preceding properties: text.font="30px Arial"; text.fillText("HTML5 Canvas",10,50); text.strokeText("HTML5 Canvas Text",10,100);   And for the last example, we will do a raster image drawing using the ID into the canvas: var img=document.getElementById("canvas-bg"); draw.drawImage(img,10,10); Similar to the ID for Canvas, the image ID is selected by the document.getElementById() method, and then we can use it as a background for the selected canvas. The image used with the ID canvas-bg can be placed in a hidden div tag and later can be used as a background for any graph or chart, or any other graphic. One of the most practical applications of the text and image drawing on a canvas could be the customization of a product with label image and text over it. How it works... There are many places where Canvas may be implemented for regular web development practices. It can be used to generate real-time charts, product customization applications, or more complex or simple applications, depending on the requirement. We know that Canvas is an HTML5 element and the key (for Canvas) always remains with the JavaScript used in it. We get support from all the browsers apart from IE8 or below. There's more... It always helps when a developer knows about the resources available at their disposal. Open source JS frameworks for Canvas There are many open source JavaScript frameworks and libraries available for easy development of the graphics with Canvas. A few noteworthy ones are KineticJS and GoJS. Another framework is ThreeJS, which uses WebGL and allows 3D rendering for your web graphics. Summary This article discussed about the Rich Internet Application (RIA) platform with HTML5 and CSS3. We also saw how Canvas can be used implemented in regular web development practices. Resources for Article : Further resources on this subject: Building HTML5 Pages from Scratch [Article] HTML5: Generic Containers [Article] HTML5: Developing Rich Media Applications using Canvas [Article]
Read more
  • 0
  • 0
  • 1588

article-image-apache-solr-configuration
Packt
19 Feb 2013
17 min read
Save for later

Apache Solr Configuration

Packt
19 Feb 2013
17 min read
(For more resources related to this topic, see here.) During the writing of this article, I used Solr version 4.0 and Jetty Version 8.1.5. If another version of Solr is mandatory for a feature to run, then it will be mentioned. If you don't have any experience with Apache Solr, please refer to the Apache Solr tutorial which can be found at : http://lucene.apache.org/solr/tutorial.html. Running Solr on Jetty The simplest way to run Apache Solr on a Jetty servlet container is to run the provided example configuration based on embedded Jetty. But it's not the case here. In this recipe, I would like to show you how to configure and run Solr on a standalone Jetty container. Getting ready First of all you need to download the Jetty servlet container for your platform. You can get your download package from an automatic installer (such as, apt-get), or you can download it yourself from http://jetty.codehaus.org/jetty/ How to do it... The first thing is to install the Jetty servlet container, which is beyond the scope of this article, so we will assume that you have Jetty installed in the /usr/share/jetty directory or you copied the Jetty files to that directory. Let's start by copying the solr.war file to the webapps directory of the Jetty installation (so the whole path would be /usr/share/jetty/webapps). In addition to that we need to create a temporary directory in Jetty installation, so let's create the temp directory in the Jetty installation directory. Next we need to copy and adjust the solr.xml file from the context directory of the Solr example distribution to the context directory of the Jetty installation. The final file contents should look like the following code: <?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www. eclipse.org/jetty/configure.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/solr</Set> <Set name="war"><SystemProperty name="jetty.home"/>/webapps/solr. war</Set> <Set name="defaultsDescriptor"><SystemProperty name="jetty.home"/>/ etc/webdefault.xml</Set> <Set name="tempDirectory"><Property name="jetty.home" default="."/>/ temp</Set> </Configure> Downloading the example code You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you. Now we need to copy the jetty.xml, webdefault.xml, and logging.properties files from the etc directory of the Solr distribution to the configuration directory of Jetty, so in our case to the /usr/share/jetty/etc directory. The next step is to copy the Solr configuration files to the appropriate directory. I'm talking about files such as schema.xml, solrconfig.xml, solr.xml, and so on. Those files should be in the directory specified by the solr.solr.home system variable (in my case this was the /usr/share/solr directory). Please remember to preserve the directory structure you'll see in the example deployment, so for example, the /usr/share/solr directory should contain the solr.xml (and in addition zoo.cfg in case you want to use SolrCloud) file with the contents like so: <?xml version="1.0" encoding="UTF-8" ?> <solr persistent="true"> <cores adminPath="/admin/cores" defaultCoreName="collection1"> <core name="collection1" instanceDir="collection1" /> </cores> </solr> All the other configuration files should go to the /usr/share/solr/collection1/conf directory (place the schema.xml and solrconfig.xml files there along with any additional configuration files your deployment needs). Your cores may have other names than the default collection1, so please be aware of that. The last thing about the configuration is to update the /etc/default/jetty file and add –Dsolr.solr.home=/usr/share/solr to the JAVA_OPTIONS variable of that file. The whole line with that variable could look like the following: JAVA_OPTIONS="-Xmx256m -Djava.awt.headless=true -Dsolr.solr.home=/usr/ share/solr/" If you didn't install Jetty with apt-get or a similar software, you may not have the /etc/default/jetty file. In that case, add the –Dsolr.solr.home=/usr/share/solr parameter to the Jetty startup. We can now run Jetty to see if everything is ok. To start Jetty, that was installed, for example, using the apt-get command, use the following command: /etc/init.d/jetty start You can also run Jetty with a java command. Run the following command in the Jetty installation directory: java –Dsolr.solr.home=/usr/share/solr –jar start.jar If there were no exceptions during the startup, we have a running Jetty with Solr deployed and configured. To check if Solr is running, try going to the following address with your web browser: http://localhost:8983/solr/. You should see the Solr front page with cores, or a single core, mentioned. Congratulations! You just successfully installed, configured, and ran the Jetty servlet container with Solr deployed. How it works... For the purpose of this recipe, I assumed that we needed a single core installation with only I and solrconfig.xml configuration files. Multicore installation is very similar – it differs only in terms of the Solr configuration files. The first thing we did was copy the solr.war file and create the temp directory. The WAR file is the actual Solr web application. The temp directory will be used by Jetty to unpack the WAR file. The solr.xml file we placed in the context directory enables Jetty to define the context for the Solr web application. As you can see in its contents, we set the context to be /solr, so our Solr application will be available under http://localhost:8983/solr/ We also specified where Jetty should look for the WAR file (the war property), where the web application descriptor file (the defaultsDescriptor property) is, and finally where the temporary directory will be located (the tempDirectory property). The next step is to provide configuration files for the Solr web application. Those files should be in the directory specified by the system solr.solr.home variable. I decided to use the /usr/share/solr directory to ensure that I'll be able to update Jetty without the need of overriding or deleting the Solr configuration files. When copying the Solr configuration files, you should remember to include all the files and the exact directory structure that Solr needs. So in the directory specified by the solr.solr.home variable, the solr.xml file should be available – the one that describes the cores of your system. The solr.xml file is pretty simple – there should be the root element called solr. Inside it there should be a cores tag (with the adminPath variable set to the address where Solr's cores administration API is available and the defaultCoreName attribute that says which is the default core). The cores tag is a parent for cores definition – each core should have its own cores tag with name attribute specifying the core name and the instanceDir attribute specifying the directory where the core specific files will be available (such as the conf directory). If you installed Jetty with the apt–get command or similar, you will need to update the /etc/default/jetty file to include the solr.solr.home variable for Solr to be able to see its configuration directory. After all those steps we are ready to launch Jetty. If you installed Jetty with apt–get or a similar software, you can run Jetty with the first command shown in the example. Otherwise you can run Jetty with a java command from the Jetty installation directory. After running the example query in your web browser you should see the Solr front page as a single core. Congratulations! You just successfully configured and ran the Jetty servlet container with Solr deployed. There's more... There are a few tasks you can do to counter some problems when running Solr within the Jetty servlet container. Here are the most common ones that I encountered during my work. I want Jetty to run on a different port Sometimes it's necessary to run Jetty on a different port other than the default one. We have two ways to achieve that: Adding an additional startup parameter, jetty.port. The startup command would look like the following command: java –Djetty.port=9999 –jar start.jar Changing the jetty.xml file – to do that you need to change the following line: <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set> To: <Set name="port"><SystemProperty name="jetty.port" default="9999"/></Set> Buffer size is too small Buffer overflow is a common problem when our queries are getting too long and too complex, – for example, when we use many logical operators or long phrases. When the standard head buffer is not enough you can resize it to meet your needs. To do that, you add the following line to the Jetty connector in the jetty.xml file. Of course the value shown in the example can be changed to the one that you need: <Set name="headerBufferSize">32768</Set> After adding the value, the connector definition should look more or less like the following snippet: <Call name="addConnector"> <Arg> <New class="org.mortbay.jetty.bio.SocketConnector"> <Set name="port"><SystemProperty name="jetty.port" default="8080"/></ Set> <Set name="maxIdleTime">50000</Set> <Set name="lowResourceMaxIdleTime">1500</Set> <Set name="headerBufferSize">32768</Set> </New> </Arg> </Call> Running Solr on Apache Tomcat Sometimes you need to choose a servlet container other than Jetty. Maybe because your client has other applications running on another servlet container, maybe because you just don't like Jetty. Whatever your requirements are that put Jetty out of the scope of your interest, the first thing that comes to mind is a popular and powerful servlet container – Apache Tomcat. This recipe will give you an idea of how to properly set up and run Solr in the Apache Tomcat environment. Getting ready First of all we need an Apache Tomcat servlet container. It can be found at the Apache Tomcat website – http://tomcat.apache.org. I concentrated on the Tomcat Version 7.x because at the time of writing of this book it was mature and stable. The version that I used during the writing of this recipe was Apache Tomcat 7.0.29, which was the newest one at the time. How to do it... To run Solr on Apache Tomcat we need to follow these simple steps: Firstly, you need to install Apache Tomcat. The Tomcat installation is beyond the scope of this book so we will assume that you have already installed this servlet container in the directory specified by the $TOMCAT_HOME system variable. The second step is preparing the Apache Tomcat configuration files. To do that we need to add the following inscription to the connector definition in the server.xml configuration file: URIEncoding="UTF-8" The portion of the modified server.xml file should look like the following code snippet: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" /> The third step is to create a proper context file. To do that, create a solr.xml file in the $TOMCAT_HOME/conf/Catalina/localhost directory. The contents of the file should look like the following code: <Context path="/solr" docBase="/usr/share/tomcat/webapps/solr.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="/ usr/share/solr/" override="true"/> </Context> The next thing is the Solr deployment. To do that we need the apache-solr-4.0.0.war file that contains the necessary files and libraries to run Solr that is to be copied to the Tomcat webapps directory and renamed solr.war. The one last thing we need to do is add the Solr configuration files. The files that you need to copy are files such as schema.xml, solrconfig.xml, and so on. Those files should be placed in the directory specified by the solr/home variable (in our case /usr/share/solr/). Please don't forget that you need to ensure the proper directory structure. If you are not familiar with the Solr directory structure please take a look at the example deployment that is provided with the standard Solr package. Please remember to preserve the directory structure you'll see in the example deployment, so for example, the /usr/share/solr directory should contain the solr.xml (and in addition zoo.cfg in case you want to use SolrCloud) file with the contents like so: <?xml version="1.0" encoding="UTF-8" ?> <solr persistent="true"> <cores adminPath="/admin/cores" defaultCoreName="collection1"> <core name="collection1" instanceDir="collection1" /> </cores> </solr> All the other configuration files should go to the /usr/share/solr/collection1/ conf directory (place the schema.xml and solrconfig.xml files there along with any additional configuration files your deployment needs). Your cores may have other names than the default collection1, so please be aware of that. Now we can start the servlet container, by running the following command: bin/catalina.sh start In the log file you should see a message like this: Info: Server startup in 3097 ms To ensure that Solr is running properly, you can run a browser and point it to an address where Solr should be visible, like the following: http://localhost:8080/solr/ If you see the page with links to administration pages of each of the cores defined, that means that your Solr is up and running. How it works... Let's start from the second step as the installation part is beyond the scope of this book. As you probably know, Solr uses UTF-8 file encoding. That means that we need to ensure that Apache Tomcat will be informed that all requests and responses made should use that encoding. To do that, we modified the server.xml file in the way shown in the example. The Catalina context file (called solr.xml in our example) says that our Solr application will be available under the /solr context (the path attribute). We also specified the WAR file location (the docBase attribute). We also said that we are not using debug (the debug attribute), and we allowed Solr to access other context manipulation methods. The last thing is to specify the directory where Solr should look for the configuration files. We do that by adding the solr/home environment variable with the value attribute set to the path to the directory where we have put the configuration files. The solr.xml file is pretty simple – there should be the root element called solr. Inside it there should be the cores tag (with the adminPath variable set to the address where the Solr cores administration API is available and the defaultCoreName attribute describing which is the default core). The cores tag is a parent for cores definition – each core should have its own core tag with a name attribute specifying the core name and the instanceDir attribute specifying the directory where the core-specific files will be available (such as the conf directory). The shell command that is shown starts Apache Tomcat. There are some other options of the catalina.sh (or catalina.bat) script; the descriptions of these options are as follows: stop: This stops Apache Tomcat restart: This restarts Apache Tomcat debug: This start Apache Tomcat in debug mode run: This runs Apache Tomcat in the current window, so you can see the output on the console from which you run Tomcat. After running the example address in the web browser, you should see a Solr front page with a core (or cores if you have a multicore deployment). Congratulations! You just successfully configured and ran the Apache Tomcat servlet container with Solr deployed. There's more... There are some other tasks that are common problems when running Solr on Apache Tomcat. Changing the port on which we see Solr running on Tomcat Sometimes it is necessary to run Apache Tomcat on a different port other than 8080, which is the default one. To do that, you need to modify the port variable of the connector definition in the server.xml file located in the $TOMCAT_HOME/conf directory. If you would like your Tomcat to run on port 9999, this definition should look like the following code snippet: <Connector port="9999" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" /> While the original definition looks like the following snippet: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" /> Installing a standalone ZooKeeper You may know that in order to run SolrCloud—the distributed Solr installation–you need to have Apache ZooKeeper installed. Zookeeper is a centralized service for maintaining configurations, naming, and provisioning service synchronization. SolrCloud uses ZooKeeper to synchronize configuration and cluster states (such as elected shard leaders), and that's why it is crucial to have a highly available and fault tolerant ZooKeeper installation. If you have a single ZooKeeper instance and it fails then your SolrCloud cluster will crash too. So, this recipe will show you how to install ZooKeeper so that it's not a single point of failure in your cluster configuration. Getting ready The installation instruction in this recipe contains information about installing ZooKeeper Version 3.4.3, but it should be useable for any minor release changes of Apache ZooKeeper. To download ZooKeeper please go to http://zookeeper.apache.org/releases.html This recipe will show you how to install ZooKeeper in a Linux-based environment. You also need Java installed. How to do it... Let's assume that we decided to install ZooKeeper in the /usr/share/zookeeper directory of our server and we want to have three servers (with IP addresses 192.168.1.1, 192.168.1.2, and 192.168.1.3) hosting the distributed ZooKeeper installation. After downloading the ZooKeeper installation, we create the necessary directory: sudo mkdir /usr/share/zookeeper Then we unpack the downloaded archive to the newly created directory. We do that on three servers. Next we need to change our ZooKeeper configuration file and specify the servers that will form the ZooKeeper quorum, so we edit the /usr/share/zookeeper/conf/ zoo.cfg file and we add the following entries: clientPort=2181 dataDir=/usr/share/zookeeper/data tickTime=2000 initLimit=10 syncLimit=5 server.1=192.168.1.1:2888:3888 server.2=192.168.1.2:2888:3888 server.3=192.168.1.3:2888:3888 And now, we can start the ZooKeeper servers with the following command: /usr/share/zookeeper/bin/zkServer.sh start If everything went well you should see something like the following: JMX enabled by default Using config: /usr/share/zookeeper/bin/../conf/zoo.cfg Starting zookeeper ... STARTED And that's all. Of course you can also add the ZooKeeper service to start automatically during your operating system startup, but that's beyond the scope of the recipe and the book itself. How it works... Let's skip the first part, because creating the directory and unpacking the ZooKeeper server there is quite simple. What I would like to concentrate on are the configuration values of the ZooKeeper server. The clientPort property specifies the port on which our SolrCloud servers should connect to ZooKeeper. The dataDir property specifies the directory where ZooKeeper will hold its data. So far, so good right ? So now, the more advanced properties; the tickTime property specified in milliseconds is the basic time unit for ZooKeeper. The initLimit property specifies how many ticks the initial synchronization phase can take. Finally, the syncLimit property specifies how many ticks can pass between sending the request and receiving an acknowledgement. There are also three additional properties present, server.1, server.2, and server.3. These three properties define the addresses of the ZooKeeper instances that will form the quorum. However, there are three values separated by a colon character. The first part is the IP address of the ZooKeeper server, and the second and third parts are the ports used by ZooKeeper instances to communicate with each other.
Read more
  • 0
  • 0
  • 3533

article-image-getting-started-innodb
Packt
19 Feb 2013
9 min read
Save for later

Getting Started with InnoDB

Packt
19 Feb 2013
9 min read
(For more resources related to this topic, see here.) Basic features of InnoDB InnoDB is more than a fast disk-based relational database engine. It offers, at its core, the following features that separate it from other disk-based engines: MVCC ACID compliance Transaction support Row-level locking These features are responsible for providing what is known as Referential integrity; a core requirement for enterprise database applications. Referential integrity Referential integrity can be best thought of as the ability for the database application to store relational data in multiple tables with consistency. If a database lacks consistency between relational data, the data cannot be relied upon for applications. If, for example, an application stores financial transactions where monetary data is processed, referential integrity and consistency of transactional data is a key component. Financial data is not the only case where this is an important feature, as many applications store and process sensitive data that must be consistent Multiversion concurrency control A vital component is Multiversion concurrency control (MVCC), which is a control process used by databases to ensure that multiple concurrent connections can see and access consistent states of data over time. A common scenario relying on MVCC can be thought of as follows: data exists in a table and an application connection accesses that data, then a second connection accesses the same original data set while the first connection is making changes to it; since the first connection has not finalized its changes and committed its information we don't want the second connection to see the nonfinalized data. Thus two versions of the data exist at the same time—multiple versions—to allow the database to control the concurrent state of the data. MVCC also provides for the existence of point-in-time consistent views, where multiple versions of data are kept and are available for access based on their point-in-time existence. Transaction isolation Transaction support at the database level refers to the ability for units of work to be processed in separate units of execution from others. This isolation of data execution allows each database connection to manipulate, read, and write information at the same time without conflicting with each other. Transactions allow connections to operate on data on an all-or-nothing operation, so that if the transaction completes successfully it will be written to disk and recorded for upcoming transactions to then operate on. However, if the sequence of changes to the data in the transaction process do not complete then they can be rolled back, and no changes will be recorded to disk. This allows sequences of execution that contain multiple steps to fully succeed only if all of the changes complete, and to roll back any changed data to its original state if one or more of the sequence of changes in the transaction fail. This feature guarantees that the data remains consistent and referentially safe. ACID compliance An integral part of InnoDB is its ability to ensure that data is atomic, consistent, isolated, and durable; these features make up components of ACID compliance. Simply put, atomicity requires that if a transaction fails then the changes are rolled back and not committed. Consistency requires that each successfully executed transaction will move the database ahead in time from one state to the next in a consistent manner without errors or data integrity issues. Isolation defines that each transaction will see separate sets of data in time and not conflict with other transactional data access. Finally, the durability clause ensures that any data that has been committed in a successful transaction will be written to disk in its final state, without the risk of data loss from errors or system failure, and will then be available to transactions that come in the future. Locking characteristics Finally, InnoDB differs from other on-disk storage engines in that it offers row-level locking. This primarily differs, in the MySQL world, with the MyISAM storage engine which features table-level locking. Locking refers to an internal operation of the database that prohibits reading or writing of table data by connections if another is currently using that data. This prevents concurrent connections from causing data corruption or forcing data invalidation when data is in use. The primary difference between table- and row-level locking is that when a connection requests data from a table it can either lock the row of data being accessed or the whole table of data being accessed. For performance and concurrency benefits, row-level locking excels. System requirements and supported platforms InnoDB can be used on all platforms on which MySQL can be installed. These include: Linux: RPM, Deb, Tar BSDs: FreeBSD, OpenBSD, NetBSD Solaris and OpenSolaris / Illumos: SPARC + Intel IBM AIX HP-UX Mac OSX Windows 32 bit and 64 bit There are also custom ports of MySQL from the open source community for running MySQL on various embedded platforms and non-standard operating systems. Hardware-wise, MySQL and correspondingly InnoDB, will run on a wide variety of hardware, which at the time of this writing includes: Intel x86 32 bit AMD/Intel x 86_64 Intel Itanium IA-64 IBM Power architecture Apple's PPC PA-RISC 1.0 + 2.0 SPARC 32 + 64 bit Keep in mind when installing and configuring InnoDB, depending on the architecture in which it is installed, it will have certain options available and enabled that are not available on all platforms. In addition to the underlying hardware, the operating system will also determine whether certain configuration options are available and the range to which some variables can be set. One of the more decisively important differences to be considered while choosing an operating system for your database server is the manner in which the operating system and underlying filesystem handles write caching and write flushes to the disk storage subsystem. These operating system abilities can cause a dramatic difference in the performance of InnoDB, often to the order of 10 times the concurrency ability. When reading the MySQL documentation you may find that InnoDB has over fifty-eight configuration settings, more or less depending on the version, for tuning the performance and operational defaults. The majority of these default settings can be left alone for development and production server environments. However, there are several core settings that can affect great change, in either positive or negative directions depending on the application workload and hardware resource limits, with which every MySQL database administrator should be familiar and proficient. Keep in mind when setting values that some variables are considered dynamic while others are static; dynamic variables can be changed during runtime and do not require a process restart while static variables can only be changed prior to process start, so any changes made to static variables during runtime will only take effect upon the next restart of the database server process. Dynamic variables can be changed on the MySQL command line via the following command: mysql> SET GLOBAL [variable]=[value]; If a value is changed on the command line, it should also be updated in the global my.cnf configuration file so that the change is applied during each restart. MySQL memory allocation equations Before tuning any InnoDB configuration settings—memory buffers in particular—we need to understand how MySQL allocates memory to various areas of the application that handles RAM. There are two simple equations for referencing total memory usage that allocate memory based on incoming client connections: Per-thread buffers: Per-thread buffers, also called per-connection buffers since MySQL uses a separate thread for each connection, operate in contrast to global buffers in that per-thread buffers only allocate memory when a connection is made and in some cases will only allocate as much memory as the connection's workload requires, thus not necessarily utilizing the entire size of the allowable buffer. This memory utilization method is described in the MySQL manual as follows: Each client thread is associated with a connection buffer and a result buffer. Both begin with a size given by net_buffer_length but are dynamically enlarged up to max_allowed_packet bytes as needed. The result buffer shrinks to net_buffer_length after each SQL statement. Global buffers: Global buffers are allocated memory resources regardless of the number of connections being handled. These buffers request their memory requirements during the startup process and retain this reservation of resources until the server process has ended. When allocating memory to MySQL buffers we need to ensure that there is also enough RAM available for the operating system to perform its tasks and processes; in general it is a best practice to limit MySQL between 85 to 90 percent allocation of total system RAM. The memory utilization equations for each of the buffers is given as follows: Per-thread Buffer memory utilization equation: (read_buffer_size + read_rnd_buffer_size + sort_buffer_size + thread_stack + join_buffer_size + binlog_cache_size) * max_connections = total memory allocation for all connections, or MySQL Thread Buffers (MTB) Global Buffer memory utilization equation: innodb_buffer_pool_size + innodb_additional_mem_pool_size + innodb_ log_buffer_size + key_buffer_size + query_cache_size = total memory used by MySQL Global Buffers (MGB) Total memory allocation equation: MTB + MGB = Total Memory Used by MySQL If the total memory used by the combination of MTB and MGB is greater than 85 to 90 percent of the total system RAM then you may experience resource contention, a resource bottleneck, or in the worst case you will see memory pages swapping to on-disk resources (virtual memory) which results in performance degradation and, in some cases, process failure or connection timeouts. Therefore it is wise to check memory allocation via the equations mentioned previously before making changes to the memory buffers or increasing the value of max_connections to the database. More information about how MySQL manages memory and threads can be read about in the following pages of the MySQL documentation: http://dev.mysql.com/doc/refman/5.5/en/connection-threads.html http://dev.mysql.com/doc/refman/5.5/en/memory-use.html Summary This article provided a quick overview of the core terminology and basic features, system requirements, and a few memory allocation equations. Resources for Article : Further resources on this subject: Configuring MySQL [Article] Optimizing your MySQL Servers' performance using Indexes [Article] Indexing in MySQL Admin [Article]
Read more
  • 0
  • 0
  • 1891

article-image-using-pvr-raspbmc
Packt
18 Feb 2013
9 min read
Save for later

Using PVR with Raspbmc

Packt
18 Feb 2013
9 min read
(For more resources related to this topic, see here.) What is PVR? Personal Video Recording (PVR), with a TV tuner, allows you to record as well as watch Live TV. Recordings can be scheduled manually based on a time, or with the help of the TV guide, which can be downloaded from the TV provider (by satellite/aerial or cable), or from a content information provider, such as Radio Times via the Internet. Not only does PVR allow you to watch Live TV, but on capable backends (we'll look at what a backend is in a moment), it allows you to rewind and pause live TV. A single tuner allows you to tune into one channel at once, while two tuners would allow you to tune into two. As such, it's important to note that the capabilities listed earlier are not mutually exclusive, that is, with enough tuners it is possible to record one channel while watching another. This may, depending on the software you use as a backend, be possible on one tuner, if the two channels are on the same multiplexer. Raspbmc's role in PVR Raspbmc can function as both a PVR backend and a frontend. For PVR support in XBMC, it is necessary to have both a backend and one or more frontends. Let's see what a backend and frontend is: Backend: A backend is the part that tunes the channel, records your scheduled programs, and serves those channels and recorded television to the frontends. One backend can serve multiple frontends, if it is sufficiently powerful enough and there are enough tuners available. Frontend: A frontend is the part that receives content from the backend and plays back live television and recorded programs to the user. In the case of Raspbmc, XBMC serves as the frontend and allows us to play back the content. Multiple frontends can connect to one or more backends. This means that we can have several installations of Raspbmc play broadcast content from even a single tuner. As we've now learned, Raspbmc has a built-in PVR frontend in the form of XBMC. However, it also has a built-in backend. This backend is TVHeadend, and we'll look at getting that up and running shortly. Standalone backend versus built-in backend There are cases when it is more favorable to use an external, or standalone, backend rather than the one that ships with Raspbmc itself. Outlined as follows is a comparison: Standalone backend Raspbmc backend (TVHeadend) A better choice if you do not find TVHeadend feature-rich or prefer another backend. If you only intend to have one frontend, it makes sense to run everything off the same device, rather than relying on an external system. If you have a pre-existing backend, it is easier to configure Raspbmc to use that, rather than reconfiguring it completely. The process may be simplified for you as, generally, one can just connect their device and it will be detected in TVHeadend. If you are planning on having multiple frontends, it is more sensible to have a standalone backend. This is to ensure that the computer has enough horsepower, and also, you can serve from the same computer you are serving files from, and thus, only need one device on, rather than two (the streaming machine and the Pi). Raspbmc's auto-update system covers the backend that is included as well. This means you will always have a reliable and stable version of TVHeadend bundled with Raspbmc and you need not worry about having to update it to get new features. If you need to use a PCI or PCI expressbased tuner, you will need to use an external backend due to limitations of the Pi's connectivity. Better for wireless media centers. If you have low bandwidth throughput, then running the tuner locally on the Raspberry Pi makes more sense as it does not rely on any transfers between the network (unless using HDHomeRun). Setting up PVR We will now look at how to set up a PVR. This will include configuring the backend as well as getting it running in XBMC. An external backend The purpose of this title is to focus on the Raspberry Pi, and as there is a great variety of PVR software available, it would be implausible to cover the many options. If you are planning on using an external backend, it is recommended that you thoroughly search for information on the Internet. There are even books for popular and comprehensive PVR packages, such as MythTV. TVHeadend was chosen for Raspbmc because it is lightweight and easy to manage. Raspbmc's XBMC build will support the following backends at the time of writing: MythTV TVHeadend ForTheRecord/Argus TV MediaPortal Njoy N7 NextPVR VU+/Enigma DVBViewer VDR Setting up TVHeadend in Raspbmc It should be noted that not all TV tuners will work on your device. Due to the fact that the list changes frequently, it is not possible to list here the devices that work on the Raspberry Pi. However, the most popular tuners used with Raspbmc are AF90015 based. HDHomerun tuners by SilliconDust are supported as well (note that these tuners do not connect to your Pi directly, but are accessed through the network). With the right kernel modules, TVHeadend can support DVB-T (digital terrestrial), DVB-S (satellite), and DVB-C (cable) based tuners. By default, the TVHeadend service is disabled in Raspbmc. We'll need to enable it as follows: Go to Raspbmc Settings—we did this before by selecting it from the Programs menu. Under the System Configuration tab, check the TVHeadend server radio button found under the Service Management category. Click on OK to save your settings. Now that the TVHeadend is running, we can now access its management page by going to http://192.168.1.5:9981. You should substitute the preceding IP address, 192.168.1.5, with the actual IP address of the Raspberry Pi. You will be greeted with an interface much akin to the following screenshot: In the preceding screenshot we see that there are three main tabs available. They are as follows: Electronic Program Guide: This shows us what is being broadcast on each channel. It is empty in the preceding screenshot because we've not scanned and added any channels. Digital Video Recorder: This will allow you to schedule recordings of TV channels as well as use the Automatic recorder functionality, which can allow you to create powerful rules for automatic recording. You can also schedule recordings in XBMC; however, doing so via the web interface is probably more flexible. Configuration: This is where you can configure the EPG source, choose where recordings are saved, manage access to the backend, and manage tuners. The Electronic Program Guide and Digital Video Recorder tabs are intuitive and simple so we will instead look at the Configuration section. Our first step in configuring a tuner is to head over to TV Adapters: As shown in the preceding screenshot, TV tuners should automatically be detected and selectable in the drop-down menu (highlighted here). On the right, a box entitled Adapter Configuration can be used for adjusting the tuner's parameters. Now, we need to select the Add DVB Network by location option. The following dialog box will appear: Once we have defined the region we are in, TVHeadend will automatically begin scanning for new services on the correct frequencies. These services can be mapped to channels by selecting the Map DVB services to channels button as shown earlier. We are now ready to connect to the backend in XBMC. Connecting to our backend in XBMC Regardless of whether we have used Raspbmc's built-in backend or an external one, the process for connecting to it in XBMC is very much the same. We need to do the following: In XBMC, go to System | Settings | Add-ons | Disabled Add-ons | PVR clients. You will now see the following screenshot: Select the type of backend that you would like to connect to. You will then see a dialog allowing you to configure or enable the add-on. Select Configure and fill out the necessary connection details. Note that if you are connecting to the Raspbmc built-in backend, select the TVHeadend client to configure. The default settings will suffice: Click on OK to save these settings and select Enable. Note that the add-on is now located in System | Settings | Add-ons | Enabled add-ons | PVR clients rather than Disabled add-ons | PVR clients. Now, we need to go into Settings | System | Live TV. This allows you to configure a host of options related to Live TV. The most important one is the Enable Live TV option—be sure to check this box! Now, if we go back to the main menu, we'll see a Live TV option. Your channel information will be there already, although, like the instance shown as follows, it may need a bit of renaming: The following screenshot shows us a sample electronic program guide: Simply select a channel and press Play! The functionality that PVR offers is controlled in a similar manner to XBMC, so this won't be covered in this article. If you have got this far, you've done the hard part already. Summary We've now covered what PVR can do for us, the differences between a frontend and backend, and where a remote backend may be more suitable than the one Raspbmc has built in. We then covered how to connect to that backend in XBMC and play back content from it. Resources for Article : Further resources on this subject: Adding Pages, Image Gallery, and Plugins to a WordPress Blog [Article] Building a CRUD Application with the ZK Framework [Article] Playback Audio with Video and Create a Media Playback Component Using JavaFX [Article]
Read more
  • 0
  • 0
  • 8329

article-image-applications-physics
Packt
18 Feb 2013
16 min read
Save for later

Applications of Physics

Packt
18 Feb 2013
16 min read
(For more resources related to this topic, see here.) Introduction to the Box2D physics extension Physics-based games are one of the most popular types of games available for mobile devices. AndEngine allows the creation of physics-based games with the Box2D extension. With this extension, we can construct any type of physically realistic 2D environment from small, simple simulations to complex games. In this recipe, we will create an activity that demonstrates a simple setup for utilizing the Box2D physics engine extension. Furthermore, we will use this activity for the remaining recipes in this article. Getting ready... First, create a new activity class named PhysicsApplication that extends BaseGameActivity and implements IAccelerationListener and IOnSceneTouchListener. How to do it... Follow these steps to build our PhysicsApplication activity class: Create the following variables in the class: public static int cameraWidth = 800; public static int cameraHeight = 480; public Scene mScene; public FixedStepPhysicsWorld mPhysicsWorld; public Body groundWallBody; public Body roofWallBody; public Body leftWallBody; public Body rightWallBody; We need to set up the foundation of our activity. To start doing so, place these four, common overridden methods in the class to set up the engine, resources, and the main scene: @Override public Engine onCreateEngine(final EngineOptions pEngineOptions) { return new FixedStepEngine(pEngineOptions, 60); } @Override public EngineOptions onCreateEngineOptions() { EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new FillResolutionPolicy(), new Camera(0,0, cameraWidth, cameraHeight)); engineOptions.getRenderOptions().setDithering(true); engineOptions.getRenderOptions(). getConfigChooserOptions() .setRequestedMultiSampling(true); engineOptions.setWakeLockOptions( WakeLockOptions.SCREEN_ON); return engineOptions; } @Override public void onCreateResources(OnCreateResourcesCallback pOnCreateResourcesCallback) { pOnCreateResourcesCallback. onCreateResourcesFinished(); } @Override public void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback) { mScene = new Scene(); mScene.setBackground(new Background(0.9f,0.9f,0.9f)); pOnCreateSceneCallback.onCreateSceneFinished(mScene); } Continue setting up the activity by adding the following overridden method, which will be used to populate our scene: @Override public void onPopulateScene(Scene pScene, OnPopulateSceneCallback pOnPopulateSceneCallback) { } Next, we will fill the previous method with the following code to create our PhysicsWorld object and Scene object: mPhysicsWorld = new FixedStepPhysicsWorld(60, new Vector2(0f,-SensorManager.GRAVITY_EARTH*2), false, 8, 3); mScene.registerUpdateHandler(mPhysicsWorld); final FixtureDef WALL_FIXTURE_DEF = PhysicsFactory.createFixtureDef(0, 0.1f, 0.5f); final Rectangle ground = new Rectangle(cameraWidth / 2f, 6f, cameraWidth - 4f, 8f, this.getVertexBufferObjectManager()); final Rectangle roof = new Rectangle(cameraWidth / 2f, cameraHeight – 6f, cameraWidth - 4f, 8f, this.getVertexBufferObjectManager()); final Rectangle left = new Rectangle(6f, cameraHeight / 2f, 8f, cameraHeight - 4f, this.getVertexBufferObjectManager()); final Rectangle right = new Rectangle(cameraWidth - 6f, cameraHeight / 2f, 8f, cameraHeight - 4f, this.getVertexBufferObjectManager()); ground.setColor(0f, 0f, 0f); roof.setColor(0f, 0f, 0f); left.setColor(0f, 0f, 0f); right.setColor(0f, 0f, 0f); groundWallBody = PhysicsFactory.createBoxBody( this.mPhysicsWorld, ground, BodyType.StaticBody, WALL_FIXTURE_DEF); roofWallBody = PhysicsFactory.createBoxBody( this.mPhysicsWorld, roof, BodyType.StaticBody, WALL_FIXTURE_DEF); leftWallBody = PhysicsFactory.createBoxBody( this.mPhysicsWorld, left, BodyType.StaticBody, WALL_FIXTURE_DEF); rightWallBody = PhysicsFactory.createBoxBody( this.mPhysicsWorld, right, BodyType.StaticBody, WALL_FIXTURE_DEF); this.mScene.attachChild(ground); this.mScene.attachChild(roof); this.mScene.attachChild(left); this.mScene.attachChild(right); // Further recipes in this chapter will require us to place code here. mScene.setOnSceneTouchListener(this); pOnPopulateSceneCallback.onPopulateSceneFinished(); The following overridden activities handle the scene touch events, the accelerometer input, and the two engine life cycle events—onResumeGame and onPauseGame. Place them at the end of the class to finish this recipe: @Override public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) { // Further recipes in this chapter will require us to place code here. return true; } @Override public void onAccelerationAccuracyChanged( AccelerationData pAccelerationData) {} @Override public void onAccelerationChanged( AccelerationData pAccelerationData) { final Vector2 gravity = Vector2Pool.obtain( pAccelerationData.getX(), pAccelerationData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } @Override public void onResumeGame() { super.onResumeGame(); this.enableAccelerationSensor(this); } @Override public void onPauseGame() { super.onPauseGame(); this.disableAccelerationSensor(); } How it works... The first thing that we do is define a camera width and height. Then, we define a Scene object and a FixedStepPhysicsWorld object in which the physics simulations will take place. The last set of variables defines what will act as the borders for our physics-based scenes. In the second step, we override the onCreateEngine() method to return a FixedStepEngine object that will process 60 updates per second. The reason that we do this, while also using a FixedStepPhysicsWorld object, is to create a simulation that will be consistent across all devices, regardless of how efficiently a device can process the physics simulation. We then create the EngineOptions object with standard preferences, create the onCreateResources() method with only a simple callback, and set the main scene with a light-gray background. In the onPopulateScene() method, we create our FixedStepPhysicsWorld object that has double the gravity of the Earth, passed as an (x,y) coordinate Vector2 object, and will update 60 times per second. The gravity can be set to other values to make our simulations more realistic or 0 to create a zero gravity simulation. A gravity setting of 0 is useful for space simulations or for games that use a top-down camera view instead of a profile. The false Boolean parameter sets the AllowSleep property of the PhysicsWorld object, which tells PhysicsWorld to not let any bodies deactivate themselves after coming to a stop. The last two parameters of the FixedStepPhysicsWorld object tell the physics engine how many times to calculate velocity and position movements. Higher iterations will create simulations that are more accurate, but can cause lag or jitteriness because of the extra load on the processor. After creating the FixedStepPhysicsWorld object, we register it with the main scene as an update handler. The physics world will not run a simulation without being registered. The variable WALL_FIXTURE_DEF is a fixture definition. Fixture definitions hold the shape and material properties of entities that will be created within the physics world as fixtures. The shape of a fixture can be either circular or polygonal. The material of a fixture is defined by its density, elasticity, and friction, all of which are required when creating a fixture definition. Following the creation of the WALL_FIXTURE_DEF variable, we create four rectangles that will represent the locations of the wall bodies. A body in the Box2D physics world is made of fixtures. While only one fixture is necessary to create a body, multiple fixtures can create complex bodies with varying properties. Further along in the onPopulateScene() method, we create the box bodies that will act as our walls in the physics world. The rectangles that were previously created are passed to the bodies to define their position and shape. We then define the bodies as static, which means that they will not react to any forces in the physics simulation. Lastly, we pass the wall fixture definition to the bodies to complete their creation. After creating the bodies, we attach the rectangles to the main scene and set the scene's touch listener to our activity, which will be accessed by the onSceneTouchEvent() method. The final line of the onPopulateScene() method tells the engine that the scene is ready to be shown. The overridden onSceneTouchEvent() method will handle all touch interactions for our scene. The onAccelerationAccuracyChanged() and onAccelerationChanged() methods are inherited from the IAccelerationListener interface and allow us to change the gravity of our physics world when the device is tilted, rotated, or panned. We override onResumeGame() and onPauseGame() to keep the accelerometer from using unnecessary battery power when our game activity is not in the foreground. There's more... In the overridden onAccelerationChanged() method, we make two calls to the Vector2Pool class. The Vector2Pool class simply gives us a way of re-using our Vector2 objects that might otherwise require garbage collection by the system. On newer devices, the Android Garbage Collector has been streamlined to reduce noticeable hiccups, but older devices might still experience lag depending on how much memory the variables being garbage collected occupy. Visit http://www.box2d.org/manual.htmlto see the Box2D User Manual. The AndEngine Box2D extension is based on a Java port of the official Box2D C++ physics engine, so some variations in procedure exist, but the general concepts still apply. See also Understanding different body types in this article. Understanding different body types The Box2D physics world gives us the means to create different body types that allow us to control the physics simulation. We can generate dynamic bodies that react to forces and other bodies, static bodies that do not move, and kinematic bodies that move but are not affected by forces or other bodies. Choosing which type each body will be is vital to producing an accurate physics simulation. In this recipe, we will see how three bodies react to each other during collision, depending on their body types. Getting ready... Follow the recipe in the Introduction to the Box2D physics extension section given at the beginning of this article to create a new activity that will facilitate the creation of our bodies with varying body types. How to do it... Complete the following steps to see how specifying a body type for bodies affects them: First, insert the following fixture definition into the onPopulateScene() method: FixtureDef BoxBodyFixtureDef = PhysicsFactory.createFixtureDef(20f, 0f, 0.5f); Next, place the following code that creates three rectangles and their corresponding bodies after the fixture definition from the previous step: Rectangle staticRectangle = new Rectangle(cameraWidth / 2f,75f,400f,40f,this.getVertexBufferObjectManager()); staticRectangle.setColor(0.8f, 0f, 0f); mScene.attachChild(staticRectangle); PhysicsFactory.createBoxBody(mPhysicsWorld, staticRectangle, BodyType.StaticBody, BoxBodyFixtureDef); Rectangle dynamicRectangle = new Rectangle(400f, 120f, 40f, 40f, this.getVertexBufferObjectManager()); dynamicRectangle.setColor(0f, 0.8f, 0f); mScene.attachChild(dynamicRectangle); Body dynamicBody = PhysicsFactory.createBoxBody(mPhysicsWorld, dynamicRectangle, BodyType.DynamicBody, BoxBodyFixtureDef); mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector( dynamicRectangle, dynamicBody); Rectangle kinematicRectangle = new Rectangle(600f, 100f, 40f, 40f, this.getVertexBufferObjectManager()); kinematicRectangle.setColor(0.8f, 0.8f, 0f); mScene.attachChild(kinematicRectangle); Body kinematicBody = PhysicsFactory.createBoxBody(mPhysicsWorld, kinematicRectangle, BodyType.KinematicBody, BoxBodyFixtureDef); mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector( kinematicRectangle, kinematicBody); Lastly, add the following code after the definitions from the previous step to set the linear and angular velocities for our kinematic body: kinematicBody.setLinearVelocity(-2f, 0f); kinematicBody.setAngularVelocity((float) (-Math.PI)); How it works... In the first step, we create the BoxBodyFixtureDef fixture definition that we will use when creating our bodies in the second step. For more information on fixture definitions, see the Introduction to the Box2D physics extension recipe in this article. In step two, we first define the staticRectangle rectangle by calling the Rectangle constructor. We place staticRectangle at the position of cameraWidth / 2f, 75f, which is near the lower-center of the scene, and we set the rectangle to have a width of 400f and a height of 40f, which makes the rectangle into a long, flat bar. Then, we set the staticRectangle rectangle's color to be red by calling staticRectangle. setColor(0.8f, 0f, 0f). Lastly, for the staticRectangle rectangle, we attach it to the scene by calling the mScene.attachChild() method with staticRectangle as the parameter. Next, we create a body in the physics world that matches our staticRectangle. To do this, we call the PhysicsFactory.createBoxBody() method with the parameters of mPhysicsWorld, which is our physics world, staticRectangle to tell the box to be created with the same position and size as the staticRectangle rectangle, BodyType. StaticBody to define the body as static, and our BoxBodyFixtureDef fixture definition. Our next rectangle, dynamicRectangle, is created at the location of 400f and 120f, which is the middle of the scene slightly above the staticRectangle rectangle. Our dynamicRectangle rectangle's width and height are set to 40f to make it a small square. Then, we set its color to green by calling dynamicRectangle.setColor(0f, 0.8f, 0f) and attach it to our scene using mScene.attachChild(dynamicRectangle). Next, we create the dynamicBody variable using the PhysicsFactory.createBoxBody() method in the same way that we did for our staticRectangle rectangle. Notice that we set the dynamicBody variable to have BodyType of DynamicBody. This sets the body to be dynamic. Now, we register PhysicsConnector with the physics world to link dynamicRectangle and dynamicBody. A PhysicsConnecter class links an entity within our scene to a body in the physics world, representing the body's realtime position and rotation in our scene. Our last rectangle, kinematicRectangle, is created at the location of 600f and 100f, which places it on top of our staticRectangle rectangle toward the right-hand side of the scene. It is set to have a height and width of 40f, which makes it a small square like our dynamicRectangle rectangle. We then set the kinematicRectangle rectangle's color to yellow and attach it to our scene. Similar to the previous two bodies that we created, we call the PhysicsFactory.createBoxBody() method to create our kinematicBody variable. Take note that we create our kinematicBody variable with a BodyType type of KinematicBody. This sets it to be kinematic and thus moved only by the setting of its velocities. Lastly, we register a PhysicsConnector class between our kinematicRectangle rectangle and our kinematicBody body type. In the last step, we set our kinematicBody body's linear velocity by calling the setLinearVelocity() method with a vector of -2f on the x axis, which makes it move to the left. Finally, we set our kinematicBody body's angular velocity to negative pi by calling kinematicBody.setAngularVelocity((float) (-Math.PI)). For more information on setting a body's velocities, see the Using forces, velocities, and torque recipe in this article. There's more... Static bodies cannot move from applied or set forces, but can be relocated using the setTransform() method. However, we should avoid using the setTransform() method while a simulation is running, because it makes the simulation unstable and can cause some strange behaviors. Instead, if we want to change the position of a static body, we can do so whenever creating the simulation or, if we need to change the position at runtime, simply check that the new position will not cause the static body to overlap existing dynamic bodies or kinematic bodies. Kinematic bodies cannot have forces applied, but we can set their velocities via the setLinearVelocity() and setAngularVelocity() methods. See also Introduction to the Box2D physics extension in this article. Using forces, velocities, and torque in this article. Creating category-filtered bodies Depending on the type of physics simulation that we want to achieve, controlling which bodies are capable of colliding can be very beneficial. In Box2D, we can assign a category, and category-filter to fixtures to control which fixtures can interact. This recipe will cover the defining of two category-filtered fixtures that will be applied to bodies created by touching the scene to demonstrate category-filtering. Getting ready... Create an activity by following the steps in the Introduction to the Box2D physics extension section given at the beginning of the article. This activity will facilitate the creation of the category-filtered bodies used in this section. How to do it... Follow these steps to build our category-filtering demonstration activity: Define the following class-level variables within the activity: private int mBodyCount = 0; public static final short CATEGORYBIT_DEFAULT = 1; public static final short CATEGORYBIT_RED_BOX = 2; public static final short CATEGORYBIT_GREEN_BOX = 4; public static final short MASKBITS_RED_BOX = CATEGORYBIT_DEFAULT + CATEGORYBIT_RED_BOX; public static final short MASKBITS_GREEN_BOX = CATEGORYBIT_DEFAULT + CATEGORYBIT_GREEN_BOX; public static final FixtureDef RED_BOX_FIXTURE_DEF = PhysicsFactory.createFixtureDef(1, 0.5f, 0.5f, false, CATEGORYBIT_RED_BOX, MASKBITS_RED_BOX, (short)0); public static final FixtureDef GREEN_BOX_FIXTURE_DEF = PhysicsFactory.createFixtureDef(1, 0.5f, 0.5f, false, CATEGORYBIT_GREEN_BOX, MASKBITS_GREEN_BOX, (short)0); Next, create this method within the class that generates new category-filtered bodies at a given location: private void addBody(final float pX, final float pY) { this.mBodyCount++; final Rectangle rectangle = new Rectangle(pX, pY, 50f, 50f, this.getVertexBufferObjectManager()); rectangle.setAlpha(0.5f); final Body body; if(this.mBodyCount % 2 == 0) { rectangle.setColor(1f, 0f, 0f); body = PhysicsFactory.createBoxBody(this.mPhysicsWorld, rectangle, BodyType.DynamicBody, RED_FIXTURE_DEF); } else { rectangle.setColor(0f, 1f, 0f); body = PhysicsFactory.createBoxBody(this.mPhysicsWorld, rectangle, BodyType.DynamicBody, GREEN_FIXTURE_DEF); } this.mScene.attachChild(rectangle); this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector( rectangle, body, true, true)); } Lastly, fill the body of the onSceneTouchEvent() method with the following code that calls the addBody() method by passing the touched location: if(this.mPhysicsWorld != null) if(pSceneTouchEvent.isActionDown()) this.addBody(pSceneTouchEvent.getX(), pSceneTouchEvent.getY()); How it works... In the first step, we create an integer, mBodyCount, which counts how many bodies we have added to the physics world. The mBodyCount integer is used in the second step to determine which color, and thus which category, should be assigned to the new body. We also create the CATEGORYBIT_DEFAULT, CATEGORYBIT_RED_BOX, and CATEGORYBIT_ GREEN_BOX category bits by defining them with unique power-of-two short integers and the MASKBITS_RED_BOX and MASKBITS_GREEN_BOX mask bits by adding their associated category bits together. The category bits are used to assign a category to a fixture, while the mask bits combine the different category bits to determine which categories a fixture can collide with. We then pass the category bits and mask bits to the fixture definitions to create fixtures that have category collision rules. The second step is a simple method that creates a rectangle and its corresponding body. The method takes the X and Y location parameters that we want to use to create a new body and passes them to a Rectangle object's constructor, to which we also pass a height and width of 50f and the activity's VertexBufferObjectManager. Then, we set the rectangle to be 50 percent transparent using the rectangle.setAlpha() method. After that, we define a body and modulate the mBodyCount variable by 2 to determine the color and fixture of every other created body. After determining the color and fixture, we assign them by setting the rectangle's color and creating a body by passing our mPhysicsWorld physics world, the rectangle, a dynamic body type, and the previously-determined fixture to use. Finally, we attach the rectangle to our scene and register a PhysicsConnector class to connect the rectangle to our body. The third step calls the addBody() method from step two only if the physics world has been created and only if the scene's TouchEvent is ActionDown. The parameters that are passed, pSceneTouchEvent.getX() and pSceneTouchEvent.getY(), represent the location on the scene that received a touch input, which is also the location where we want to create a new category-filtered body. There's more... The default category of all fixtures has a value of one. When creating mask bits for specific fixtures, remember that any combination that includes the default category will cause the fixture to collide with all other fixtures that are not masked to avoid collision with the fixture. See also Introduction to the Box2D physics extension in this article. Understanding different body types in this article.
Read more
  • 0
  • 0
  • 5978

article-image-introduction-risk-analysis
Packt
18 Feb 2013
21 min read
Save for later

An Introduction to Risk Analysis

Packt
18 Feb 2013
21 min read
(For more resources related to this topic, see here.) Risk analysis First, we must understand what risk is, how it is calculated, and then implement a solution to mitigate or reduce the calculated risk. At this point in the process of developing agile security architecture, we have already defined our data. The following sections assume we know what the data is, just not the true impact to the enterprise if a threat is realized. What is risk analysis? Simply stated, risk analysis is the process of assessing the components of risk; threats, impact, and probability as it relates to an asset, in our case enterprise data. To ascertain risk, the probability of impact to enterprise data must first be calculated. A simple risk analysis output may be the decision to spend capital to protect an asset based on value of the asset and the scope of impact if the risk is not mitigated. This is the most general form of risk analysis, and there are several methods that can be applied to produce a meaningful output. Risk analysis is directly impacted by the maturity of the organization in terms of being able to show value to the enterprise as a whole and understanding the applied risk methodology. If the enterprise does not have a formal risk analysis capability, it will be difficult for the security team to use this method to properly implement security architecture for enterprise initiatives. Without this capability, the enterprise will either spend on the products with the best marketing, or not spend at all. Let's take a closer look at the risk analysis components and figure out where useful analysis data can be obtained. Assessing threats First, we must define what a threat is in order to identify probable threats. It may be difficult to determine threats to the enterprise data if this analysis has never been completed. A threat is anything that can act negatively towards the enterprise assets. It may be a person, virus, malware, or a natural disaster. Due to the broad scope of threats, actions may be purposeful or unintentional in nature adding to the absolute unpredictability of impact. Once a threat is defined, the attributes of threats must be identified and documented. The documentation of threats should include the type of threat, identified threat groupings, motivations if any, and methods of actions. In order to gain understanding of pertinent threats for the enterprise, researching past events may be helpful. Historically, there have been challenges to getting realistic breach data, but better reporting of post-breach findings continues to reduce the uncertainty of analysis. Another method to getting data is leveraging existing security technologies implemented to build a realistic perspective of threats. The following are a few sample questions to guide you on the discovery of threats: What is being detected by the existing infrastructure? What are others in the same industry observing? What post-breach data is available in the same industry vertical? Who would want access to this data? What would motivate a person to attempt unauthorized access to the data? Data theft Destruction Notoriety Hacktivism Retaliation A sample table of data type, threat, and motivation is shown as follows: Data   Threat   Motivation   Credit card numbers   Hacker   Theft, Cybercrime   Trade secrets   Competitor   Competitive advantage   Personally Identifiable Information (PII)   Disgruntled employee   Retaliation, Destruction   Company confidential documents   Accidental leak   None   Client list   Natural disaster   None   This should be developed with as much detail as possible to form a realistic view of threats to the enterprise. There may also be several variations of threats and motivations for threat action on enterprise data. For example, accessing trade secrets by a competitor may be for competitive advantage, or a hacker may take action as part of hacktivism to bring negative press to the enterprise. The more you can elaborate on the possible threats and motivations that exist, the better you will be able to reduce the list to probable threats based on challenging the data you have gathered. It is important to continually challenge the logic used to have the most realistic perspective. Assessing impact Now that the probable threats have been identified, what kind of damage can be done or negative impact can be enacted upon the enterprise and the data. Impact is the outcome of threats acting against the enterprise. This could be a denial-of-service state where the agent, a hacker, uses a tool to starve the enterprise Internet web servers of resources causing a denial-of-service state for legitimate users. Another impact could be the loss of customer credit cards resulting in online fraud, reputation loss, and countless dollars in cleanup and remediation efforts. There are the immediate impacts and residual impacts. Immediate impacts are rather easy to determine because, typically, this is what we see in the news if it is big enough of an issue. Hopefully, the impact data does not come from first-hand experience, but in the case it is, executives should take action and learn from their mistakes. If there is no real-life experience with the impact, researching breach data will help using Internet sites such as DATALOSS db (http://datalossdb.org). Also, understanding the value of the data to the enterprise and its customers will aide in impact calculation. I think the latter impact analysis is more useful, but if the enterprise is unsure, then relying on breach data may be the only option. The following are a few sample discovery questions for business impact analysis: How is the enterprise affected by threat actions? Will we go out of business? Will we lose market share? If the data is deleted or manipulated, can it be recovered or restored? If the building is destroyed, do we have disaster recovery and business continuity capabilities? To get a more accurate assessment of the probable impact or total cost to the enterprise, map out what data is most desirable to steal, destroy, and manipulate. Align the identified threats to the identified data, and apply an impact level to the data indicating if the enterprise would suffer critical to minor loss. These should be as accurate as possible. Work the scenarios out on paper and base the impact analysis on the outcome of the exercises. The following is a sample table to present the identification and assessment of impact based on threat for a retailer. This is generally called a business impact analysis. Data   Threat   Impact   Credit card numbers   Hacker   Critical   Trade secrets   Competitor   Medium   PII   Disgruntled employee   High   Company confidential documents   Accidental leak   Low   Client list   Natural disaster   Medium   Enterprise industry vertical may affect the impact analysis. For instance, a retailer may have greater impact if credit card numbers are stolen than if their client list was stolen. Both scenarios have impact but one may warrant greater protection and more restricted access to limit the scope of impact, and reduce immediate and residual loss. Business impact should be measured in how the threat actions affect the business overall. Is it an annoyance or does it mean the business can no longer function? Natural disasters should also be accounted for and considered when assessing enterprise risk. Assessing probability Now that all conceived threats have been identified along with the business impact for each scenario, how do we really determine risk? Shouldn't risk be based on how likely the threat may take action, succeed, and cause an impact? Yes! The threat can be the most perilous thing imagined but if threat actions may only occur once in three thousand years, investment in protecting against the threat may not be warranted, at least in the near term. Probability data is as difficult, if not more difficult, to find than threat data. However, this calculation has the most influence on the derived risk. If the identified impact is expected to happen twice a year and the business impact is critical, perhaps security budget should be allocated to security mechanisms that mitigate or reduce the impact. The risk of the latter scenario would be higher because it is more probable, not possible, but probable. Anything is possible. I have heard an analogy for this to make the point. In the game of Russian roulette, a semi-automatic pistol either has a bullet in the chamber or it does not, this is possible. With a revolver and a quick spin of the cylinder, you now have a 1 in 6 chance on whether there is a bullet that will be fired when the firing pin strikes forward. This is oversimplified to illustrate possibility versus probability. There are several variables in the example that could affect the outcome such as a misfire, or the safety catch being enabled, stopping the gun's ability to fire. These would be calculated to form an accurate risk value. Make sense? This is how we need to approach probability. Technically, it is a semi-accurate estimation because there is just not enough detailed information on breaches and attacks to draw absolute conclusions. One approach may be to research what is happening in the same industry using online resources and peer groups, and then make intelligent estimates to determine if the enterprise could be affected too. Generally, there are outlier scenarios that require the utmost attention regardless; start here if these have not been identified as a probable risk scenario for the enterprise. The following are a few sample probability estimation questions: Has this event occurred before to the enterprise? Is there data to suggest it is happening now? Are there documented instances for similar enterprises? Do we know anything in regards to occurrence? Is the identified threat and impact really probable? The following table is the continuation of our risk analysis for our fictional retailer: Data   Threat   Impact   Probability   Credit card numbers   Hacker   Critical   High   Trade secrets   Competitor   Medium   Low   PII   Disgruntled employee   High   Medium   Company confidential documents   Accidental leak Low   Low Client list   Natural disaster   Medium   High   Based on the outcome of the probability exercises of identified threats and impacts, risk can be calculated and the appropriate course of action(s) developed and implemented. Assessing risk Now that the enterprise has agreed on what data has value, identified threats to the data, rated the impact to the enterprise, and the estimated probability of the impact occurring, the next logical step is to calculate the risk of the scenarios. Essentially, there are two methods to analyze and present risk: qualitative and quantitative. The decision to use one over the other should be based on the maturity of the enterprise's risk office. In general, a quantitative risk analysis will use descriptive labels like a qualitative method, however, there is more financial and mathematical analysis in quantitative analysis. Qualitative risk analysis Qualitative risk analysis provides a perspective of risk in levels with labels such as Critical, High, Medium, and Low. The enterprise must still define what each level means in a general financial perspective. For instance, a Low risk level may equate to a monetary loss of $1,000 to $100,000. The dollar ranges associated with each risk level will vary by enterprise. This must be agreed on by the entire enterprise so when risk is discussed, everyone is knowledgeable of what each label means financially. Do not confuse the estimated financial loss with the more detailed quantitative risk analysis approach; it is a simple valuation metric for deciding how much investment should be made based on probable monetary loss. The following section is an example qualitative risk analysis presenting the type of input required for the analysis. Notice that this is not a deep analysis of each of these inputs; it is designed to provide a relatively accurate perspective of risk associated with the scenario being analyzed. Qualitative risk analysis exercise Scenario: Hacker attacks website to steal credit card numbers located in backend database. Threat: External hacker. Threat capability: Novice to pro. Threat capability logic: There are several script-kiddie level tools available to wage SQL injection attacks. SQL injection is also well documented and professional hackers can use advanced techniques in conjunction with the automated tools. Vulnerability: 85 percent (how effective would the threat be with current mitigating mechanisms). Estimated impact: High, Medium, Low (as indicated in the following table).   Risk Estimated loss ($)   High   > 1,000,000   Medium   500,000 to 900,000   Low   < 500,000   Quantitative risk analysis Quantitative risk analysis is an in-depth assessment of what the monetary loss would be to the enterprise if the identified risk were realized. In order to facilitate this analysis, the enterprise must have a good understanding of its processes to determine a relatively accurate dollar amount for items such as systems, data restoration services, and man-hour break down for recovery or remediation of an impacting event. Typically, enterprises with a mature risk office will undertake this type of analysis to drive priority budget items or find areas to increase insurance, effectively transferring business risk. This will also allow for accurate communication to the board and enterprise executives to know at any given time the amount of risk the enterprise has assumed. With the quantitative approach a more accurate assessment of the threat types, threat capabilities, vulnerability, threat action frequency, and expected loss per threat action are required and must be as accurate as possible. As with qualitative risk analysis, the output of this analysis has to be compared to the cost to mitigate the identified threat. Ideally, the cost to mitigate would be less than the loss expectancy over a determined period of time. This is simple return on investment (ROI) calculation. Let's look again at the scenario used in the qualitative analysis and run it through a quantitative analysis. We will then compare against the price of a security product that would mitigate the risk to see if it is worth the capital expense. Before we begin the quantitative risk analysis, there are a couple of terms that need to be explained: Annual loss expectancy (ALE): The ALE is the calculation of what the financial loss would be to the enterprise if the threat event was to occur for a single year period. This is directly related to threat frequency. In the scenario this is once every three years, dividing the single lost expectancy by annual occurrence provides the ALE. Cost of protection (COP): The COP is the capital expense associated with the purchase or implementation of a security mechanism to mitigate or reduce the risk scenario. An example would be a firewall that costs $150,000 and $50,000 per each year of protection of the loss expectancy period. If the cost of protection over the same period is lower than the loss, this is a good indication that the capital expense is financially worthwhile. Quantitative risk analysis exercise Scenario: Hacker attacks website to steal credit card numbers located in backend database. Threat: External hacker. Threat capability: Novice to pro. Threat capability logic: There are several script-kiddie level tools available to wage SQL injection attacks. SQL injection is also well documented and professional hackers can use advanced techniques in conjunction with the automated tools. Vulnerability: 85 percent (how effective would the threat be with current mitigating mechanisms). Single loss expectation: $250,000. Threat frequency: 3 (how many times per year; this would be roughly once every three years). ALE: $83,000. COP: $150,000 (over 3 years). We will divide the total loss and the cost of protection over three years as, typically, capital expenses are depreciated over three to four years, and the loss is expected once every three years. This will give us the ALE and COP in the equation to determine the cost-benefit analysis. This is a simplified example, but the math would look as follows: $83,000 (ALE) - $50,000 (COP) = $33,000 (cost benefit) The loss is annually $33,000 more than the cost to protect against the threat. The assumption in our example is that the $250,000 figure is 85% of the total asset value, but because we have 15% protection capability, the number is now approximately $294,000. This step can be shortcut out of the equation if the ALE and rate of occurrence are known. When trying to figure out threat capability, try to be as realistic about the threat first. This will help us to better assess vulnerability because you will have a more accurate perspective on how realistic the threat is to the enterprise. For instance, if your scenario requires cracking advanced encryption and extensive system experience, the threat capability would be expert indicating current security controls may be acceptable for the majority of threat agents reducing probability and calculated risk. We tend to exaggerate in security to justify a purchase. We need to stop this trend and focus on what is the best area to spend precious budget dollars. The ultimate goal of a quantitative risk analysis is to ensure that spend for protection does not far exceed the threat the enterprise is protecting against. This is beneficial for the security team in justifying the expense of security budget line items. When the analysis is complete, there should still be a qualitative risk label associated with the risk. Using the above scenario with an annualized risk of $50,000 indicates this scenario is extremely low risk based on the defined risk levels in the qualitative risk exercise even if SLE is used. Does this analysis accurately represent acceptable loss? After an assessment is complete it is good practice to ensure all assumptions still hold true, especially the risk labels and associated monetary amounts. Applying risk analysis to trust models Well, now we can apply our risk methodology to our trust models to decide if we can continue with our implementation as is, or whether we need to change our approach based on risk. Our trust models, which are essentially use cases, rely on completing the risk analysis, which in turn decide the trust level and security mechanisms required to reduce the enterprise risk to an acceptable level. It would be foolish to think that we can shove all requests for similar access directly into one of these buckets without further analysis to determine the real risk associated with the request. After completing one of the risk analysis types we just covered, risk guidance can be provided for the scenario (and I stress guidance). For the sake of simplicity an implementation path may be chosen, but it will lead to compromises in the overall security of the enterprise and is cautioned. I have re-presented the table of one scenario, the external application user. This is a better representation of how a trust model should look with risk and security enforcement established for the scenario. If an enterprise is aware of how it conducts business, then a focused effort in this area should produce a realistic list of interactions with data by whom, with what level of trust, and based on risk, what controls need to be present and enforced by policy and standards. User type   External   Allowed access   Tier 1 DMZ only, Least privilege   Trust level   1 - Not trusted   Risk   Medium   Policy   Acceptable use, Monitoring, Access restrictions   Required security mechanisms   FW, IPS, Web application firewall   The user is assumed to have access to log in to the web application and have more possible interaction with the backend database(s). This should be a focal point for testing, because this is the biggest area of risk in this scenario. Threats such as SQL injection that can be waged against a web application with little to no experience are commonplace. Enterprises that have e-commerce websites typically do not restrict who can create an account. This should have input to the trust decision and ultimately the security architecture applied. Deciding on a risk analysis methodology We have covered the two general types of risk analysis, qualitative and quantitative, but which is best? It depends on several factors: risk awareness of the enterprise, risk analysts' capabilities, risk analysis data, and the influence of risk in the enterprise. If the idea of risk analysis or IT risk analysis is new to the enterprise, then a slow approach with qualitative analysis is recommended to get everyone thinking of risk and what it means to the business. It will be imperative to get an enterprise-wide agreement on the risk labels. Using the lesser involved method does not mean you will not be questioned on the data used in the analysis, so be prepared to defend the data used and explain estimation methods leveraged. If it is decided to use a quantitative risk analysis method, a considerable amount of effort is required along with meticulous loss figures and knowledge of the environment. This method is considered the most effective requiring risk expertise, resources, and an enterprise-wide commitment to risk analysis. This method is more accurate, though it can be argued that since both methods require some level of estimation, the accuracy lies in accurate estimation skills. I use the Douglas Hubbard school of thought on estimating with 90 percent accuracy. You will find his works at his website http://www.hubbardresearch.com/. I highly recommend his title How to Measure Anything: Finding the Value of "Intangibles" in Business, Tantor Media to learn estimation skills. It may be beneficial to have an external firm perform the analysis if the engagement is significant in size. The benefits of both should be that the enterprise is able to make risk-aware decisions on how to securely implement IT solutions. Both should be presented with common risk levels such as High, Medium, Low; essentially the common language everyone can speak knowing a range of financial risk without all the intimate details of how they arrived at the risk level. Other thoughts on risk and new enterprise endeavors Now that you have been presented with types of risk analysis, they should be applied as tools to best approach the new technologies being implemented in the networks of our enterprises. Unfortunately, there are broad brush strokes of trusted and untrusted approaches being applied that may or may not be accurate without risk analysis as a decision input. Two examples where this can be very costly are the new BYOD and cloud initiatives. At first glance these are the two most risky business maneuvers an enterprise can attempt from an information security perspective. Deciding if this really is the case requires an analysis based on trust models and data-centric security architecture. If the proper security mechanisms are implemented and security applied from users to data, the risk can be reduced to a tolerable level. The BYOD business model has many positive benefits to the enterprise, especially capital expense reduction. However, implementing a BYOD or cloud solution without further analysis of risk can introduce significant risk beyond the benefit of the initiative. Do not be quick to spread fear in order to avoid facing the changing landscape we have worked so hard to build and secure. It is different, but at one time, what we know today as the norm was new too. Be cautious but creative, or IT security will be discredited for what will be received as a difficult interaction. This is not the desired perception for IT security. Strive to understand the business case, risk to business assets (data, systems, people, processes, and so on), and then apply sound security architecture as we have discussed so far. Begin evangelizing the new approach to security in the enterprise by developing trust models that everyone can understand. Use this as the introduction to agile security architecture and get input to create models based on risk. By providing a risk-based perspective to emerging technologies and other radical requests, a methodical approach can bring better adoption and overall increased security in the enterprise. Summary In this article, we took a look at analyzing risk by presenting quantitative and qualitative methods including an exercise to understand the approach. The overall goal of security is to be integrated into business processes, so it is truly a part of the business and not an expensive afterthought simply there to patch a security problem. Resources for Article : Further resources on this subject: Microsoft Enterprise Library: Security Application Block [Article] Microsoft Enterprise Library: Authorization and Security Cache [Article] Getting Started with Enterprise Library [Article]
Read more
  • 0
  • 0
  • 3337
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at €18.99/month. Cancel anytime
article-image-blocking-versus-non-blocking-scripts
Packt
08 Feb 2013
7 min read
Save for later

Blocking versus Non blocking scripts

Packt
08 Feb 2013
7 min read
(For more resources related to this topic, see here.) Blocking versus non blocking The reason we've put this library into the head of the HTML page and not the footer is because we actually want Modernizr to be a blocking script; this way it will test for, and if applicable create or shim, any elements before the DOM is rendered. We also want to be able to tell what features are available to us before the page is rendered. The script will load, Modernizr will test the availability of the new semantic elements, and if necessary, shim in the ones that fail the tests, and the rest of the page load will be on its merry way. Now when I say that we want the script to be "blocking", what I mean by that is the browser will wait to render or download any more of the page content until the script has finished loading. In essence, everything will move in a serial process and future processes will be "blocked" from occurring until after this takes place. This is also referred to as single threaded. More commonly as you may already be aware of, JavaScripts are called upon in the footer of the page, typically before the last body tag or by way of self-construction through use of an anonymous or immediate function, which only builds itself once the DOM is already parsed. The async attribute Even more recently, included page scripts can have the async attribute added to their tag elements, which will tell the browser to download other scripts in parallel. I like to think of serial versus parallel script downloading in terms of a phone conversation, each script being a single phone call. For each call made, a conversation is held, and once complete, the next phone call is made until there aren't any numbers left to be dialled. Parallel or asynchronous would be like having all of the callers on a conference call at one time. The browser, as the person making all these calls at once, has the superpower to hold all these conversations at the same time. I like to think of blocking scripts as phone calls, which contain pieces of information in their conversations that the person or browser would need to know before communicating or dialling up with the other scripts on this metaphoric conference call. Blocking to allow shimming For our needs, however, we want Modernizr to block that, so that all feature tests and shimming can be done before DOM render. The piece of information the browser needs before calling out the other scripts and parts of the page is what features exist, and whether or not semantic HTML5 elements need to be simulated. Doing otherwise could mean tragedy for something being targeted that doesn't exist because our shim wasn't there to serve its purpose by doing so. It would be similar to a roofer trying to attach shingles to a roof without any nails. Think of shimming as the nails for the CSS to attach certain selectors to their respective DOM nodes. Browsers such as IE typically ignore elements they don't recognize by default so the shims make the styles hold to the replicated semantic elements, and blocking the page ensures that happens in a timely manner. Shimming, which is also referred to as a "shiv", is when JavaScript recreates an HTML5 element that doesn't exist natively in the browser. The elements are thus "shimmed" in for use in styling. The browser will often ignore elements that don't exist natively otherwise. Say for example, the browser that was used to render the page did not support the new HTML5 section element tag. If the page wasn't shimmed to accommodate this before the render tree was constructed, you would run the risk of the CSS not working on those section elements. Looking at the reference chart on http://caniuse.com , this is somewhat likely for anyone using IE 8 or earlier: Now that we've adequately covered how to load Modernizr in the page header, we can move back on to the HTML. Adding the navigation Now that we have verified all of the JavaScript that is connected, we can start adding in more visual HTML elements. I'm going to add in five sections to the page and a fixed navigation header to scroll to each of them. Once that is all in place and working, we'll disable the default HTML actions in the navigation and control everything with JavaScript. By doing this, there will be a nice graceful fallback for the two people on the planet that have JavaScript disabled. Just kidding, maybe it's only one person. All joking aside, a no JavaScript fallback will be in place in the event that it is disabled on the page. If everything checks out as it should, you'll see the following printed in the JavaScript console in developer tools: While we're at it let's remove the h1 tag as well. Since we now know for a fact that Modernizr is great, we don't need to "hello world" it. Once the h1 tag is removed, it's time for a bit of navigation. The HTML used is as follows: <!-- Placing everything in the <header> html5 tag. --> <header> <div id="navbar"> <div id="nav"> <!-- Wrap the navigation in the new html5 nav element --> <nav> <href="#frame-1">Section One</a> <href="#frame-2">Section Two</a> <href="#frame-3">Section Three</a> <href="#frame-4">Section Four</a> <href="#frame-5">Section Four</a> </nav> </div> </div> </header> This is a fairly straightforward navigation at the moment. The entire fragment is placed inside the HTML5 header element of the page. A div tag with the id field of navbar will be used for targeting. I prefer to use HTML5 purely for semantic markup of the page as much as possible and to use div tags to target with styles. You could just as easily add CSS selectors to the new elements and they would be picked up as if they were any other inline or block element. The section frames After the nav element we'll add the page section frames. Each frame will be a div element, and each div element will have an id field matching the href attribute of the element from the navigation. For example, the first frame will have the id field of frame-1 which matches the href attribute of the first anchor tag in the navigation. Everything will also be wrapped in a div tag with the id field of main. Each panel or section will have the class name of frame, which allows us to apply common styles across sections as shown in the following code snippet: <div id="main"> <div id="frame-1" ></div> <div id="frame-2" ></div> <div id="frame-3" ></div> <div id="frame-4" ></div> <div id="frame-5" ></div> </div> Summary In this article we saw the basics of blocking versus non blocking scripts. We saw how the async attribute allows the browser to download other scripts in parallel. We blocked scripts using shimming, and also added navigation to the scripts. Lastly, we saw the use of section frames in scripts. Resources for Article : Further resources on this subject: HTML5: Generic Containers [Article] HTML5 Games Development: Using Local Storage to Store Game Data [Article] Building HTML5 Pages from Scratch [Article]
Read more
  • 0
  • 0
  • 16783

article-image-cross-premise-connectivity
Packt
08 Feb 2013
14 min read
Save for later

Cross-premise Connectivity

Packt
08 Feb 2013
14 min read
Evolving remote access challenges In order to increase productivity of employees, every company wants to provide access to their applications to their employees from anywhere. The users are no longer tied to work from a single location. The users need access to their data from any location and also from any device they have. They also want to access their applications irrespective of where the application is hosted. Allowing this remote connectivity to increase the productivity is in constant conflict with keeping the edge secure. As we allow more applications, the edge device becomes porous and keeping the edge secure is a constant battle for the administrators. The network administrators will have to ensure that this remote access to their remote users is always available and they can access their application in the same way as they would access it while in the office. Otherwise they would need to be trained on how to access an application while they are remote, and this is bound to increase the support cost for maintaining the infrastructure. Another important challenge for the network administrator is the ability to manage the remote connections and ensure they are secure. Migration to dynamic cloud In a modern enterprise, there is a constant need to optimize the infrastructure based on workload. Most of the time we want to know how to plan for the correct capacity rather than taking a bet on the number of servers that are needed for a given workload. If the business needs are seasonal we need to bet on a certain level of infrastructure expenses. If we don't get the expected traffic, the investment may go underutilized. At the same time if the incoming traffic volume is too high, the organization may lose the opportunity to generate additional revenue. In order to reduce the risk of losing additional revenue and at the same time to reduce large capital expenses, organizations may deploy virtualized solutions. However, this still requires the organization to take a bet on the initial infrastructure. What if the organization could deploy their infrastructure based on need? Then they could expand on demand. This is where moving to the cloud helps to move the capital expense ( CapEx ) to operational expense ( OpEx). If you tell your finance department that you are moving to an OpEx model for your infrastructure needs, you will definitely be greeted by cheers and offered cake (or at least, a fancy calculator). The needs of modern data centers As we said, reducing capital expense is on everyone's to-do list these days, and being able to invest in your infrastructure based on business needs is a key to achieving that goal. If your company is expecting seasonal workload, you would probably want to be able to dynamically expand your infrastructure based on needs. Moving your workloads to the cloud allows you to do this. If you are dealing with sensitive customer data or intellectual property, you probably want to be able to maintain secure connectivity between your premise and the cloud. You might also need to move workloads between your premise and the cloud as per your business demands, and so establishing secure connectivity between corporate and the cloud must be dynamic and transparent to your users. That means the gateway you use at the edge of your on-premise network and the gateway your cloud provider uses must be compatible. Another consideration is that you must also be able to establish or tear down the connection quickly, and it needs to be able to recover from outages very quickly. In addition, today's users are mobile and the data they access is also dynamic (the data itself may move from your on-premise servers to the cloud or back). Ideally, the users need not know where the data is and from where they are accessing the data, and they should not change their behavior depending on from where they access the data and where the data resides. All these are the needs of the modern data center. Things may get even more complex if you have multiple branch offices and multiple cloud locations. Dynamic cloud access with URA Let's see how these goals can be met with Windows Server 2012. In order for the mobile users to connect to the organizational network, they can use either DirectAccess or VPN. When you move resources to the cloud, you need to maintain the same address space of the resources so that your users are impacted by this change as little as possible. When you move a server or an entire network to the cloud, you can establish a Site-to-Site (S2S) connection through an edge gateway. Imagine you have a global deployment with many remote sites, a couple of public cloud data centers and some of your own private cloud. As the number of these remote sites grow, the number of Site-to-Site links needed will grow exponentially. If you have to maintain a gateway server or device for the Site-to-Site connections and another gateway for remote access such as VPN or DirectAccess, the maintenance cost associated with it can increase dramatically. One of the most significant new abilities with Windows Server 2012 Unified Remote Access is the combination of DirectAccess and the traditional Routing and Remote Access Server ( RRAS ) in the same Remote Access role. With this, you can now manage all your remote access needs from one unified console. As we've seen, only certain versions of Windows (Windows 7 Enterprise and Ultimate, Windows 8 Enterprise) can be DirectAccess clients, but what if you have to accommodate some Vista or XP clients or if you have third-party clients that need CorpNet connectivity? With Windows Server 2012, you can enable the traditional VPN from the Remote Access console and allow the down-level and third-party clients to connect via VPN. The Unified Remote Access console also allows the remote access clients to be monitored from the same console. This is very useful as you can now configure, manage, monitor, and troubleshoot all remote access needs from the same place. In the past, you might have used the Site-to-Site demand-dial connections to connect and route to your remote offices, but until now the demand-dial Site-to-Site connections used either the Point-to-Point Tunneling Protocol ( PPTP) or Layer Two Tunnel Protocol ( L2TP) protocols. However, these involved manual steps that needed to be performed from the console. They also produced challenges working with similar gateway devices from other vendors and because the actions are needed to be performed through the console, they did not scale well if the number of Site-to-Site connections increased beyond a certain number. Some products attempted to overcome the limits of the built-in Site-to-Site options in Windows. For example, Microsoft's Forefront Threat Management Gateway 2010 used the Internet Key Exchange ( IKE ) protocol, which allowed it to work with other gateways from Cisco and Juniper. However, the limit of that solution was that in case one end of the IPsec connection fails for some reason, the Dead Peer Detection (DPD) took some time to realize the failure. The time it took for the recovery or fallback to alternate path caused some applications that were communicating over the tunnel to fail and this disruption to the service could cause significant losses. Thanks to the ability to combine both VPN and DirectAccess in the same box as well as the ability to add the Site-to-Site IPsec connection in the same box, Windows Server 2012 allows you to reduce the number of unique gateway servers needed at each site. Also, the Site-to-Site connections can be established and torn down with a simple PowerShell command, making managing multiple connections easier. The S2S tunnel mode IPsec link uses the industry standard IKEv2 protocol for IPsec negotiation between the end points, which is great because this protocol is the current interoperability standard for almost any VPN gateway. That means you don't have to worry about what the remote gateway is; as long as it supports IKEv2, you can confidently create the S2S IPsec tunnel to it and establish connectivity easily and with a much better recovery speed in case of a connection drop. Now let's look at the options and see how we can quickly and effectively establish the connectivity using URA. Let's start with a headquarters location and a branch office location and then look at the high-level needs and steps to achieve the desired connectivity. Since this involves just two locations, our typical needs are that clients in either location should be able to connect to the other site. The connection should be secure and we need the link only when there is a need for traffic flow between the two locations. We don't want to use dedicated links such as T1 or fractional T1 lines as we do not want to pay for the high cost associated with them. Instead, we can use our pre-existing Internet connection and establish Site-to-Site IPsec tunnels that provide us a secure way to connect between the two locations. We also want users from public Internet locations to be able to access any resource in any location. We have already seen how DirectAccess can provide us with the seamless connectivity to the organizational network for domain-joined Windows 7 or Windows 8 clients, and how to set up a multisite deployment. We also saw how multisite allows Windows 8 clients to connect to the nearest site and Windows 7 clients can connect to the site they are configured to connect to. Because the same URA server can also be configured as a S2S gateway and the IPsec tunnel allows both IPv4 and IPv6 traffic to flow through it, it will now allow our DirectAccess clients in public Internet locations to connect to any one of the sites and also reach the remote site through the Site-to-Site tunnel. Adding the site in the cloud is very similar to adding a branch office location and it can be either your private cloud or the public cloud. Typically, the cloud service provider provides its own gateway and will allow you to build your infrastructure behind it. The provider could typically provide you an IP address for you to use as a remote end point and they will just allow you to connect to your resources by NATting the traffic to your resource in the cloud. Adding a cloud location using Site-to-Site In the following diagram, we have a site called Headquarters with a URA server (URA1) at the edge. The clients on the public Internet can access resources in the corporate network through DirectAccess or through the traditional VPN, using the URA1 at the edge. We have a cloud infrastructure provider and we need to build our CloudNet in the cloud and provide connectivity between the corporate network at the Headquarters and CloudNet in the cloud. The clients on the Internet should be able to access resources in the corporate network or CloudNet, and the connection should be transparent to them. The CloudGW is the typical edge device in the cloud that your cloud provider owns and it is used to control and monitor the traffic flow to each tenant. Basic setup of cross-premise connectivity The following steps outline the various options and scenarios you might want to configure: Ask your cloud provider for the public IP address of the cloud gateway they provide. Build a virtual machine running Windows Server 2012 with the Remote Access role and place it in your cloud location. We will refer to this server as URA2. Configure URA2 as a S2S gateway with two interfaces: The interface towards the CloudGW will be the IPsec tunnel endpoint for the S2S connection. The IP address for this interface could be a public IPv4 address assigned by your cloud provider or a private IPv4 address of your choice. If it is a private IPv4 address, the provider should send all the IPsec traffic for the S2S connection from the CloudGW to the Internet-facing interface of URA2. The remote tunnel endpoint configuration in URA1 for the remote site will be the public address that you got in step 1. If the Internet-facing interface of URA2 is also a routable public IPv4 address, the remote tunnel endpoint configuration in URA1 for the remote site will be this public address of URA2. The second interface on URA2 will be a private address that you are going to use in your CloudNet towards servers you are hosting there. Configure the cloud gateway to allow the S2S connections to your gateway (URA2). Establish S2S connectivity between URA2 and URA1. This will allow you to route all traffic between CloudNet and CorpNet. The preceding steps provide full access between the CloudNet and CorpNet and also allow your DirectAccess and VPN clients on the Internet to access any resource in CorpNet or CloudNet without having to worry whether the resource is in CorpNet or in CloudNet. DirectAccess entry point in the cloud Building on the basic setup, you can further extend the capabilities of the clients on the Internet to reach the CloudNet directly without having to go through the CorpNet. To achieve this, we can add a URA Server in the CloudNet (URA3). Here is an overview of the steps to achieve this (assuming your URA server URA3 is already installed with the Remote Access role): Place a domain controller in CloudNet. It can communicate with your domain through the Site-to-Site connection to do Active Directory replication and perform just like any other domain controller. Enable the multisite configuration on your primary URA server (URA1). Add URA3 as an additional entry point. It will be configured as a URA server with the single NIC topology. Register the IP-HTTPS site name in DNS for URA3. Configure your cloud gateway to forward the HTTPS traffic to your URA2 and in turn to URA3 to allow clients to establish the IP-HTTPS connections. Using this setup, clients on the Internet can connect to either the entry point URA1 or URA3. No matter what they choose, they can access all resources either directly or via the Site-to-Site tunnel. Authentication The Site-to-Site connection between the two end points (URA1 and URA2) can be configured with Pre Shared Key ( PSK) for authentication or you can further secure the IPsec tunnel with Certificate Authentication. Here, the certificates you will need for Certificate Authentication would be computer certificates that match the name of the end points. You could use either certificates issued by a third-party provider or certificates issued from your internal Certificate Authority ( CA). As with any certificate authentication, the two end points need to trust the certificates used at either end, so you need to make sure the certificate of the root CA is installed on both servers. To make things simpler, you can start with a simple PSK-based tunnel and once the basic scenario works, change the authentication to computer certificates. We will see the steps to use both PSK and Certificates in the detailed steps in the following section. Configuration steps Even though the Site-to-Site IPsec tunnel configuration is possible via the console, we highly recommend that you get familiar with the PowerShell commands for this configuration as they make it a lot easier to configure this in case you need to manage multiple configurations. If you have multiple remote sites, having to set up and tear down each site based on workload demand is not scalable when configured through the console. Summary we have seen how by combining the DirectAccess and Site-to-Site VPN functionalities we are now able to use one single box to provide all remote access features. With virtual machine live migration options, you can move any workload from your corporate network to cloud network and back over the S2S connection and keep the same names for the servers. This way, clients from any location can access your applications in the same way as they would access them if they were on the corporate network. Resources for Article : Further resources on this subject: Creating and managing user accounts in Microsoft Windows SBS 2011 [Article] Disaster Recovery for Hyper-V [Article] Windows 8 and Windows Server 2012 Modules and Cmdlets [Article]
Read more
  • 0
  • 0
  • 7272

article-image-keyshots-overview
Packt
08 Feb 2013
11 min read
Save for later

KeyShot's Overview

Packt
08 Feb 2013
11 min read
(For more resources related to this topic, see here.) Introducing KeyShot Formerly known as HyperShot, KeyShot is an application developed by the company Luxion, that is run today by professionals in various disciplines to deliver images with hyperrealistic quality. KeyShot delivers physically accurate lighting and a library of materials that allow us to experiment and make changes all through our viewport in real time. Whether we are engineers, artists, or designers, time is a precious element that we are always racing against, and this is particularly true when it comes to rendering 3D data. On some occasions, the quality of our work is compromised as we need to spend time learning complex new software. KeyShot has been designed with simplicity in mind, allowing the user to create high-quality images while putting aside the technical details. Unlike other rendering packages on the market, KeyShot is a processor-based rendering program. All the rendering calculations are 100 percent CPU-based, which means we don't need a high-performance graphics card to get the job done. KeyShot utilizes all the cores and threads in your processor, and because it was built on 64-bit architecture, it also gives us more room to increase performance. KeyShot versus traditional rendering programs In order to work properly, it is important to have the right tools. KeyShot allows you to apply materials, set up the lighting, and obtain hyperrealistic images in a matter of minutes. Traditional rendering applications often have, too many settings, each giving the user a different level of control over the appearance of the project. Although a large number of settings allows for more flexibility, understanding how each of them works can be a time-consuming process. In this section, we have laid out several points that we consider helpful when using KeyShot for your projects compared to other rendering applications. The following are some basic points related to working with KeyShot: Workflow—import your 3D data, apply and fine-tune your textures and materials, set up your lighting, find your preferred camera view, and then render. KeyShot is fully integrated, just like any other rendering application, but it's been designed to be user friendly. You will find that most menu tabs and preferences are intuitive and easy to understand. It offers different arrays of mapping options, such as cylindrical, box shaped, spherical, or using UV coordinates, depending on your preference. It uses the high dynamic range imaging (HDRI) method to produce realistic lighting conditions. It provides physically accurate materials based on real-world properties. Each material found in KeyShot's library has been set up to produce a specific type of look when applied. This allows you to save time fine-tuning your materials for that specific look. It offers basic animation tools that allow you to set up professional presentations. The following are a few basic points related to traditional rendering tools: They require some experience in rendering techniques, and they often have a steep learning curve. The user interfaces are cluttered with options and preferences and can be intimidating for first-time users. They are more flexible in terms of controlling the look of each individual feature of your project. The settings are broken down and laid out separately, allowing you to control everything from the number of lights and shadows per scene to the look of a material. A consequence of this, however, is that, there are more opportunities for errors and users are often overwhelmed by the amount of settings and controls. Materials and lighting are not always physically accurate. Reproducing a particular type of material or lighting setup is often time-consuming. They provide more robust animation tools and often include a rigging system, which allows for more complex animations. KeyShot is a powerful rendering tool that is used in a variety of fields within the CG industry. However, it is important to remember that KeyShot has a limited set of animation tools, and I recommend using a different application such as Maya, 3ds Max, or Softimage if your project requires complex character animations or special effects. Getting started Now that we understand the fundamentals of KeyShot and its benefits, we will take a look at how to start using KeyShot for your projects, from the beginning to the end. If you do not have KeyShot, you can download a trial version from the website by performing the following steps: Go to http://www.keyshot.com/try/. Select your operating system (Windows 32-bit, Windows 64-bit, or Mac OS X) and download it. Install your trial version and select Continue without registering. Importing projects KeyShot supports a variety of file formats from third-party applications. A list of the files currently supported can be found on the KeyShots website. For our projects, we will be working with files with the OBJ (object file) extension. Let's go ahead and get started. Perform the following steps: Open KeyShot. At the bottom of your viewport, you will see six icons—Import, Library, Project, Animation, Screenshot, and Render, as shown in the following screenshot: Go ahead and click on Import. Let's choose our lesson file, Wacom_2, from the data folder. A new window for configuring imported files will appear. The new settings window allows you to choose the orientation or the direction in which your 3D object will be placed in the viewport. Depending on which application we are importing our files to, some of them have their Cartesian axis orientation set up differently. In this case, the file we will be working with is an OBJ file imported from Maya, and this file has Y Up as its Orientation, as shown in the following screenshot: When working with our project files in KeyShot, it is important to remember prior to importing any models that, all parts of the model need to have their own material assigned to them. To do this, before exporting any of our 3D files from other applications, make sure that the option material is checked in the export options. Once all the pieces of our model have been assigned with their own material, KeyShot will be able to understand how to assign materials properly to all parts of the mesh. A new feature called Material Template, currently available in KeyShot v3.3 and later versions, allows us to link materials and parts of our models to the materials found inside KeyShot's library. For example, instead of copying and pasting materials from one object to another, we can create a template that automatically applies all the materials to the corresponding parts of a model when it is imported into the scene. When creating a template, we need to specify a source name and a destination name. The source name is essentially the name of the part or the material exported directly from a third-party application such as Maya or SolidWorks. Once it is added to the template list, KeyShot will search for any parts or materials associated with the names in the source list and apply any assigned materials in the destination list. We can see an example of a template list in the following screenshot, with the parts of our Wacom tablet listed on the left-hand side and the materials we assigned them with on the right-hand side: Next, let's see how to move, rotate, or scale our model in the viewport. Perform the following steps to do so: Right-click on the model. A new selection box will appear; choose to either move a part of the object or the entire object. When working with a mesh that has multiple parts, it is good practice to hide the parts we don't currently need. To do this, simply right-click on the part we wish to hide and select the Hide Part option from the new menu. The interface Once our project model has been imported, our 3D file should be displayed in our viewport along with a new project window. This window contains five different tabs, of which we will discuss three in the following sections. Scene The Scene tab shows all the parts of our model. The left-hand side of our Project window shows the parts of our mesh under the Parts heading. The order and the name of each of the parts are listed according to the name of the material that was assigned to it by its original application. In this case, our 3D tablet was imported from Maya and all its parts were assigned with a specific material inside Maya. The right-hand side of our Project window shows the list of the current materials that have been applied to the parts inside KeyShot under the Materials heading, as shown in the following screenshot: Material The Material tab lists all the available materials in KeyShot according to their category. In the lower part of our Project window, we can see the materials that belong to the specific folder we have chosen from the list. To apply any material to our model, simply drag the material and drop it onto the part of our model where we wish to apply it. Another way of accessing the list of materials is by clicking on the Library tab in our main viewport. If we need to access the material properties of a specific part of our model, we can do so by double-clicking on any part of the model. To apply any material to our project, we perform the following steps: Open the Library window by clicking on the Library icon from the viewport menu. Drag the desired material and drop it onto our project. Double-click on our model with the applied material to open the Material Properties window. Material properties window The material properties window allows us to modify the attributes of the material we choose. Depending on the material, certain properties will be available for us to modify. For example, any glass models will have the refraction attribute, which won't be available to us if we choose a metallic shader. In general, we have to fine-tune the properties of the materials in order to reproduce the look of real-life materials for most 3D applications such as Maya or 3ds Max. In KeyShot, however, this is no longer necessary since all its materials have been configured to be physically accurate. When using materials in KeyShot, each time a new material is applied to our model, it will show up at the bottom of our material's property window. This is to allow us to recycle a material and use it again if needed. Environment Right next to the Material tab we will find the Environment tab, which contains HDRIs that come as part of KeyShot. Here, we will be able to drag-and-drop HDRIs as well as backplates onto our scene. The Environment tab, just like the Material tab, has its own property window, which has more advanced attributes that let us assume greater control of the appearance of our scene. In the Pro version of KeyShot, an HDRI editor preference is also available for further control of our HDRIs. Certain features allow us to control the saturation, hue, brightness, contrast, and even the shape of the HDRI. Environment properties window The environment's properties window houses the entire list of attributes that allow us to control the lighting of our scene. We will discuss this property window in more depth in the lighting section later in this book. To access the property window, perform the following steps: Double-click on any part of our model. Select the Environment tab from the property window, as follows: Summary In this article, we have learned how to import our models into KeyShot by clicking on the Import tab from the main viewport, and we have also taken a look at creating material template, which is a newly added feature of KeyShot 3. We have also gone brie fl y over the three major tabs that can be found in the Project window, which are the Scene, Material, and Environment tabs. Lastly, we mentioned during the article that there is also a separate material properties window and a properties environment window, both of which are in charge of controlling the look of our materials and lighting. Resources for Article : Further resources on this subject: 3D Vector Drawing and Text with Papervision3D: Part 2 [Article] Ogre 3D FAQs [Article] Tips and Tricks on Away3D 3.6 [Article]
Read more
  • 0
  • 0
  • 4380

article-image-meteorjs-javascript-framework-why-meteor-rocks
Packt
08 Feb 2013
18 min read
Save for later

Meteor.js JavaScript Framework: Why Meteor Rocks!

Packt
08 Feb 2013
18 min read
(For more resources related to this topic, see here.) Modern web applications Our world is changing. With continual advancements in display, computing, and storage capacities, what wasn't possible just a few years ago is now not only possible, but critical to the success of a good application. The Web in particular has undergone significant change. The origin of the web app (client/server) From the beginning, web servers and clients have mimicked the dumb terminal approach to computing, where a server with significantly more processing power than a client will perform operations on data (writing records to a database, math calculations, text searches, and so on), transform the data into a readable format (turn a database record into HTML, and so on), and then serve the result to the client, where it's displayed for the user. In other words, the server does all the work, and the client acts as more of a display, or dumb terminal. The design pattern for this is called...wait for it…the client/server design pattern: This design pattern, borrowed from the dumb terminals and mainframes of the 60s and 70s, was the beginning of the Web as we know it, and has continued to be the design pattern we think of, when we think of the Internet. The rise of the machines (MVC) Before the Web (and ever since), desktops were able to run a program such as a spreadsheet or a word processor without needing to talk to a server. This type of application could do everything it needed to, right there on the big and beefy desktop machine. During the early 90s, desktop computers got faster and better. Even more and more beefy. At the same time, the Web was coming alive. People started having the idea that a hybrid between the beefy desktop application (a fat app) and the connected client/server application (a thin app) would produce the best of both worlds. This kind of hybrid app — quite the opposite of a dumb terminal — was called a smart app. There were many business-oriented smart apps created, but the easiest examples are found in computer games. Massively Multiplayer Online games (MMOs), first-person shooters, and real-time strategies are smart apps where information (the data model) is passed between machines through a server. The client in this case does a lot more than just display the information. It performs most of the processing (or controls) and transforms the data into something to be displayed (the view). This design pattern is simple, but very effective. It's called the Model View Controller (MVC) pattern. The model is all the data. In the context of a smart app, the model is provided by a server. The client makes requests for the model from the server. Once the client gets the model, it performs actions/logic on this data, and then prepares it to be displayed on the screen. This part of the application (talk to the server, modify the data model, and prep data for display) is called the controller. The controller sends commands to the view, which displays the information, and reports back to the controller when something happens on the screen (a button click, for example). The controller receives that feedback, performs logic, and updates the model. Lather, rinse, repeat. Because web browsers were built to be "dumb clients" the idea of using a browser as a smart app was out of the question. Instead, smart apps were built on frameworks such as Microsoft .NET, Java, or Macromedia (now Adobe) Flash. As long as you had the framework installed, you could visit a web page to download/run a smart app. Sometimes you could run the app inside the browser, sometimes you could download it first, but either way, you were running a new type of web app, where the application could talk to the server and share the processing workload. The browser grows up (MVVM) Beginning in the early 2000s, a new twist on the MVC pattern started to emerge. Developers started to realize that, for connected/enterprise "smart apps", there was actually a nested MVC pattern. The server (controller) was performing business logic on the database information (model) through the use of business objects, and then passing that information on to a client application (a "view"). The client was receiving this information from the server, and treating it as its own personal "model." The client would then act as a proper controller, perform logic, and send the information to the view to be displayed on the screen. So, the "view" for the server MVC was the "model" for the second MVC. Then came the thought, "why stop at two?" There was no reason an application couldn't have multiple nested MVCs, with each view becoming the model for the next MVC. In fact, on the client side, there's actually a good reason to do so. Separating actual display logic (such as "this submit button goes here" and "the text area changed value") from the client-side object logic (such as "user can submit this record" and "the phone # has changed") allows a large majority of the code to be reused. The object logic can be ported to another application, and all you have to do is change out the display logic to extend the same model and controller code to a different application or device. From 2004-2005, this idea was refined and modified for smart apps (called the presentation model) by Martin Fowler and Microsoft (called the Model View View-Model). While not strictly the same thing as a nested MVC, the MVVM design pattern applied the concept of a nested MVC to the frontend application. As browser technologies (HTML and JavaScript) matured, it became possible to create smart apps that use the MVVM design pattern directly inside an HTML web page. This pattern makes it possible to run a full-sized application directly from a browser. No more downloading multiple frameworks or separate apps. You can now get the same functionality from visiting a URL as you previously could from buying a packaged product. A giant Meteor appears! Meteor takes the MVVM pattern to the next level. By applying templating through handlebars.js (or other template libraries) and using instant updates, it truly enables a web application to act and perform like a complete, robust smart application. Let's walk through some concepts of how Meteor does this, and then we'll begin to apply this to our Lending Library application. Cached and synchronized data (the model) Meteor supports a cached-and-synchronized data model that is the same on the client and the server. When the client notices a change to the data model, it first caches the change locally, and then tries to sync with the server. At the same time, it is listening to changes coming from the server. This allows the client to have a local copy of the data model, so it can send the results of any changes to the screen quickly, without having to wait for the server to respond. In addition, you'll notice that this is the beginning of the MVVM design pattern, within a nested MVC. In other words, the server publishes data changes, and treats those data changes as the "view" in its own MVC pattern. The client subscribes to those changes, and treats the changes as the "model" in its MVVM pattern. A code example of this is very simple inside of Meteor (although you can make it more complex and therefore more controlled if you'd like): var lists = new Meteor.Collection("lists"); What this one line does is declare that there is a lists data model. Both the client and server will have a version of it, but they treat their versions differently. The client will subscribe to changes announced by the server, and update its model accordingly. The server will publish changes, and listen to change requests from the client, and update its model (its master copy) based on those change requests. Wow. One line of code that does all that! Of course there is more to it, but that's beyond the scope of this article, so we'll move on. To better understand Meteor data synchronization, see the Publish and subscribe section of the Meteor documentation at http://docs.meteor.com/#publishandsubscribe. Templated HTML (the view) The Meteor client renders HTML through the use of templates. Templates in HTML are also called view data bindings. Without getting too deep, a view data binding is a shared piece of data that will be displayed differently if the data changes. The HTML code has a placeholder. In that placeholder different HTML code will be placed, depending on the value of a variable. If the value of that variable changes, the code in the placeholder will change with it, creating a different view. Let's look at a very simple data binding – one that you don't technically need Meteor for – to illustrate the point. In LendLib.html, you will see an HTML (Handlebar) template expression: <div id="categories-container"> {{> categories}} </div> That expression is a placeholder for an HTML template, found just below it: <template name="categories"> <h2 class="title">my stuff</h2>... So, {{> categories}} is basically saying "put whatever is in the template categories right here." And the HTML template with the matching name is providing that. If you want to see how data changes will change the display, change the h2 tag to an h4 tag, and save the change: <template name="categories"> <h4 class="title">my stuff</h4>... You'll see the effect in your browser ("my stuff" become itsy bitsy). That's a template – or view data binding – at work! Change the h4 back to an h2 and save the change. Unless you like the change. No judgment here...okay, maybe a little bit of judgment. It's ugly, and tiny, and hard to read. Seriously, you should change it back before someone sees it and makes fun of you!! Alright, now that we know what a view data binding is, let's see how Meteor uses them. Inside the categories template in LendLib.html, you'll find even more Handlebars templates: <template name="categories"> <h4 class="title">my stuff</h4> <div id="categories" class="btn-group"> {{#each lists}} <div class="category btn btn-inverse"> {{Category}} </div> {{/each}} </div> </template> The first Handlebars expression is part of a pair, and is a for-each statement. {{#each lists}} tells the interpreter to perform the action below it (in this case, make a new div) for each item in the lists collection. lists is the piece of data. {{#each lists}} is the placeholder. Now, inside the #each lists expression, there is one more Handlebars expression. {{Category}} Because this is found inside the #each expression, Category is an implied property of lists. That is to say that {{Category}} is the same as saying this.Category, where this is the current item in the for each loop. So the placeholder is saying "Add the value of this.Category here." Now, if we look in LendLib.js, we will see the values behind the templates. Template.categories.lists = function () { return lists.find(... Here, Meteor is declaring a template variable named lists, found inside a template called categories. That variable happens to be a function. That function is returning all the data in the lists collection, which we defined previously. Remember this line? var lists = new Meteor.Collection("lists"); That lists collection is returned by the declared Template.categories.lists, so that when there's a change to the lists collection, the variable gets updated, and the template's placeholder is changed as well. Let's see this in action. On your web page pointing to http://localhost:3000, open the browser console and enter the following line: > lists.insert({Category:"Games"}); This will update the lists data collection (the model). The template will see this change, and update the HTML code/placeholder. The for each loop will run one additional time, for the new entry in lists, and you'll see the following screen: In regards to the MVVM pattern, the HTML template code is part of the client's view. Any changes to the data are reflected in the browser automatically. Meteor's client code (the View-Model) As discussed in the preceding section, LendLib.js contains the template variables, linking the client's model to the HTML page, which is the client's view. Any logic that happens inside of LendLib.js as a reaction to changes from either the view or the model is part of the View-Model. The View-Model is responsible for tracking changes to the model and presenting those changes in such a way that the view will pick up the changes. It's also responsible for listening to changes coming from the view. By changes, we don't mean a button click or text being entered. Instead, we mean a change to a template value. A declared template is the View-Model, or the model for the view. That means that the client controller has its model (the data from the server) and it knows what to do with that model, and the view has its model (a template) and it knows how to display that model. Let's create some templates We'll now see a real-life example of the MVVM design pattern, and work on our Lending Library at the same time. Adding categories through the console has been a fun exercise, but it's not a long -t term solution. Let's make it so we can do that on the page instead. Open LendLib.html and add a new button just before the {{#each lists}} expression. <div id="categories" class="btn-group"> <div class="category btn btn-inverse" id="btnNewCat">+</div> {{#each lists}} This will add a plus button to the page. Now, we'll want to change out that button for a text field if we click on it. So let's build that functionality using the MVVM pattern, and make it based on the value of a variable in the template. Add the following lines of code: <div id="categories" class="btn-group"> {{#if new_cat}} {{else}} <div class="category btn btn-inverse" id="btnNewCat">+</div> {{/if}} {{#each lists}} The first line {{#if new_cat}} checks to see if new_cat is true or false. If it's false, the {{else}} section triggers, and it means we haven't yet indicated we want to add a new category, so we should be displaying the button with the plus sign. In this case, since we haven't defined it yet, new_cat will be false, and so the display won't change. Now let's add the HTML code to display, if we want to add a new category: <div id="categories" class="btn-group"> {{#if new_cat}} <div class="category"> <input type="text" id="add-category" value="" /> </div> {{else}} <div class="category btn btn-inverse" id="btnNewCat">+</div> {{/if}} {{#each lists}} Here we've added an input field, which will show up when new_cat is true. The input field won't show up unless it is, so for now it's hidden. So how do we make new_cat equal true? Save your changes if you haven't already, and open LendingLib.js. First, we'll declare a Session variable, just below our lists template declaration. Template.categories.lists = function () { return lists.find({}, {sort: {Category: 1}}); }; // We are declaring the 'adding_category' flag Session.set('adding_category', false); Now, we declare the new template variable new_cat, which will be a function returning the value of adding_category: // We are declaring the 'adding_category' flag Session.set('adding_category', false); // This returns true if adding_category has been assigned a value //of true Template.categories.new_cat = function () { return Session.equals('adding_category',true); }; Save these changes, and you'll see that nothing has changed. Ta-daaa! In reality, this is exactly as it should be, because we haven't done anything to change the value of adding_category yet. Let's do that now. First, we'll declare our click event, which will change the value in our Session variable. Template.categories.new_cat = function () { return Session.equals('adding_category',true); }; Template.categories.events({ 'click #btnNewCat': function (e, t) { Session.set('adding_category', true); Meteor.flush(); focusText(t.find("#add-category")); } }); Let's take a look at the following line: Template.categories.events({ This line is declaring that there will be events found in the category template. Now let's take a look at the next line: 'click #btnNewCat': function (e, t) { This line tells us that we're looking for a click event on the HTML element with an id="btnNewCat" (which we already created on LendingLib.html). Session.set('adding_category', true); Meteor.flush(); focusText(t.find("#add-category")); We set the Session variable adding_category = true, we flush the DOM (clear up anything wonky), and then we set the focus onto the input box with the expression id="add-category". One last thing to do, and that is to quickly add the helper function focusText(). Just before the closing tag for the if (Meteor.isClient) function, add the following code: /////Generic Helper Functions///// //this function puts our cursor where it needs to be. function focusText(i) { i.focus(); i.select(); }; } //------closing bracket for if(Meteor.isClient){} Now when you save the changes, and click on the plus [ ] button, you'll see the following input box: Fancy! It's still not useful, but we want to pause for a second and reflect on what just happened. We created a conditional template in the HTML page that will either show an input box or a plus button, depending on the value of a variable. That variable belongs to the View-Model. That is to say that if we change the value of the variable (like we do with the click event), then the view automatically updates. We've just completed an MVVM pattern inside a Meteor application! To really bring this home, let's add a change to the lists collection (also part of the View-Model, remember?) and figure out a way to hide the input field when we're done. First, we need to add a listener for the keyup event. Or to put it another way, we want to listen when the user types something in the box and hits Enter. When that happens, we want to have a category added, based on what the user typed. First, let's declare the event handler. Just after the click event for #btnNewCat, let's add another event handler: focusText(t.find("#add-category")); }, 'keyup #add-category': function (e,t){ if (e.which === 13) { var catVal = String(e.target.value || ""); if (catVal) { lists.insert({Category:catVal}); Session.set('adding_category', false); } } } }); We add a "," at the end of the click function, and then added the keyup event handler. if (e.which === 13) This line checks to see if we hit the Enter/return key. var catVal = String(e.target.value || ""); if (catVal) This checks to see if the input field has any value in it. lists.insert({Category:catVal}); If it does, we want to add an entry to the lists collection. Session.set('adding_category', false); Then we want to hide the input box, which we can do by simply modifying the value of adding_category. One more thing to add, and we're all done. If we click away from the input box, we want to hide it, and bring back the plus button. We already know how to do that inside the MVVM pattern by now, so let's add a quick function that changes the value of adding_category. Add one more comma after the keyup event handler, and insert the following event handler: Session.set('adding_category', false); } } }, 'focusout #add-category': function(e,t){ Session.set('adding_category',false); } }); Save your changes, and let's see this in action! In your web browser, on http://localhost:3000 , click on the plus sign — add the word Clothes and hit Enter. Your screen should now resemble the following: Feel free to add more categories if you want. Also, experiment with clicking on the plus button, typing something in, and then clicking away from the input field. Summary In this article you've learned about the history of web applications, and seen how we've moved from a traditional client/server model to a full-fledged MVVM design pattern. You've seen how Meteor uses templates and synchronized data to make things very easy to manage, providing a clean separation between our view, our view logic, and our data. Lastly, you've added more to the Lending Library, making a button to add categories, and you've done it all using changes to the View-Model, rather than directly editing the HTML.   Resources for Article : Further resources on this subject: How to Build a RSS Reader for Windows Phone 7 [Article] Applying Special Effects in 3D Game Development with Microsoft Silverlight 3: Part 2 [Article] Top features of KnockoutJS [Article]
Read more
  • 0
  • 0
  • 3543
article-image-using-processes-microsoft-dynamics-crm-2011
Packt
07 Feb 2013
13 min read
Save for later

Using Processes in Microsoft Dynamics CRM 2011

Packt
07 Feb 2013
13 min read
  (For more resources related to this topic, see here.) Employee Recruitment Management System basics Hiring the right candidate is a challenge for the recruitment team of any company. The process of hiring candidates can differ from company to company. Different sources such as job sites, networking, and consulting firms can be used to get the right candidate, but most companies prefer to hire a candidate from their own employee network. Before starting the hiring process, a recruiter should have a proper understanding of the candidate profile that fits the company's requirements. Normally, this process starts by screening candidate resumes fetched from different sources. Once they have resumes of appropriate candidates, the recruitment team starts working on resumes one by one. Recruiters talk to potential candidates and enquire about their skills and test their interpersonal skills. Recruiters play an important role in the hiring process; they prepare candidates for interview and provide interview feedback. Employee Recruitment Management System design In the employee recruitment applications, we will be using the key objects shown in the following figure to capture the required information: The blocks perform the following tasks: Company: This block stores the company details Candidate: This block stores information about the candidate profile Employee: This block stores employee data CRM User : This block stores Microsoft CRM user information As we are going to use Microsoft CRM 2011 as a platform to build our application, let's map these key blocks with Microsoft CRM 2011 entities: Company: The term "account" in Microsoft CRM represents an organization, so we can map the company object with an account entity and can store company information in the account entity. Candidate: The Candidate object will store information about suitable candidates for our company. We will use the candidate entity to store all interview related feedback, other position details, and address information. We are going to map the candidate entity with a lead entity, because it has most of the fields OOB that we need for our candidate entity. Employee: In Microsoft CRM 2011 sales process, when lead is qualified, it is converted to an account, a contact, and an opportunity, so we utilize this process for our application. When a candidate is selected, we will convert the candidate to an employee using the OOB process, which will map all the candidate information to the Candidate entity automatically. When a lead is converted to an account or contact or opportunity, the lead record is deactivated by Microsoft CRM 2011. Let's talk about the process flow that we are going to use in our employee recruitment application. Recruiters will start the process of hiring a candidate by importing candidate resumes in Microsoft CRM under the Candidate entity; we will customize our OOB entities to include the required information. Once data is imported in Microsoft CRM, the recruiter will start the screening of candidates one by one. He will schedule Technical, Project Manager, and finally HR rounds. Once the candidate is selected the recruiter will create an offer letter for that candidate, send it to the respective candidate, and convert the Candidate entity to Employee. The following flowchart shows our employee recruitment application process flow: Data model We have identified the data model for required entities. We need to customize OOB entities based on the data model tables.   Customizing entities for Employee Recruitment Management System Once we have the data model ready, we need to customize the Microsoft CRM UI and OOB entities. Let's first create our solution called HR Module and add the required entities to that solution. Customizing Microsoft CRM UI We need to customize the Microsoft CRM site map. We have options to modify the sitemap manually or using the site map editor tool. We need to customize the site map based on the following table: Sr No Customization Detail 1 Remove Left Navigation: Marketing, Service, Resource Center 2 Rename Left Navigation: Sales to  HR Module, Setting to  Configuration 3 Remove Left Navigation items under  My Work:  Queues, Articles,Announcements 4 Remove all Left Navigation items under HR Module left navigation: except Lead, Accounts , and Contacts After customizing the site map, Microsoft CRM UI should look like the following screenshot: It is recommended that you comment unwanted navigation areas out of the site map instead of removing them. Customizing OOB entities After we have customized Microsoft CRM UI, we need to rename the entity and entity views. We also need to perform the following actions: Renaming OOB entities: We need to rename the lead, account, and contact entities to candidate, company, and employee. Open the entities in edit mode and rename them. Changing Translation labels: After renaming the OOB entities, we need to change the translation labels in Microsoft CRM. We need to convert Lead to Candidate and Contact to Employee. Creating/customizing entity fields: We need to create and customize entity fields; based on the data model we just saw, let's create candidate entity fields. Use the following steps to create fields: Open our HRModule solution. Navigate to Entities | Candidate | Fields. Click on New to create a new field. Enter the following field properties: Display Name: Text that you want to show to the user on the form. Name: This will be populated automatically as we tab out from the Display Name field. The Display Name field is used as a label in Microsoft CRM 2011 entity form and views, whereas the Name field is used to refer to the field in code. Requirement Level: Used to enforce data validation on the form. Searchable: If this is true, this field will be available in the Advance Finds field list. Field Security: Used to enable field-level security. It is a new feature added in Microsoft CRM 2011. Refer to the Setting field-level security in Microsoft CRM 2011 section for more details. Auditing: Used to enable auditing for entity fields. It is also a new feature added in Microsoft CRM 2011. Using auditing, we can track entity and attribute data changes for an organization. You can refer to http://msdn.microsoft.com/en-us/library/gg309664.aspx for more details on the auditing feature. Description: Used to provide additional information about fields. Type: Represents what type of data we are going to store in this field; based on the type selected, we need to set other properties. You can't change the data type of a created field, but you can change its properties. After filling in this information, our entity form should look like the following screenshot: We need to create fields for all entities based on the preceding steps, one by one. Setting relationship mapping In Microsoft CRM 2011, we can relate two entities by creating a relationship between them. We can create three types of relationships: One-to-many relationship: A one-to-many relationship is created between one primary entity and many related entities. Microsoft CRM 2011 creates a relationship field (lookup field) automatically for each related entity when a one-to-many relationship is created. We can create a self-relationship by selecting a primary entity on both sides. Many-to-one relationship: A many-to-one relationship is created between many related entities and one primary entity. Many-to-many relationship: A many-to-many relationship can be created between many related entities. To create a many-to-many relationship, the user must have Append and Append To privileges in both side entities. We can define different relationship behaviors while creating a relationship; you can refer to http://msdn.microsoft.com/en-us/library/gg309412.aspx for more details. After creating a relationship, we can define a mapping to transfer values from parent entity to child entity, but this functionality can only achieved when a child entity record is created from a parent entity using the Add New button from the Associated view We need to set up relationship mapping so that we can take the candidate field values to the employee entity when the recruiter converts a candidate into an employee. Use the following steps to set the mapping: Navigate to 1:N Relationship under the Candidate entity. Open the contact_originating_lead mapping to edit it. Navigate to Mapping and click on New to add a mapping. Select new_variablecompensation from the Source and Target entities and click on OK. Follow step 4 to add mapping for the fields shown in the following screenshot: Form design Now we need to design forms for our entity, and we need to remove unnecessary fields from entity forms. Use the following steps to customize entity forms: Open the solution that we created. Navigate to Entity | Account | Forms. Open the main form to modify it, as shown in the following screenshot: We can remove unwanted fields easily by selecting them one by one and using the Remove ribbon button on the entity form. To place the field, we just need to drag-and-drop it from the right-hand side field explorer. Account form design Once we have customized the account entity, we need to design the account form shown in the following screenshot: Candidate form design The candidate form should look like the following screenshot after customization: Employee form design After removing unwanted fields and adding required fields, the employee form should look like the following screenshot: Setting a security model for ERMS Microsoft CRM provides us the OOB security model that helps us to prevent unauthorized access to our data. We can enforce security in Microsoft CRM using security roles. A security role is a combination of different privileges and access levels. Privileges: These are actions such as Create , Write, Delete , Read, Append, Append To, Assign, Share, and Reparent that a Microsoft CRM user can perform on entities. The list of the actions performed is as follows: Create : This action is used to create an entity record Read: This action is used to read an entity record Write: This action is used to modify an entity record Delete : This action is used to delete an entity record Append: This action is used to relate one entity record to another entity record Append To: This action is used to relate other entity records to the current entity record Share: This action is used to share an entity record with another user Reparent: This action is used to assign a different owner to an entity record Access level: This defines on which entity record a Microsoft CRM user can perform actions defined by privileges. We have the following actions under access levels: Organization: This action is used to provide access to all records in an organization Parent-child Business Unit: This action is used to provide access to all the records in the user's business unit as well as in all child business units of the user's business unit Business: This action is used to provide access to all records in the user's business unit User: This action allows the user to access records created by him/her, or shared with him/her, or shared with his/her team We must assign at least one security role to access Microsoft CRM applications. Microsoft CRM provides us with 14 OOB security roles that can be customized based on our requirements. The following diagram is the security-role hierarchy that we have identified for the Employee Management System: The blocks in the preceding diagram can be explained as follows: HR Manager : This role will have access to all information for an employee in the ERMS system Recruiter: This role will not have access to information about offered packages to an employee System Administrator: This role will have administrative privileges and will be responsible for customizing and maintaining ERMS We will be customizing the existing security roles for our ERMS . The following table shows the security role mapping that we be will using: Microsoft CRM Security Role ERMS Security Role Sales Manager Manager Salesperson Salesperson System Administrator System Administrator Customizing the existing security role We need to use the following steps to customize the existing security role: Navigation to Setting | Administration | Security Roles. Double-click on the Sales Manager role to open it in edit mode. Change Role Name to Manager. Click on Save and then on Close . Follow the same steps to change the name of the Sales Person role to Recruiter. You can also create a new Manager Security role by copying the Sales Manager role. Once we have changed the security role name, we need to configure the Security Manager and Recruiter roles to remove unnecessary privileges. Follow the ensuing instructions to configure the Manager Security role: Navigate to the Core Records tab in the Manager Security role. Clear all privileges from the Opportunity and Document location entities. Navigate to the Marketing tab and clear all privileges from the Campaign and Marketing list entities. Navigate to the Sales tab and clear all privileges from all sales module entities, as shown in the following screenshot: Navigate to the Service tab and clear all privileges from all service module entities. Click on Save and Close . Follow all the preceding steps to remove the same privileges from the Recruiter role as well. Setting field-level security in Microsoft CRM 2011 Microsoft CRM 2011 contains an OOB feature for field-level security. Using field-level security, we can protect Microsoft CRM form fields from unauthorized access. This feature is only available in custom attributes. You can only apply field-level security to the custom fields of system entities. While creating/modifying fields, you can enable field-level security. The following screenshot shows how we can Enable/Disable the Field Security option: Once field-level security is enabled, we can set the field-level security profile. Let's apply field-level security in the offered package section in the Candidate entity. We have already enabled field-level security for these three fields under the offered package section in Candidate entity. Use the following steps to set the field-level security profile: Navigate to Settings | Administration | Field Security Profiles. Click on New to create the new security profile. Fill in the following information: Name: Recruitment Team Profile Description: Security profile for recruitment team Click on Save. Navigate to Users, under the Members section, in the left-hand navigation. Click on Add to add a user from whom you want to secure these fields. Navigate to Field Permission under the Common section in the left-hand navigation. Select all records and click on the Edit button. Select No from all drop-down fields. These fields can be implemented as shown in the following screenshot: Now all Microsoft CRM users with the Recruitment security role won't be able to see the values in these fields. They won't even be able to set values for these fields.
Read more
  • 0
  • 0
  • 2615

article-image-knowing-prebuilt-marketing-sales-and-service-organizations
Packt
07 Feb 2013
20 min read
Save for later

Knowing the prebuilt marketing, sales, and service organizations

Packt
07 Feb 2013
20 min read
(For more resources related to this topic, see here.) Customizations incur new costs (of development, training, maintenance, and change management) and are typically sponsored to support the company's unique capabilities in both people and processes—capabilities that sustain its differentiation from competitors in the market. When the company is beginning or transitioning an information system for its CRM, it gets enormous value in simply adopting the information system that is already available in the CRM On Demand product, built on industry standard business process models of CRM. To go live out of the box, that is, without any customization, is effective for new companies and new organizations. When an enterprise has established its place in the market with custom-tailored CRM processes that may not map exactly to industry standards but at the same time work well for them as an organization, a customized CRM On Demand should be the order of the day. Standard enterprise technology management, such as listing the business drivers, defining the business objectives, mapping the business processes, capturing master data, identifying the transactional data to be captured, and the overarching change management towards user adoption of the new system, is independent of whether you go live with a customized CRM On Demand or go live straight out of the box. The objective of this article is to provide you with the complete list of activities to be performed to go live with CRM On Demand without any customization of the product. For example, assume your company is a global logistics business with sales, marketing, and support teams operating in many countries, bought as many CRM On Demand user licenses as there are staff in the sales, marketing, and service teams, and intends to standardize its customer relationship management system across the board. The company management has opted to go live with CRM On Demand without any customization. With an additional user license for you to administer the new system, you have the responsibility of deploying the system to the users. Here, we will explore in detail the activities that a CRM On Demand administrator would perform to deploy CRM On Demand out of the box to the intended users across the countries. We have grouped the activities in three steps. The steps are sequential and each step represents a reliable status of the deployment of the system. These steps are as follows: The first step is to familiarize with the prebuilt content in the CRM On Demand for the marketing, sales, and service organizations. The second step is setting your company-level parameters, which includes creating the login IDs, territories, and company content, such as the products catalog and the sales forecast reports. The third and last step is issuing the login IDs to the users and sustaining their adoption of the new system. By the end of this article, you will be able to do the following: Understand the business functionalities of the Vanilla CRM On Demand application Establish the primary settings in the CRM On Demand application to implement it in your company Create login IDs for the users of the application in your company. The preceding information and skills will help you deploy CRM On Demand out of the box in a structured way. Lead A lead is any addressable person who is in a potentially opportunistic position with a prospective or existing customer (account or contact) of yours, and with whom you can interact to develop an opportunity for the prospective/existing customer. The sales process might originate with lead generation. Leads move progressively through qualification to conversion. You can convert leads to contacts, accounts, deal registrations, and opportunities. After a lead has been converted to an opportunity, it enters the sales process. Certain fields in opportunity obtain their values from the lead record. These values are based on mapping the leads that have been converted during the sales process. The list of preconfigured fields in the lead object can be found in the CRM On Demand help text reference at http://docs.oracle.com/cd/E27437_01/books/OnDemOLH/index.htm?toc.htm?LeadEditHelp.html. Function — Sales The various sales functions will be explored in the upcoming sections. Account Use the Account Edit page to create, update, and track accounts. Accounts are generally organizations that you do business with, but you can also track partners, competitors, affiliates, and so on as accounts. If account records are central to how your company manages its business, as is the case in many companies, enter as much information about accounts as you can. Some of that information, such as the Region or the Industry field, can be used in reports as a way to categorize information. Similarly, if you link a record, such as an opportunity, to an account record with the Region or Industry field filled in, those opportunities can be grouped by the region. A list of preconfigured fields in the account object can be found in the CRM On Demand help text reference at http://docs.oracle.com/cd/E27437_01/books/OnDemOLH/index.htm?toc.htm?AccountEditHelp.html The Account Name and Location fields help us to uniquely identify an account record in the system, meaning there can't be two accounts in the system with the same Account Name and Location fields. Thus, an opportunity at the sales stage X that puts a probability of 60 percent implies the opportunity with that customer having a 60 percent probability of reaching Closed/Won by the expected closing date for the given revenue. Different sales processes may be defined for different types of opportunities. Multiple sales processes can be normalized using sales categories, to enable forecasting at a global level. An opportunity can be associated with only a single sales process. Revenues You can link products or services (drawn from your product catalog) to opportunities in order to do the following tasks: Track which products belong to the opportunity Calculate revenue-based opportunity on product revenue Base your company's forecasts on product revenue or product quantities If the product represents recurring revenue, you can input the Frequency and # of Periods information. For usability, you can link a product to an opportunity when you create the opportunity in an unbroken sequential step, or alternatively at a later time. To calculate the opportunity revenue based on the linked product revenue, follows these steps: On the Opportunity Detail page, click the Update Opportunity Totals button available in the Opportunity Product Revenue section. This totals the product revenue for each linked product and displays it in the Revenue and Expected Revenue fields for the opportunity. The calculation behind this functionality differs depending on whether the Product Probability Averaging Enabled option is enabled on the company profile. The company forecasting method determines which fields you must select when linking products to your opportunities. If your company forecasts the revenue, based on opportunities, rather than products, do not select the Forecast checkbox on the Opportunity Product Revenue record. If your company forecasts revenue based on product revenue, and you want to include this product revenue record as part of your forecasted revenue totals, or your forecasted quantities, or both, select the Forecast checkbox. Make sure that the date in the Start/Close Date field falls within the forecast period, and that the record is owned by a forecast participant. If a product is not sold, you can update the associated Start/Close Date and clear the Forecast checkbox on the Product Revenue page for that product to prevent the revenue for the product from being added to your company's forecasts. Alternatively, if one of the several products linked to the opportunity is on hold, you can remove the product from the opportunity, and create another opportunity for that product to prevent its revenue from being included in the forecast. A list of preconfigured fields in the opportunity revenue line object can be found in the CRM On Demand help text reference at http://docs.oracle.com/cd/ E27437_01/books/OnDemOLH/index.htm?toc.htm?opptyproducthelp.html. Assets When you want to track a product that you have sold to a customer or company, link the product record to the account as an asset. If you enter the Notify Date field's value on the asset record, a task is created when you save this asset record. The task appears as Asset Name requires follow-up on My Homepage, Account Homepage , and Calendar. A list of preconfigured fields in the asset object can be found in the CRM On Demand help text reference at http://docs.oracle.com/cd/E27437_01/books/OnDemOLH/index.htm?toc.htm?acctassethelp.html. Sales forecasts Use the Forecast page to review, adjust, and submit forecasts. A forecast is a saved snapshot of expected revenues over time. CRM On Demand calculates forecasts for each quarter and breaks down that information by fiscal month. Forecasts in CRM On Demand automate a process that is often manual and sometimes inaccurate. Forecasts help companies to develop sales strategies. They also help companies to identify future business needs by giving managers accurate and up-to-date information about expected sales and quarterly progress toward sales targets. Individual sales representatives do not have to compile statistics. Instead, they decide when to include a record in their forecasts. The remainder of the process is automatic. Function — Service The various service functions will be explored in the upcoming sections. Service requests Use the Service Request Edit page to record, track, and address customer requests for information or assistance. A service request holds all the relevant and detailed information about a particular service activity. You can also use the service request to capture additional information, such as solutions or activities required to resolve the service request. Service representatives can access all the relevant information about service requests in one location. To ensure that a service request record captures all the service activity, the changes to records can be tracked through an audit trail. A list of preconfigured fields in the service request object can be found in the CRM On Demand help text reference at http://docs.oracle.com/cd/E27437_01/books/OnDemOLH/index.htm?toc.htm?SerReqEditHelp.html. Solutions Use the Solution Edit page to create, update, and track solutions. Solutions contain information about how to resolve a customer query. By maintaining a knowledge base of solutions, your service representatives have access to a centralized knowledge base to help them resolve customer problems. In addition, the knowledge base expands as users interact with customers and create new solutions. CRM On Demand tracks the usage of solutions and enables users to rate solutions. This information helps organizations to improve the solutions that they provide to customers and to identify problems in products or services. Frequently-used solutions give indicators to the organization on areas where product quality or supporting documents have to be improved. Poor solution ratings might indicate the need to improve solutions. A list of preconfigured fields in the solution object can be found in the CRM On Demand help text reference at http://docs.oracle.com/cd/ E27437_01/books/OnDemOLH/index.htm?toc.htm?SolutionEditHelp.html. Activity Use the Calendar page to review, create, and update your activities. An activity consists of tasks that you need to accomplish before a certain date and appointments that you want to schedule for a specific time. Tasks and appointments can be meetings, calls, demonstrations, or events. The difference between tasks and appointments is that tasks appear in a task list and have a due date and status, whereas appointments are scheduled on your calendar with a specific date and time. Activities can be associated to most of the standard and custom objects in the CRM On Demand application. A list of preconfigured fields can be found in the CRM On Demand help text reference at http://docs.oracle.com/cd/E27437_01/books/OnDemOLH/index.htm?toc.htm?AppointEditHelp.html. CRM staff A user of your company's CRM On Demand gets access to the CRM data based on the accesses assigned to his user ID. Every user ID is associated to a user role, which defines all the access rights. A user ID can be associated to only one user role. There is no limit on the number of user roles that you can define on the system. The user role access levels are broadly captured in the following two types: Feature access: Features (more commonly known as privileges) refer to the type of managerial/administrative workflows and actions that a u ser can perform in the CRM system. These actions include accessing all the data in the analytics tables, accessing prebuilt dashboards, accessing prebuilt reports, creating personal reports, creating custom reports, publishing list templates, creating campaigns, leads qualification and conversion, publishing solutions, sharing calendar with others, recovering deleted data, creating the assignment rules for automatic assignment of records, accessing CRM On Demand offline version, integrating the CRM On Demand with their e-mail client and PIM, exporting their data, importing personal data, and personalizing their homepages and detail pages. Record access: These are the permissions to create/read-all/edit/delete the records in the system, and in reference to the user's ownership or absence of ownership on the record. For example, can the user create campaign records, can the user read all the leads available in the system, can the user delete his activity records, and so on. The following table describes the prebuilt user roles. You will need to map this to the staff roles in your company's CRM organization: User role Privileges Record access Executive Has access to all the features, other than administration and customization features Has access and Read all records privilege to the most common horizontal record types such as accounts, contacts, activities, assets, campaigns, leads, opportunities, service requests, and solutions and sales forecasts. They can create records of these record types except solutions. Advanced User Has access to create custom reports, create assignment rules, publish lists templates, and leads evaluation (qualification, archiving, rejection, and conversion). Has access to all "non-admin" features, such as Access All Data in Analytics. Has access and can create a privilege for the most common horizontal record types, such as accounts, contacts, activities, assets, campaigns, leads, opportunities, service requests, solutions, and sales forecasts. But advanced users can only read her/his own records. Sales and Marketing Manager Has access to sales and marketing related privileges such as create assignment rules, publish lists templates, and so on. Has access to the most common horizontal type of records and can read all the records in the system. The sales and marketing manager has no access to generate sales forecasts (this means that the manager cannot force an automatic submit of the sales forecasts of his sales representative but has to wait for the sales representative to submit their forecasts). Field Sales Rep Has access to leads evaluation (qualification, archiving, rejection, and conversion). Has access to the most common horizontal types of records and can read only those records owned by him. Inside Sales Rep Has access to leads qualification and archiving. Has access to the most common horizontal types of records and reads all the records in the system. Regional Manager Has access to leads evaluation,  Campaigns management and to create assignment rules. Has access to the most common horizontal types of records and can read only those records owned by him. Service Manager Has access to publish Solutions, publish lists templates and recover deleted data. Has access to the most common horizontal types of records (except Sales Forecasts) and can read only those records owned by him. The Service Manager can however read all the Accounts and Contacts records in the system. Service Rep - Has access to the most common horizontal types of records and can read only those records owned by himself / herself. The service representative can however read all the accounts and contacts records in the system. Administrator Has access to all features in the system, and the access to modify the accesses of other user roles. Has access to create/read/delete all types of records. The previous table lists the permissions of each prebuilt role to access a record type, to create a record of a specific record type, and whether the user has access to view all the records created in the system. The permissions on each record (read-only/edit/delete) are defined by the Owner Access Profile and the Default Access Profile settings for each role as shown in the next screenshot; these profiles are explained as follows: Owner Access Profile: Defines permission on a record when the user is the direct owner and/or a derived owner through the manager hierarchy Default Access Profile: Defines the permission on a record to a user who is not directly or indirectly the owner of that record but is visible to the user because the Can Read All Records option is selected for the relevant record type in the record-type access settings on the user's role To understand the details of the access profiles of a particular user role you will need to know two things. First, that the name of the access profile follows the convention [user role name] Default Access Profile and [user role name] Owner Access Profile. Secondly, the path to the access profiles, which is Admin | User Management and Access Controls | Access Profiles. A screenshot of Access Profile is shown as follows: This completes the first step. If you are a novice to the CRM On Demand service, we hope the preceding pages have given you the confidence and the "view" for step 2. Step 2 — Setting your company profile The second step of deploying out of the box involves giving the system the details about your company. The activities that comprise this step are as follows: The Company Administration data. Creating the login IDs for users. Creating the product catalog. Enabling the sales forecasts. Each of these activities are explored in detail in the following sections. The Company Administration data The Company Administration page is the place where you define the company profile and some other global settings. The following screenshot details some of the important parameters that can be defined as part of the company administration. You can access this section by going to Admin | Company Administration: The Company Profile The Company Profile page carries the key parameters. The screenshot is as follows: Under Company Key Information, ensure that you set the CRM On Demand administrator user as Primary Contact along with his phone number. Don't make the mistake of setting the CEO of the company as Primary Contact. If you do so, Oracle support may end up calling your CEO on any support-related matters. Under Company Settings, most of the default options such as Language, Currency, and Time Zone are set by Oracle, based on the inputs provided by you at the time of taking the trial run and/or the purchase order. As these are long-term and fairly static settings, you will need to select them thoughtfully at the start. You can change these settings with a service request to customer support. As a global company with staff distributed across various time zones, you would do well to set up the parameters in a manner that would be applicable for most of the users of the system at the company level. Note that CRM On Demand is designed for global deployments and therefore, these company-level defaults can be overridden at the user level using user-level settings. The In-Line Edit, Message Centre, and Heads-Up Display options are meant to enhance user productivity when using the system. In-Line Edit provides a facility to edit the details of the record in the list view or a detailed view without going to the edit mode. In-Line Edit reduces the amount of data sent from the client browser to the CRM On Demand server. In the following screenshot, the Location field under Company Profile can be edited without getting into the edit mode by clicking the Edit button: Similarly in the list view too, In-Line Edit facilitates a quick edit of the listed records without getting to the detailed record page. Message Center is a mini collaboration tool available to the users to share general information with other users of the system-specific or record-specific information. As you can see in the following screenshot, on clicking the notes icon on the right-hand corner of the Opportunity Detail page, the notes pop-up appears displaying the notes written by users on this opportunity record. If you opt to subscribe for the notes, any message posted by any user of the system on this opportunity record will be displayed in the Message Centre section in the left-hand side navigation bar, giving an easy access to view all the messages posted by the users. Heads-up Display provides quick links to go to a specific related information section of a record without scrolling the browser. On clicking the Contacts link, as shown in the following screenshot, the user is directly taken to the account's Contacts list applet that appears at the bottom of the Account Detail page. Clicking on the Top link will take you to the Opportunity Detail section. The Record Preview mode opens the preview window when a user points to a hyperlink or clicks the preview icon depending on the settings selected (click on the preview icon on the link). For example, if an opportunity is associated to an account, the account name is displayed as a hyperlink to navigate easily to the related Account Detail page. Enabling preview would help you to view the details of the account from the Opportunity Detail page without navigating to the Account Detail page. As shown in the following screenshot, on clicking the preview icon in the Opportunity Detail page, the details of Account Action Rentals are displayed in an overlay pop up: Global Search Method provides a facility to specify the search option you would like to enable in the system. If you choose the Targeted Search option, the system provides a facility to search by one or more of the configured fields in the object to search the records stored in the object. As you can see in the following screenshot, I have set the Targeted Search option at the company level and as a result, on the left-hand side navigation search applet, I have a facility to search Contacts in the system by Last Name, First Name, and Email. If you key in more than one field, it performs an AND search. If you like to search by a different set of fields, you can either use the Advanced search facility or customize the Search panel for all users. On the other hand if you have selected Keyword Search, the search applet in the left-hand side navigation appears as shown in the following screenshot, providing you with a single blank field where you can key in any text to do a wildcard search against a set of preconfigured fields. Unlike Targeted Search, here, the system uses the OR condition if there are more than one preconfigured field. In the previous screenshot, when you key in armexplc as an input to the search field, it gets you all contacts with the e-mail domain ending with armexplc-od.com. The prebuilt Search panel has the relevant set of fields for each object. A complete list of the preconfigured keyword search fields, sorted by objects, is available in the online help file of CRM On Demand at http://docs.oracle.com/cd/E27437_01/books/ OnDemOLH/index.htm?toc.htm?defaultsearchfieldshelp.html. Summary In this way, we can better understand the Company Administration page and work with its various settings as given in this article. Resources for Article : Further resources on this subject: Planning and Preparing the Oracle Siebel CRM Installation [Article] CRM Deployment Options [Article] Communicating from Dynamics CRM to BizTalk Server [Article]
Read more
  • 0
  • 0
  • 1791

article-image-getting-started-teamcity
Packt
07 Feb 2013
12 min read
Save for later

Getting Started with TeamCity

Packt
07 Feb 2013
12 min read
(For more resources related to this topic, see here.) Continuous Integration Continuous Integration is defined by Martin Fowler as follows: Continuous Integration is a software development practice where members of a team integrate their work frequently; usually each person integrates at least daily — leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly. Kent Beck and Martin Fowler are credited as the first users of the term Continuous Integration since 1999. Now, more than 10 years later, this term has become a well-known and well-used practice (though many interested parties might wish it would turn into an established standard) used for software design and engineering across the entire industry. The main essence of it lies in the simple practice of each delivering person in the team to meet on a very frequent, several-times-per-day basis to a source control repository. In the long run, this could save us from lots of headaches and last-minute integrations made in a rush. The more frequent this integration is, the less chance you have to get an incompatible bunch of modules instead of a rock solid application. Okay, so now you are delivering to a repository every so often but what next? Repository integration will keep the code consistent, but will it check the code for correctness or run some tests? The answer here is no. What we need at this time is some build automation, and here TeamCity steps in. Features Let's sum up some outstanding TeamCity features. Automatic and manual build triggering Do you want every change in the Version Control System (VCS) to be verified? It's never been easier. Just set up automatic build triggering on every commit and you are done. Also dependent builds could be instantly triggered after the completion of some other build and may even use their generated artifacts. At any time, we can schedule a manual build by simply clicking on the Run button. Pre-tested commit This concept also has another name — remote run. It is really a life saver when we wish to check the consistency of our patch with the whole project. Instead of performing a commit, we select Remote run on the commit screen and can decide whether to do an actual commit depending on build results. It is usually not a good idea to proceed with a commit if the build is either failed or did not introduce new failures itself, but kept previous ones in place. Instant notifications There are plenty of different ways to stay in touch with the TeamCity Server. On the other hand, it could be as simple as sending an e-mail to all interested parties and as exquisite as the Windows tray notifier. Many other options such as RSS feeds, Jabber , and plugins for major IDEs are supported. Code coverage and inspections Upon producing build results we may be interested in checking our code coverage. Further on, it is possible to apply over 600 IntelliJ IDEA's inspections in order to find actual and potential problems. Inspections result in thorough reports for probable bugs, performance issues, and obsolete code, if present. Easy to verify code changes No longer does the developer need to remember what the code looked like before a change had been introduced. TeamCity provides a very useful and effective comparison engine to easily see what actually has been modified with which changes. Configurable test reports You need not to wait for a long build run just to figure out that the very first test has failed. TeamCity will notify you at once when it notices a failing build. You will get a complete report showing which tests have failed, whether this problem has happened for the first time, and so on, with the full statistics the developer needs. Comprehensive build infrastructure TeamCity supports multiple multi-platform build agents which can be run in parallel independently of each other. It is possible to get workload information and history. Every bit of statistics related to builds is also accessible over time. It is possible to track build progress, run build chains, and apply enhanced build dependencies. Enhanced VCS integration TeamCity permits utilizing sophisticated VCS configuration . It can use a smart scheduling mechanism called quiet period, if there is a need not to run builds at once, but to wait until partial commits or ones from different roots are conducted. Agent-side checkout allows maintaining source code consistency over your builds spread between different build agents. Advanced features TeamCity provides flexible user management with the possibility of configuring per-project user roles and accesses along with user action audits. TeamCity supports adaptable user authentication with LDAP and NT authentication s upport, detection of hanging builds that take longer time than expected, discovery of JVM out-of-memory crashes, and on the fly thread dumps for running builds. Terms and concepts Let's look at some useful concepts that will help you understand TeamCity better. Build agent A build agent is an isolated software unit where actual builds are executed and run. A build agent can coexist with the TeamCity server on one physical box, however that is not required. It is possible to install two or more build agents on one machine though it is not the preferred way to go because of the performance impact those agents would have on each other: Sometimes separate build agents are needed per platform. For instance, it is often a situation that the server and the default agent are running on a Linux machine. Let's say there's a need to run some very specific kind of test such as GWT or flexunit tests on a build agent but this is impossible on a default one because these tests cannot be run in headless mode (it means display-less mode in which Linux servers usually work). A possible solution here is to install another build agent on the Windows machine. A build agent is a stateful machine. In order to make it work, the developer needs to install and run it first. At that point, the agent becomes disconnected. Then, during the configuration stage, we provide a connection link to the TeamCity server and the agent gets connected. It is still not yet ready because we need to make it authorized first. This is done manually on the Agents page. The default agent on the same machine as the server gets authorized automatically. At any point, you may disable or enable a particular build agent. Build artifact Every build may be configured to produce one or more build artifacts. They could be described as simple files that are possible to download or use in other (dependent) builds. For instance, the coverage data generated by a build is a build artifact. Also it could be some generated JAR, WAR, or other file that is configured. There are also so-called hidden build artifacts that enlist raw coverage data and maven build data. These could be accessed through a special link. Build configuration In a nutshell, this is a set of actions to be applied to the source code. You define the actions and rules to be applied to the build, and click on Run ; the configured builds would be handled by TeamCity and could be run from this point continuously and automatically. Creation of a build configuration is pretty straightforward and consists of several steps. On the first one, the name should be provided along with the rules describing how to understand if a build was successful or not. The later steps allow configuring version control settings, setting up build steps (Maven, Ant, and many other options are available). Then you can build triggering rules, dependencies, and other additional settings. Upon creation of one build configuration, it could be replicated to avoid entering the configuration data many times in a row. Even a simple setting such as a user or group notification rule can be reused. If you feel you are going to need the same build configuration several times, you may create a build configuration template. After that, you can generate new configurations with a single click — only the name of the template needs to be provided and the rest of the data would be served by the template. Each build configuration has its state — active or paused. Also, it has a completion status that can be either successful, failed, or under investigation, indicated by the corresponding icon. Before the build has been run for the first time, there'll be no icon, as the status is still unknown. Every build configuration has a unique ID, which you may refer to when performing some advanced manual configuration of TeamCity. Code coverage Code coverage is a very useful measure to describe the degree or level of how well and thoroughly the source code is covered by unit tests. This term really deserves a separate book to be written about it, though none are written yet. However, there are plenty of articles available on the Internet describing best practices. A nice start would be from the following example: http://en.wikipedia.org/wiki/Code_coverage There are many metrics that could be collected with powerful code coverage engines, TeamCity being one of them. Combined with the Sonar code inspection server (sonarsource.org) code coverage steps up to the next level where possible performance issues can be detected early on, probable bugs can be caught, or direct misuse of some language functions can be spotted. TeamCity supports coverage engines for both Java and .NET. Major build runners that support code coverage collection include Maven, Ant, NAnt, NUnit, and several more. At the time of writing, TeamCity did not support full coverage for integration tests. For example, having several Maven modules and calling one module from another will collect coverage for only the initiator module. In order to obtain this kind of coverage, the Sonar server with the Cobertura analysis tool would be needed. My Changes My changes is a special page where personal historical build information concerning a specific user is collected. Here, a user may observe his own changes and figure out how they affected builds presented by a timeline. You may go as far as viewing atomic change details presented by each build. Also the developer may navigate from here to the issue tracker directly, if issue tracker integration is turned on and properly configured. Notifiers TeamCity can utilize several notifiers. There can be either separate or common notification rules created for each of the supported notifiers. The total list includes: Email notifier undoubtedly being the most commonly used one IDE notifier shows status in your favorite IDE Jabber notifier sends events through Jabber server, that is Google Talk System Tray notifier displays updates in the Windows system tray Atom/RSS feed notifier informs you via Atom/RSS feed Settings are configured on the My Settings & Tools page in the Watched Builds and Notifications section. Pre-tested commit (remote run) This delayed commit is a very powerful feature which previously allowed TeamCity to stand out in the crowd. By now, it has been adopted by major competitors as it became very useful, and therefore, popular. In short, it allows a developer to make sure that his changes will compile without problems and pass all tests, not only on his box but on at least one isolated machine. Project A project is the largest separate TeamCity's concept used here. It is merely a group of build configurations. It should have its own name, some meaningful description and may be used to define some generic security settings for all included build configurations. You can assign separate permissions for users on a per — project basis. Version Control System A Version Control System ( VCS) is a facility to store a project's source code files and all changes made to them over time. It is expected that the VCS will represent corresponding versions of code for any given time. These slices are called revisions and are usually identified by incrementing numbers. TeamCity supports plenty of version control systems such as ClearCase, CVS , Git , Mercurial, Perforce, StarTeam , Subversion , Team Foundation Server , SourceGear Vault , and Visual SourceSafe . Summary TeamCity is a contemporary, rich-featured, distributed build management and Continuous Integration server. It has been designed for developers and by developers, thus being very intuitive, easy to use, easy to learn, and user friendly. There's absolutely nothing hard to understand neither in lifecycle, organization, or total workflow of TeamCity. TeamCity contains an extensive set of utilities which moves your development effectiveness and comfort to a totally new level. It is a light and very easy to install facility which provides you with a decent degree of certainty that the code in your version control system not only compiles, but even adheres to written tests. And all this magic happens automatically on a continuous basis without requiring any user intervention. Every change in your source code would be detected, monitored and inspected, and you shall get full report about every modification introduced. Resources for Article : Further resources on this subject: Starting with Gradle [Article] Top 10 tips for organizing an Agile IT Security Team [Article] Roles and Responsibilities for Records Management Implementation in Alfresco 3 [Article]
Read more
  • 0
  • 0
  • 12655
article-image-installing-microsoft-forefront-uag
Packt
06 Feb 2013
13 min read
Save for later

Installing Microsoft Forefront UAG

Packt
06 Feb 2013
13 min read
(For more resources related to this topic, see here.) The four faces of UAG Microsoft Forefront UAG is a product focused on centralizing and managing access to internal resources from external networks. The aforementioned statement is expressed through the following four access models: Reverse proxy (portal) Port forwarding SSL VPN DirectAccess We are able to select the HTTP or HTTPS protocol to publish the resources, and the choice will be related to security requirements, with no significant difference in the functionalities available in the two configurations. In UAG, there is also a viable alternative, the capability to pre-authenticate a user account. The access gateway will act as the endpoint of the HTTPS connection and inspect the traffic before passing it to the backend servers for authentication, adding a security layer against common Internet threats. Planning a successful deployment Before installing UAG, there is a planning phase necessary to select the kind of deployment that is more fit to our company's needs. UAG is able to work with different levels of isolation from the internal network and resources that we will make available to external users. We are able to divide the above aspect into three different design and deployment topics: The logical network in which UAG will be located The security context in which UAG will be working The IT system that will be used for the security, compliance controls, and authorization of the end points that will require access to our resources Let us start from the first point, the selection of the logical network where UAG will be positioned. The possible scenarios are as follows: When UAG is directly connected to an external network When UAG is behind an external firewall When UAG is installed in a DMZ between an external and an internal firewall Our objective is to publish resources in an efficient manner while keeping up the security level. It is a work that requires a balance between control and easiness ( often they are inversely proportional). If we plan to connect the external interface of UAG directly to a public network, we are relying on the local installation of TMG with its rules to protect the host. If we have an existing firewall, it's a good idea to keep it in front of UAG, because the level of the security will not be lowered (UAG requires TCP ports 80 and 443, and the HTTP port is in use only if we plan to deploy a listener with no encryption), and we gain an additional layer of security. The last scenario is a classic DMZ, with a second firewall deployed to isolate the Internet-exposed services from the internal network. The complexity of the configuration will be related to the UAG features we are going to use, for example, with DirectAccess it requires many modifications on the firewall before we are able to make it work. The second topic in our list is the domain membership. We have an easier deployment with UAG added as a member server to our domain, while the reverse scenario (standalone server) is interesting only if we have some concern about security on our UAG server. The third point is the control of the end points as we are able to select UAG or a Microsoft NAP infrastructure to check the devices requiring a connection. We will be talking about this topic later, but using NAP has no benefits with our scenario that is based on mobile devices. Step 1 — What we need The minimum hardware requirements are as follows: 2.66 GHz, Dual core CPU 4 GB memory and 2.5 GB of free disk space Two network adapters There is no official sizing guide for UAG. A common suggestion is to install a test environment and to evaluate our needs based on this experience. It makes sense because there are no typical deployment scenarios for UAG, and requirements are related to the features we will use and to the number of trunks and applications we are going to use. The given value for disk space is really an installation minimum. All the user activities will be logged by the system because UAG is also in charge of the application layer security, which implies that we will need a lot of disk space to manage the logs. When the number of connections (or the number of UAG servers) increases, we can send the logs to an external SQL server. The advantages of such a solution are not only related to the disk space and performances on the UAG host, but also to the consolidation and easier reporting of the log data. Logging to the SQL server requires a configuration in TMG; for more details see the related TechNet article at http://technet.microsoft.com/en-us/library/dd897065.aspx. The following are the software requirements for the installation process: Windows Server 2008 R2 Standard SP2, Windows Server 2008 R2 Enterprise SP2, or Windows Server 2008 R2 DataCenter SP2. All the required Windows roles and features will be automatically installed (Network Policy Server, Routing and Remote Access Services, Active Directory Lightweight Directory Services Tools, Web Server (IIS) Tools, Network Load Balancing Tools, and Windows PowerShell). All the required system components will be automatically installed (Microsoft .NET Framework 3.5 SP1, Windows Web Services API, Windows Update, Microsoft Windows Installer 4.5, SQL Server Express 2005). Forefront TMG is installed as a firewall during the Forefront UAG setup, and following this a Windows Server 2008 R2 DirectAccess component is added. Step 2 — Software that we need to have available The most recent version of the UAG installation media (or ISO) has Forefront Unified Access Gateway 2010 with Service Pack 1, and TMG with Service Pack 1 Update 1 slipstreamed. If we select the setup.exe file and look at the properties of the file, we will see a product version 4.0.1752.10000, that is the version number related to the Service Pack 1. However, on June 8, 2012, UAG Service Pack 2 was released and that is important for our work, because as we said the number of mobile devices supported has been expanded. The following is the logical order of the installation, using the media available at the time of writing. The list of the steps is pertinent also for existing installations; we will have to start the checklist from the step following the last applied update. 1. UAG installation. 2. TMG updates (before the UAG updates). 3. TMG SP2 (KB 2555840). 4. TMG SP2 Rollup 2 (KB 2689195). 5. UAG SP1 Update 1 (KB 2585140). 6. UAG SP2 (KB 2710791). Please remember to activate UAG after any update and before applying the next one. Often there are problems (for example, lost configuration) going from update to update with no activation in between. If we have already installed UAG and are missing UAG SP 1, we have to install it after updating TMG and prior to step 5 (UAG SP1 Update 1) of the checklist. Operating system and SQL updates are usually installed before we start with the UAG and TMG updating process, but we are free to apply those updates at the end of the previous steps. UAG 2010 Service Pack 3 will probably be available during the first quarter of the calendar year 2013, and will provide support for Windows 8, Office 2013 clients, publishing Exchange 2013, and publishing SharePoint 2013. Step 3 — Install Forefront UAG It is strongly suggested to use the console for the installation process of UAG. If we are using RDP, after the first part of the installation process (that includes the installation of TMG) the remote connection will no longer work. We have to modify the TMG rules to resolve the issue. Right-click on Firewall Policy | All Tasks | System Policy | Edit System Policy, then go to Remote Management | Terminal Server | Tab General | Enable | Tab From and insert the source IP that is allowed to access via RDP to our Forefront machine (for example, add it to Enterprise Remote Management Computers). There are some limits and topics to know before installing UAG. The Support boundaries documentation on the TechNet site contains this information. It is available at http://technet.microsoft.com/en-us/library/ee522953.aspx. Setup choices will also depend on the above notes. We can start launching the Setup.exe file from the UAG installation folder. We will have a Welcome screen, and then proceed using the Next button, as shown in the following screenshot: In the Sign Agreement screen, select to accept the license terms and use the Next button. The installation process will install a full deployment of TMG and UAG. During the Select Installation Location screen, we have to select the path where the UAG deployment will be placed. We are offered no choice on the installation location for TMG. The UAG setup will go on requiring no interaction. If we are installing with the Windows Firewall active, we will need to permit the Active Directory Lightweight Directory Services Installer traffic. AD-LDS will be used by TMG to save the TMG configuration data. After the TMG installation phase, we will be required to restart the server. The setup wizard will give us the usual radio buttons with Restart Now or Restart Later, as shown in the following screenshot: UAG installation will continue after we log on again to our host. Another system restart will be required, but this time the message will state that the wizard has been completed, as shown in the following screenshot: Step 4 — First configuration of Forefront UAG As we stated in a previous note, it is important to activate UAG before an upgrade with service packs, to prevent installation issues. The very first time we launch the UAG management console, the Getting Started wizard will be activated, with the aim to help us in the basic configuration of UAG: At the top of the list, we will have the Configure Network Settings procedure. The idea is to help us set the various network interfaces and addresses of our host. The welcome page explains that we will define network adapters and addresses. The next screen will ask us to select the context of the network interfaces we have configured on the host. The main objective here is to define at least an internal and an external network interface. The only supported configuration is the one with two network interfaces, as is specified in the aforementioned Support boundaries document. A typical configuration requires the external network interface configured with a default gateway and no DNS server. The internal interface should have no gateway and use the internal network (domain) DNS servers. If we have an internal network with more than one subnet, this configuration requires us to add static routes to all the networks that are not directly connected to UAG. This is depicted in the following screenshot: The previous step will be followed by the Define Internal Network IP Address Range window. As we said, UAG is a software to connect external users to internal resources, so the steps to outline the various networks have a deep impact on all the configurations that we're going to set from now on. The internal network is configured by selecting the internal adapter. By default, TMG protects the internal network from all other networks except the Local Host network. System policy rules in TMG expect services such as DNS servers, RADIUS servers, and domain controllers to be located with in the internal network. To learn more, refer to the Internal and perimeter network properties document which can be found at http://technet.microsoft.com/en-us/library/cc441726.aspx. We will be asked to confirm what we have done in the previous steps of the Network Configuration Wizard window. When the Configure Network Setting wizard is completed, we will be moved to the second step, Define Server Topology. TMG uses the parameters we have configured in the previous steps to create network objects. For example, our internal IP range is assigned to the internal network object. The Server Management Wizard window is our way to deploy an array of UAG servers or to define a single host. It will start with a simple welcome page. Our configuration will be a single server deployment, so we will have to select the first option. UAG uses the TMG standalone array infrastructure to provide scalability and high availability. To get started with the installation of a UAG array, we can start from the TechNet article Array deployment guide available at http://technet.microsoft.com/en-us/ library/dd857305.aspx. A configuration like this requires no further steps, and so we will have a simple confirmation screen. We are back to the Getting Started Wizard window, with the first two steps cleared, and the last one, Join Microsoft Update to be completed: The first screen is a simple welcome screen, so we will go on with the Next button. The first decision is related to Microsoft Update; if we want to use it, use our source for updates for UAG (and other Microsoft software). TMG also uses the Microsoft Update service to update malware definitions. WSUS is another alternative update method supported by TMG. For a complete table of the available features, refer to the Configuring update settings article available at http://technet.microsoft.com/en-us/library/cc995320.aspx. We will have the opportunity to join the Customer Experience Program, so we are able to select our preferred option and the Next button again. The wizard is now completed. A last confirmation screen will be displayed and we're able to select the Finish button. The Getting Started Wizard window will require a last confirmation before activating the UAG configuration. Before we activate the configuration, we will be prompted for a path to save a backup of our existing configuration (we can protect it with a password). A last confirmation to the backup and activation step is required. Each time we activate UAG , it automatically exports the configuration (if we leave the checkbox selected. And here we are, the first configuration is completed and we're ready to work with UAG. Step 5 — Updating Forefront TMG and UAG We outlined the steps required to upgrade TMG and UAG at the second step of the installation process. We will start our updating process from Service Pack 2 for TMG. The next step is TMG SP2 Rollup 2 (this is cumulative, so we don't need Rollup 1). Now we have to install UAG Update 1. If we try to skip the aforementioned update, and go straight to the Service Pack 2 for UAG, the latter will present an error. The UAG Update 1 will start. Now, before we take the next step, it's really important to activate UAG again. To do so we will have to open the UAG management console and run the little "gear" icon, as shown in the following screenshot: The last step will be the installation of UAG Service Pack 2. Again, it's a good idea to check UAG to verify the release level (select the Help menu in the UAG management console and then select About). Summary In the course of this article, we have seen the logic, pre-requirements, and configuration steps required to deploy UAG starting from the installation media and upgrading the system to the latest available service pack. TMG played an important part in the whole explanation because UAG heavily relies on TMG features to deliver its own features. Now with a working installation at our disposal, we will go on to configure SharePoint and SharePoint Workspace through UAG, to learn the fundamentals of application publishing and access. Resources for Article : Further resources on this subject: Microsoft Forefront UAG: Preparing, Creating, and Publishing an HTTPS Trunk [Article] Customizing Look and Feel of UAG [Article] Creating and configuring a basic mobile application [Article]
Read more
  • 0
  • 0
  • 14877

article-image-polishing-gems
Packt
06 Feb 2013
11 min read
Save for later

Polishing Gems

Packt
06 Feb 2013
11 min read
(For more resources related to this topic, see here.) Understanding Track Sensitivity The results you get when using several functions depends on which tracks are enabled/ selected in the Timeline window and how the transitions are constructed (i.e. straight cuts or split edits/"L-Cuts"). I call this Track Sensitivity. The functions that have this programming behavior are as follows: Fast Forward & Rewind Mark Clip Go to Previous Edit and Go to Next Edit How to do it... Let's use the Fast Forward function to present the basic steps, and to point out the differences in the results, depending on what Track Selectors are enabled. In this example recipe, it's important to understand that we have several different segments (shots) in the sequence that have been placed on tracks V1, A1, and A2, and that the transition between each shot is a split edit (in other words, the cuts between shots are not straight, but are instead staggered. This is frequently referred to as an L cut). Follow these steps: On the Record Track Selector Panel, enable only the V1 Track Selector. Place the blue Position Indicator line at the beginning of the sequence. Click on the Fast Forward function and notice that the Position Indicator jumps to the next transition (cut) on the V1 track. Click on the Fast Forward button a second time. Again, it jumps to the next transition on the V1 track. Now, along with the V1 Track Selector, also, enable the A1 and A2 Track Selectors. In other words, enable all the Track Selectors. Place the Position Indicator at the beginning of the sequence. Click on the Fast Forward function. Notice that the Position Indicator does not jump to the next transition on the video track. Instead, it has jumped farther down the sequence. Potentially, it has even jumped to the very end of the sequence. How it works... Whenever you use Mark Clip, Fast Forward/Rewind, or Go to Previous/Next Edit, Media Composer is always looking for edit points (transitions) to pay attention to. When you have two or more tracks enabled, Media Composer is looking for the transitions that exist at the same time on all the tracks that are enabled. Below is a comparison of two situations, using the Mark Clip function as an example. In the first example, you have only the Video track enabled and you park your Position Indicator (blue line) within the segment you want to mark, as shown in the following screenshot: When you click on the Mark Clip button, you can imagine that Media Composer sends out radar (metaphorically, of course) in both directions from the Position Indicator, as shown in the following screenshot: On the selected track, when it detects a transition to the left-hand side, it places the Mark In, and when it detects a transition to the right-hand side, it places the Mark Out. Refer to the following screenshot: That's easy enough. But what happens when there are multiple tracks enabled? In these cases, the metaphorical radar is looking for transitions that occur at the same time on all the tracks that are enabled. In this second example, let's look at the same Sequence as earlier, but let's enable V1, A1, and A2, as shown in the following screenshot: When you click on the Mark Clip button, Media Composer sends out its radar in both directions from the Position Indicator, as shown in the following screenshot: When it detects a simultaneous transition on all the selected tracks to the left-hand side, it places the Mark In and when it detects a simultaneous transition on all the selected tracks to the right-hand side, it places the Mark Out as shown in the following screenshot: Fast Forward/Rewind and Go to Next/Previous Edit pay attention to the Track Selectors and transitions in the same way as Mark Clip, except the radar is sent out in just one direction (either to the left or to the right). There's more... You can tell these functions not to pay attention when multiple tracks are enabled. In other words, you can make Media Composer ignore the Track Selectors. If you do this, then the radar pays attention to every transition on every track. This can be accomplished in different ways, depending on the function, and is discussed below. Fast Forward/Rewind These are the two methods that allow you to alter the default behavior: Method 1: Press the option/Alt key while using either Fast Forward or Rewind. Now the Position Indicator stops at every edit point (transition) on every track no matter what tracks are enabled. Method 2: Make Fast Forward and Rewind always ignore the Track Selectors (and save yourself the need of pressing the option or the Alt key). Go to the Project Window | Settings tab | Composer settings | FF/REW tab, and then enable the selection that says Ignore Track Selectors. Mark Clip and Go to Previous/Next Edit Below are the two methods that allow you to alter the default behavior: Method 1: Press the option/Alt key when using the Go To Previous/Next Edit or Mark Clip functions. Using option/Alt key along with Go to Previous/Next Edit makes the Position Indicator stop at every edit point (transition) on every track. Using option/Alt key along with Mark Clip will mark the duration based on the two closest transitions from the Position Indicator on any track. This is useful enough that I have both Mark Clip as well as option/Alt + Mark Clip (see Method 2) mapped to my keyboard. Method 2: Unlike Fast Forward/Rewind, there isn't a setting to change the way Mark Clip and Go to Previous/Next Edit behave, but all is not lost. If you'd rather not hold down the option/Alt key with these functions, you can add the option/Alt modifier right to the button, so it becomes a one button-push operation. I'll use the Go to Previous/Next Edit function in their default locations on the A and S keys for the example of how to do this below. Follow these steps: Open your Keyboard settings by clicking on the Project Window | Settings tab | Keyboard. Open the Command Palette by clicking on Tools menu | Command Palette. Enable the Button to Button Reassignment selection in the lower left side of the Command Palette. On the Command Palette, select the tab labeled as Other. In the first column of buttons on the Command Palette you'll see a button labeled Add Option Key (on Mac) or Add Alt Key (on PC). Drag-and-drop the Add Option Key function or the Add Alt Key function right onto the Go to Previous Edit button on your keyboard (if it's still in its default location, it's on the letter A key). After adding this, get out your magnifying glass. If you look closely, you'll see a very small black dot has appeared just below the arrow symbol to indicate that the option/Alt modifier has been added. Repeat step 6 for the Go to Next Edit button. Snapping actions for the Position Indicator and in Segment Mode With just a couple of keyboard shortcuts, you can make your Position Indicator snap right to the transition you want, and in the exact position you need, exactly on the head frame (first frame) or on the tail frame (last frame).. Plus, the convenient thing is that Media Composer uses the same keyboard shortcuts for segments when you're moving them around. How to do it... Let's begin by making the Position Indicator or a segment Snap to Head. Follow these steps: Press and hold the cmd (on Mac) or Ctrl (on PC) keys. To make the Position Indicator snap, drag it forward or backward in the sequence, or click the cursor near a transition, to make the Position Indicator snap to the Head Frame (first frame) of a segment. To make a segment snap, do the following: Select a segment with either Segment Mode arrow (red or yellow). Now, when dragging segments, holding the cmd or Ctrl key makes the beginning (left-hand side, or head) of the segment snap to transitions that exist on any track. Next we'll make the Position Indicator or a segment Snap to Tail. Press and hold the keys cmd + option/Ctrl + Alt. Drag the Position Indicator forward or backward in the sequence, or click the cursor near a transition, to make the Position Indicator snap to the Tail Frame (last frame) of a segment. Select a segment with either Segment Mode arrow. Now, when dragging segments, holding cmd + option/Ctrl + Alt makes the end (right-hand side, or tail) of the segment snap to transitions that exist on any track. There's more... Below are two additional keyboard shortcuts that apply only when you're using Segment Mode, along with some helpful details about snapping with the Position Indicator and placing Marks. Additional Segment Mode shortcuts Press the cmd + Shift keys (on Mac) simultaneously or Ctrl + Shift keys (on Windows) simultaneously — this is useful when you want to move segment(s) from one track to another without getting out of sync. This keyboard shortcut will lock (constrain) segments into their current place in time on the Timeline when you move them up or down to another track. It should be noted that, at the time of writing, when you use this keyboard shortcut and move a segment, you will hear an alert sound. This is actually telling you that you have either enabled or disabled what Avid refers to as Four Frame Display. Using this keyboard shortcut was how Four Frame Display was enabled and disabled in the past. Now that it has been programmed to constrain segments to moving only up or down, it has become a bit of an annoyance. I'm sure that the enable/disable programming will be removed in a future release. Press option (on Mac) or Alt (on Windows) — this keyboard shortcut actually doesn't control snapping, but since it has to do with moving segments, it made sense to include it here. Press the option key or Alt key while moving segments (and moving slowly) to ensure that you are moving just one frame at a time, regardless of the level of detail (how zoomed in or out you are) in the Timeline window. Details about snapping When you have snapped the Position Indicator line to the head of a segment, Media Composer will display a rather small, white, for lack of a better term I'll call it a bracket symbol, in the lower left-hand side corner of the Record Monitor. When you've snapped to the tail, the bracket symbol will be displayed in the lower right-hand side corner of the Record Monitor. Refer to the following screenshot: Paying attention to where you place the Position Indictor is important as you edit. Notice that when you zoom in (using More Detail or the Scale Bar) to take a very close look at the Position Indicator, you'll see that the blue line isn't one single line at all. This is because the Position Indicator parks on, and designates, one frame. It's actually made of two lines. The solid line of the Position Indicator is on the left-hand side (the head) of the frame and the dotted line is on the right-hand side (the tail) of the frame. When you set a Mark In, it's placed on the head side, and when you set a Mark Out, it's placed on the tail side. The following screenshot shows that just one frame has been marked: Enabling and disabling all Track Selectors from the keyboard There will be a variety of instances when enabling or disabling all the Track Selectors will be necessary or helpful. One example is when you have many tracks and before you make an edit, you have to scroll up or down to check the status (enabled or disabled) of the hidden tracks. However, with the help of the next simple recipe, you can enable/disable all the tracks (even the ones you can't see). How to do it... Follow these steps: Select the Source Window, Record Window, or the Timeline Window. Use one of these keyboard shortcuts found in the Edit Menu: Press cmd and A keys (on Mac) or Ctrl + A keys (on Windows) simultaneously to select all tracks Press the A key along with Shift and Cmd (on Mac), or Shift and Ctrl (on Windows) to deselect all tracks There's more... Media Composer also allows you to map all 24 video Track Selectors and all 24 audio Track Selectors to the keyboard. You'll find them in Tools menu | Command Palette | Tracks tab. However, by default, Media Composer lets you enable or disable Track Selectors from the keyboard for a small number of tracks. Here is the default Track Selector keyboard mapping: V2 on the 7 key, V1 on the 8 key, A1 on the 9 key, A2 on the 0 key, A3 on the — key, and A4 on the = key.
Read more
  • 0
  • 0
  • 1357
Modal Close icon
Modal Close icon