RSS

Tag Archives: tutorials

Bonita Windows Server Installation on Tomcat

Requirements

Installation Steps

  • Install JRE by clicking on the downloaded file.
  • Install JDK by clicking on the downloaded file.
  • Unzip Apache Tomcat file to a folder, use this path as <TOMCAT_HOME>.
  • Unzip Bonita Open Solution Deployment file to a folder. This folder is referenced as <BOS-5.9-DEPLOY> in the installation guides.
  • Follow this instruction:
    http://www.bonitasoft.com/resources/documentation/bos-59/system-administration/installation/install-bos-%E2%80%9C-scratch%E2%80%9D/install-bos-tomcat
    Notes:

    1. Skip “Download Tomcat” section.
    2. Skip “Download server files” section.
    3. Configure JAAS authentication and communication” section is not necessary if you are not using custom authentication. Follow this step if changes to JAAS authentication is required, for example, use LDAP for authentication.
    4. Configure BOS Tomcat for other databases” section is not necessary if you are not planning to use different database.
  • Add environment variable:
    1. Follow this instruction to add environment variables:
      http://technet.microsoft.com/en-us/library/cc736637(v=ws.10).aspx
    2. Value for “JRE_HOME” and “JAVA_HOME” depend on version of JRE and JDK you downloaded. Make sure the value reflect to folder where the installation is.
    3. Add JRE_HOME
      1. key: JRE_HOME
        value: C:\Program Files (x86)\Java\jre7
    4. Add JAVA_HOME
      1. key: JAVA_HOME
        value: C:\Program Files (x86)\Java\jdk1.7.0_13

Startup / Shutdown Tomcat

It’s necessary to startup / shutdown Tomcat in proper way before replacing / modify any file in <TOMCAT_HOME> folder.

To startup Tomcat

  • On command prompt, browse to <TOMCAT_HOME>\bin folder.
  • Run “startup.bat” file.

To shutdown Tomcat

  • On command prompt, browse to <TOMCAT_HOME>\bin folder.
  • Run “shutdown.bat” file.

Running Bonita User Experience

Bonita REST API

You can install Bonita REST API with the following step:

  • Copy <BOS-5.9-deploy>\bonita_execution_engine\interfaces\REST\with_execution_engine_without_client\bonita-server-rest.war
  • Paste the file into <TOMCAT_HOME>\webapps

Running Bonita REST API

If you need to use an REST client, you must have acknowledgement of the Bonita HTTP API. All HTTP requests will be done using the POST method.

All requests, except checkUserCredentials, checkUserCredentialsWithPasswordHash and getIdentityKeyFromTemporaryToken, will require authentication using HTTP Basic.

To generate your first REST API call, follow this step under “REST client“:

http://www.bonitasoft.org/blog/tutorial/how-to-use-the-bonita-http-api/

 
1 Comment

Posted by on February 14, 2013 in General

 

Tags: , , ,

Facebook Login Integration in ASP.NET MVC

  1. Obtain App Id from Facebook site.
    http://developers.facebook.com/apps
  2. Create new ASP.NET MVC 4 Web Application project (with Internet Application template).

  3. Open the _LoginPartial.cshtml file under Views\Shared folder.
    b
  4. Comment out all code and insert the following:
    <div id="fb-root"></div>
    <script>
        // Load the SDK Asynchronously
        (function(d){
            var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
            if (d.getElementById(id)) {return;}
            js = d.createElement('script'); js.id = id; js.async = true;
            js.src = "//connect.facebook.net/en_US/all.js";
            ref.parentNode.insertBefore(js, ref);
        }(document));
    
        // Init the SDK upon load
        window.fbAsyncInit = function() {
            FB.init({
                appId      : '<app_id>', // App ID
                channelUrl : '//' + window.location.hostname + '<port>/Home/Channel', // Path to your Channel File
                status     : true, // check login status
                cookie     : true, // enable cookies to allow the server to access the session
                xfbml      : true  // parse XFBML
            });
    
            // listen for and handle auth.statusChange events
            FB.Event.subscribe('auth.statusChange', function(response) {
                if (response.authResponse) {
                    // user has auth'd your app and is logged into Facebook
                    FB.api('/me', function(me){
                        if (me.name) {
                            document.getElementById('auth-displayname').innerHTML = me.name;
                        }
                    })
                    document.getElementById('auth-loggedout').style.display = 'none';
                    document.getElementById('auth-loggedin').style.display = 'block';
                } else {
                    // user has not auth'd your app, or is not logged into Facebook
                    document.getElementById('auth-loggedout').style.display = 'block';
                    document.getElementById('auth-loggedin').style.display = 'none';
                }
            });
    
            // respond to clicks on the login and logout links
            document.getElementById('auth-loginlink').addEventListener('click', function(){
                FB.login();
            });
            document.getElementById('auth-logoutlink').addEventListener('click', function(){
                FB.logout();
            });
        }
    </script>
    
    <div id="auth-status">
        <div id="auth-loggedout">
            <a href="#" id="auth-loginlink">Login</a>
        </div>
        <div id="auth-loggedin" style="display:none">
            Hi, <span id="auth-displayname"></span>
            (<a href="#" id="auth-logoutlink">logout</a>)
        </div>
    </div>
    
  5. Replace <app_id> in above code with your own app id.
  6. Replace <port> in above code with your application’s port.
    You can get application’s port under Project’s properties window. In the screenshot, it’s 6270.

  7. Create new Action in Home controller, name it Channel.
  8. Add the view for Channel action with no layout or master page (uncheck “Use a layout or master page”).
  9. Edit Channel.cshtml to look as following.
    <script type="text/javascript" src="//connect.facebook.net/en_US/all.js"></script>
    

  10. On Facebook Developer App Settings, set the app to interact with Website. Then set the site’s URL to your application full URL.
  11. Compile and run your ASP.NET MVC application.
  12. Login button on the top right corner should take your users to Facebook login page.
Resource and more readings:
 
7 Comments

Posted by on July 13, 2012 in General

 

Tags: , , , ,

Using Wireless Extender (Netgear WiFi Range Extender – WN2000RPT) on AT&T U-verse Router (Windows and Macintosh)

There are tricks in order to use wireless extender on AT&T U-verse router. I am using Netgear Universal WiFi Range Extender (WN2000RPT) for my wireless extender.

Just connecting the extender and complete the extender’s configuration will only give you access to the network, but not the Internet access. This means, you can access the computer within the network, but you can’t access the Internet. This is what I got:

  1. Go to Netgear configuration manager.
  2. Turn off DHCP feature on the extender by going to “IP Address Setup” and use static ip address.
    On “IP Address” field, specify the ip address you want for the extender. Remember this ip address.
    Do note that the “Gateway IP Address” and “Primary DNS” are the ip of your AT&T U-verse router. By default, the AT&T U-verse router’s ip is 192.168.1.254.
  3. Click Apply button to save the setting.
  4. Now, configure your computer’s network setting to point its default gateway and primary dns to the extender’s ip address.
  5. On Windows, open up the network adapter setting.
  6. Display the properties.
  7. Properties on “Internet Protocol Version 4 (TCP/IPv4)” or something similar to that.
  8. Define ip address and dns server address.
    On “IP address”, specify ip address you want for this computer.
    On “Default Gateway” and “Preferred DNS server”, type in the AT&T U-verse router’s ip address. By default, the AT&T U-verse router’s ip is 192.168.1.254.
  9. Go back to network adapter setting to restart the connection (disable and then enable again).

Mac users: you can do the same thing: point your Mac’s network default gateway and dns server address (router) to AT&T U-verse router’s ip address.

To access your network setting, go to System Preferences > Internet & Wireless > Network > Advanced > TCP/IP.

The side effect (not sure if it’s good / bad…) of using this technique is your AT&T U-verse router will assign a ‘dynamic’ ip address for the extender. What I meant by ‘dynamic’ here is, the ip address will constantly change depend on what device is making connection to AT&T U-verse router. So for example, you have specify the extender ip address as 192.168.1.1 in the extender’s configuration manager and you have 2 devices connecting to the extender with ip addresses as 192.168.1.5 and 192.168.1.6 respectively, the extender ip address in AT&T U-verse router will change from 192.168.1.1, 192.168.1.5 or 192.168.1.6.

Update 4.19.2011: For those who use VMWare Workstation, please read additional post if you have problem connecting the extender to your router: VMWare Workstation and Wireless Network Adapter Problem.

 
38 Comments

Posted by on April 12, 2011 in General

 

Tags: , , ,

Getting Data Across (Pass Values) Between View, Controller and External Source in ASP.NET MVC 2 and MVC 3

Here’s the list of my post related to getting data across / pass values between View, Controller and external source:

  1. with Query String (No Modification to Route Table)
  2. with Parameters
  3. with System.Web.Mvc.FormCollection
  4. with Domain Model and / or View Model
  5. (MVC 2) with JSON + ViewModel
  6. (MVC 3) with JSON + VIewModel
  7. (MVC 3) with JSON + ViewModel (Multiple Objects)
 
Leave a comment

Posted by on March 20, 2011 in General

 

Tags: , , , , , ,

Convert ASP.NET MVC 2 Project to ASP.NET MVC 3 (Visual Studio)

  1. Remove the following references:
    System.Web.Mvc (v 2.0)
  2. Add the following references:
    System.Web.Mvc (v 3.0)
    System.Web.Helpers
    System.Web.WebPages
  3. Here’s my final references:

    If you don’t have any of the above references, you might want to add them.
  4. Add / modify the root Web.config file for the following sections:
    <configuration>
        <appSettings>
            <add key="ClientValidationEnabled" value="true"/>
            <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
        </appSettings>
    </configuration>
    
    <configuration>
        <system.web>
            <compilation debug="true" targetFramework="4.0">
                <assemblies>
                    <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                </assemblies>
            </compilation>
        </system.web>
    </configuration>
    
    <system.web>
        <pages>
            <namespaces>
                <add namespace="System.Web.Helpers" />
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Routing" />
                <add namespace="System.Web.WebPages"/>
            </namespaces>
        </pages>
    </system.web>
    
  5. Add / modify the view Web.config file for the following sections:
    <configuration>
        <configSections>
            <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
                <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
            </sectionGroup>
        </configSections>
    </configuration>
    
    <configuration>
        <system.web.webPages.razor>
            <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <pages pageBaseType="System.Web.Mvc.WebViewPage">
                <namespaces>
                    <add namespace="System.Web.Mvc" />
                    <add namespace="System.Web.Mvc.Ajax" />
                    <add namespace="System.Web.Mvc.Html" />
                    <add namespace="System.Web.Routing" />
                </namespaces>
            </pages>
        </system.web.webPages.razor>
    </configuration>
    
 
Leave a comment

Posted by on March 17, 2011 in General

 

Tags: , , ,

MVC Music Store for ASP.NET MVC 2 (ASPX View Engine)

The ASP.NET MVC website is currently on MVC 3, so the sample applications, specifically MVC Music Store, have also been updated to MVC 3 with Razor view engine.

If you want to download the “ASPX” view engine version of the sample applications, you can do so in CodePlex website. All previous versions are also available.

Here’s the link to MVC Music Store, ASPX view engine version: MVC Music Store v0.8. The cool thing is, you can also download the step by step tutorial for this version in the PDF format.

 
Leave a comment

Posted by on March 15, 2011 in General

 

Tags: , , ,

Easy Start with WCF and Workflow Foundation (WF)

WCF + WF, why not?

  1. Fire up Visual Studio 2010
  2. Create new “WCF Workflow Service Application” project, called it “Development.WcfAndWf”
  3. At the very basic, you already get a WCF service that’s ready to go. This WCF Workflow Service Application is pretty much the same as regular WCF Service Application. If you open ‘web.config’ file, you will the similar tags.
  4. Notice when you run this project (Service1.xamlx), Visual Studio will run its test client as shown below. This test client is the same one you see in WCF Service Application.
  5. Another similarity to regular WCF Service Application is when you run this under your browser (open web.config and press F5). You will also be able to see the WSDL.
  6. Let’s consume this service. Create new “Console Application” project under the same solution. Call this project “Development.Client”.
  7. Now, we need to add Service Reference to our WCF Workflow Service Application. Right click on Reference folder > Add Service Reference.
  8. Click on Discover button. Leave the Namespace as is or give it a nice name.
  9. Open up Program.cs file from “Development.Client” project.
  10. Write the following code:
    namespace Development.Client
    {
        class Program
        {
            static void Main(string[] args)
            {
                var service = new ServiceReference1.ServiceClient();
                var result = service.GetData(12);
    
                Console.WriteLine(result);
                Console.ReadLine();
            }
        }
    }
    
  11. Set the project as a startup project.
  12. Run (F5). You should see the following:
 
1 Comment

Posted by on March 11, 2011 in General

 

Tags: , , , , ,

 
%d bloggers like this: