Tuesday, 25 July 2017

Configure OpenProject CE 5.0 on Docker

What is "Docker"?


Docker is the world’s leading software container platform. Developers use Docker to eliminate “works on my machine” problems when collaborating on code with co-workers. Operators use Docker to run and manage apps side-by-side in isolated containers to get better compute density. Enterprises use Docker to build agile software delivery pipelines to ship new features faster, more securely and with confidence for both Linux and Windows Server apps.

About OpenProject:

OpenProject is a web-based project management system for location-independent team collaboration. This open source application is released under the GNU General Public License Version 3 and is continuously developed by an active open source community.
In addition to numerous smaller OpenProject installations there are also some very large installations in global organizations with more than 2,500 projects

Features:
  • Project management and milestones
  • Issue management
  • Bug tracking,
  • project timelines,
  • Wiki
  • Document management
  • Forum
  • Time tracking
  • Project news


This blog will help you to setup your OpenProject on Docker. Below listed steps will guide you to install docker on your operating system (Ubuntu) and configure OpenProject on it:

Step 1: 
Install Docker on your machine

-> Use below command to install docker on your machine
Command:          sudo apt-get install docker


Note: You can check by running the below command whether the docker has successfully been installed or not. If docker is installed successfully on your machine then you will be able to see screen like below after running docker command:


Here, your docker has been successfully installed. Now, before setting up OpenProject on docker, you need to create few directories to manage your logs and other data.

Step 2: 
Create Folders (Directories):

You can run below command to create these directories:
Command: sudo mkdir -p /var/lib/openproject/{pgdata,logs,static}

Note: this command will create a directory named "openproject" inside lib folder and 3 other folders (pgdata, logs, statics) inside openproject folder.

Step 3: 
Configure OpenProject on Docker:

Once you have successfully installed the docker on your machine, you can hit below command to setup OpenProject on your docker:

sudo docker run --name testopenproject --network="host" -d -p 8080:80
                -e SECRET_KEY_BASE=secret
                -e EMAIL_DELIVERY_METHOD="smtp"
                -e SMTP_ADDRESS="smtp.rediffmailpro.com"
                -e SMTP_PORT=xxx
                -e SMTP_DOMAIN="abcd.com"
                -e SMTP_AUTHENTICATION=plain
                -e SMTP_ENABLE_STARTTLS_AUTO=true
                -e SMTP_USER_NAME="deepak.kumar@hello.com"
                -e SMTP_PASSWORD="hello123"
                -v /var/lib/openproject/pgdata:/var/lib/postgresql/9.4/main
                -v /var/lib/openproject/logs:/var/log/supervisor
                -v /var/lib/openproject/static:/var/db/openproject
                openproject/community:5.0


This command creates a container named "openproject" configured on port 8080:80 and enables its emailing feature with given SMTP settings.

Note: Please do not forget to add "sudo" before using any command on terminal.

  

Commands that will help user to play around with Docker & OpenProject:

1) Display a list of all running/exited Docker containers:
Command:          docker ps -a 



2) Display a list of docker images:
Command:         sudo docker images



3) Return the info of the last container started:
Command:         docker ps -l


4) To kill already running container:
Command:         sudo docker kill nilehrms


5) To start a stopped container:
Command:         sudo docker start -ai <container-name>


6) Check the IP Addresses:
Command:         ifconfig


7) To check the logs:
Command:         tail -500f apache2-stdout.log


8) To remove a container:
Command:         sudo docker rm <container_name / container ID>


9) To run a command in a running container in a new terminal session in the container
Command:         docker exec -it <container_name> <command_to_execute>
# example : docker exec -it oracle_container /bin/bash to open a new bash terminal inside the already running container named oracle_container.


References: 


~ Thanks for visiting.

Wednesday, 21 December 2016

Switching DVM on the basis of "choose-when-otherwise" clause

What is DVM:
Domain value maps operate on actual data values that transit through the infrastructure at run-time. They enable you to map from one vocabulary used in a given domain to another vocabulary used in a different domain. For example, one domain may represent a city with a long name (Boston), while another domain may represent a city with a short name (BO).

#Use-Case:
Here, we have a simple use-case. We have two different DVMs. The only difference is one DVM has state code of 2 characters and another one has it of 3 characters.

Now, while testing if we pass "India" as country in 3rd parameter it will call a DVM which has 3 character state code otherwise it will call the next one.

To test your Domain Value Map use-case, first create a schema as shown below.


Now, create a XSL mapper file to map its (XSD) source node to target node. 



Now, create 2 DVM which are as belows:



Here is the XSL code:

<ns0:processResponse>    
<ns0:res_Name>        
<xsl:value-of select="/ns0:process/ns0:Name"/>      
</ns0:res_Name>      
<ns0:res_State>        
<xsl:value-of select="/ns0:process/ns0:State"/>      
</ns0:res_State>      
<xsl:choose>        
<xsl:when test="/ns0:process/ns0:Country='India'">          
<ns0:res_Country>            
<xsl:value-of select='dvm:lookupValue ("DVM/DVMwithQualifier.dvm", "State", /ns0:process/ns0:State,"StateCode", /ns0:process/ns0:State )'/>          
</ns0:res_Country>        
</xsl:when>        
<xsl:otherwise>          
<ns0:res_Country>            
<xsl:value-of select='dvm:lookupValue ("DVM/NormalDVM.dvm", "State", /ns0:process/ns0:State,"StateCode", /ns0:process/ns0:State )'/>                                                     
</ns0:res_Country>        




</xsl:otherwise>      
</xsl:choose>    
</ns0:processResponse>

Create a normal BPEL process and use a transformation inside and choose your schema for source and target part with created XSL file.



Now, run the process. Finish.

=====================================================================

If you want to use DVM with qualifiers then you need to change the dvm:lookupValue arguments accordingly. Which will be look like this:

dvm:lookupValue(dvmName, source-column-name, source-column-value, target-column-name, default-value, qualifier-name1, qualifier-value1, qualifier-name2, qualifier-value2)

& your DVM would be look like this:


=====================================================================

Domain Value Map for 1 to many:

For using one-to-many relationship in DVM you to create an extra varialbe in XSLT and needs use Xpath function to use variable's value in destination nodes.

Here is XSL:

<xsl:template match="/">
    <xsl:variable select='dvm:lookupValue1M ("DVMs/city.dvm","city",/ns0:request/ns0:cityname,"state","country","region")'
                  name="cityDetail"/>
    <ns0:response>
      <ns0:state>
        <xsl:value-of select="$cityDetail/state"/>
      </ns0:state>
      <ns0:country>
        <xsl:value-of select="$cityDetail/country"/>
      </ns0:country>
      <ns0:region>
        <xsl:value-of select="$cityDetail/region"/>
      </ns0:region>
    </ns0:response>
  </xsl:template>



Here is XSD and DVM:




======================================================================

Note: Sometimes while testing your XSLT you might end up with some error, which you can resolve by setting serverURL and testURL.


Tuesday, 9 June 2015

ADFUtils and JSFUtils

  • JSFUtils



  • JSFUtils



Monday, 8 June 2015

How to implement CSS in ADF

Hello all,

This is a small post regarding "Implementation of CSS in ADF". Implementation of CSS in ADF application is very common and is also very useful as well, as it enhance the User Interface (UI) of Application.

JDeveloper supports two options for applying style information to your ADF Faces components:
  • Build a skin and a cascading style sheet (CSS) using defined style selectors and configure your ADF application to use the skin and style sheet.
  • Use style properties to override the style information from the skin CSS to set specific instances of component display.
Here, we are going to use a CSS file to change the look and feel of ADF components.

Steps are as follows:

 1) First, create a Fusion Web Application (ADF). I have created CssInAdf.


Then, create a *.jspx page as showing above.

2) Now, you can add ADF faces components on your *.jspx page, so that we could apply CSS on those components. I have used ADF's outputtext component for the same.

Type outputtext in component palette (appears right side of your screen by default) &
Drag & drop Output Text (ADF Faces.Common Components) from component palette to your *.jspx page.


To provide space between two outputtext or any other components, you may use Spacer (ADF Faces.Layout) and can set its width or height as shown in the following image.



Here I haven't applied any panel or from on this *.jspx page. However, you may use PanelGroupLayout or PanelFormLayout to customize your page as per your requirement.

3) Now, right click on ViewController and go to New option. Create CSS file and give a name to it.


Now, there will be a CSS file under your Web Content section on your Application Navigator (left side of your screen). This CSS file comes up with some default text which you can delete if you do not need that.

Here, I have created 3 new CSS classes mycss1, mycss2 & mycss3 respectively. See below:



4) Now, create trinidad-skins.xml file. Right click on WEB-INF & choose New option. Now, select  XML Document (XML) from the list.




Now, paste the following code in trinidad-skins.xml file:


**Note: Please note one thing that skin-family should be same in both XML file (trinidad-config.xml & trinidad-skins.xml). Like I have used skyros in both the files.



In above image style.css (text in red circle) is the name of the CSS file which we had created earlier and css is the name of the directory under which it exists.

5) Now, go to your *.jspx page and find resource component in your component palette. Drag & drop it on form of your *.jspx page and select type as CSS.



6) Now, select resource component from you *.jspx's Structure panel and go to its Property Inspector. Provide the source of your CSS file as shown below :-




After clicking on Edit button you can choose your style.css file and press OK. Now, you would be able to see something like below:


7) Now, select the the OutputText component from your *.jspx page and go to its Property Inspector and provide the CSS class name in StyleClass section. Changes will be shown on your JSPX page. Like below:


Repeat the same thing for next two OutputText component & run your JSPX page. JOB DONE...!!
Here is the final screen....


--> You can download the sample application from here


Here we done....Thanks , Happy Learning :)