- Add the Labels gadget if is not yet added
From your dashboard, click Layout -> Add a Gadget and select Labels - Add an HTML gadget. This is where you will create your hierarchical labels.
From your dashboard, click Layout -> Add a Gadget and select HTML/Javascript - Ensure that the Labels gadget comes first before the HTML gadget in your layout.
From your dashboard, click Layout and arrange your gadgets by dragging them to the desired location so that the Labels gadget is on top or comes first before the HTML gadget - Update the Template
-
Add the dtree javascript.
From your dashboard, click Template -> Edit HTML -> Proceed and check Expand Widget Templates. Copy and paste this code<link href='https://sites.google.com/site/efekefek/file-js/dtree.css' rel='StyleSheet' type='text/css'/> <script src='https://sites.google.com/site/efekefek/file-js/createdtree.js' type='text/javascript'/>
after this tag
<b:skin><![CDATA[/*
- Remove the Label widget content
Find the Label widget code. It looks like this<b:widget id='Label1' locked='false' title='Labels' type='Label'> <b:includable id='main'> ... </b:includable> </b:widget>
Replace the code inside <b:includable id='main'> and </b:includable> with this code<script type='text/javascript'> var labelCountMap = {}; <b:loop values='data:labels' var='label'> labelCountMap ["<data:label.name/>"] = "<data:label.count/>"; </b:loop> </script>
- Save template
-
Add the dtree javascript.
- Prepare the code of the Hierarchical Labels
Copy the code below and replace the data with your own Labels. The data is in format
parentLabel: { subLabels }
The subLabels are comma separated. If the parentLabel doesn't have subLabels, replace it with {}.
<div class="dtree"> <p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p> <script type="text/javascript"> <!-- function isEmpty(obj) { for(var prop in obj) { if(obj.hasOwnProperty(prop)) return false; } return true; } function addMap(d, startingNode, parentNode, map) { for (var key in map) { if (isEmpty(map[key])) { d.add(startingNode++,parentNode,key+' ('+labelCountMap[key]+')','/search/label/'+key); } else { d.add(startingNode++,parentNode,key+' ('+labelCountMap[key]+')','/search/label/'+key); startingNode = addMap(d, startingNode, startingNode-1, map[key]); } } return startingNode; } var data = { 'Label 1' : { 'Label 1.1' : {}, 'Label 1.2' : { 'Label 1.2.1' : {} }, 'Label 1.3' : {} }, 'Label 2' : { 'Label 2.1' : {}, 'Label 2.2' : {} }, 'Label 3' : {}, 'Label 4' : {}}; d = new dTree('d'); d.config.useLines = true; d.config.useIcons = false; d.config.inOrder = true; d.add(0,-1,''); addMap(d, 1, 0, data); document.write(d); //--> </script> </div>
- Paste the code in the HTML widget
From your dashboard, click Layout and Edit the HTML widget. Paste the code inside Content and Save
Wednesday, May 9, 2012
How to create Sublabels / Hierarchical Labels in Blogspot
I always wanted my label section to look like the archive section where labels can have hierarchy and the number of posts is displayed beside each label. I learned how to create the hierarchical tree from this blog but the nodes have to be added one by one and the number of posts per label are not displayed so I tweaked it a little to suit my needs. Here are the steps:
Tuesday, August 16, 2011
Wednesday, July 27, 2011
Maven POM
- all POM inherits from Super POM
- if the configuration details are not specified in your POM, Maven will use their defaults(from Super POM)
- to display the final POM (Super POM + your own POM) generated, use command:
mvn help:effective-pom
- hot to skip tests: http://maven.apache.org/plugins/maven-surefire-plugin/examples/skipping-tests.html
Source: http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
Monday, July 25, 2011
Basic UNIX commands
- man - manual/help
- pwd - print working/current directory
- ls - list files
- ls -l - lists files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified
- cd - change directory
- mkdir [dir] - creates dir
- rmdir [dir] - removes dir
- more [options] file(s) - Display contents of files
- less [options] file(s) - Display contents of files
Useful commands while viewing a file with 'more' or 'less':- <spacebar> - scroll forward one page
- ^b (control-b) - scroll backward one page
- /<text> - search for string
- n - find next occurence of string
- N - find previous occurence of string (search for string in opposite direction)*
- g - go to the beginning of the file*
- G - go to the end of the file*
- v - edit the current file with 'vi'*
- :n - go to the next file*
- :p - go to the previous file*
- q - quit
*works in 'less', not 'more' - grep [options] <pattern> [files] - search inside files for the given pattern
Useful options:- -i - ignore case
- -r or -R - search files in directories/subdirectories recursively
- -v - nvert match: select non-matching lines
- tail [options] [filenames] - show tail/end of file
- tail -f temp.log - follow/monitor the file, display the last 10 lines of temp.log and append new lines to the display as new lines are added to temp.log
- vi filename - edit the file
Modes:- command mode - letters of the keyboard will be interpreted as commands
- insert mode - letters of the keyboard will type or edit text
- x - deletes the character the cursor is under
- dd - deletes the line the cursor is on
- a - append after the cursor
- i - insert before the cursor
- ESC - non edit mode
- :wq - saves the current changes and exits vi
- :w - saves the current changes but does not exit vi
- :q - exits vi without saving any change
References:
http://claymore.rfmh.org/public/computer_resources/unix_commands.html
http://mally.stanford.edu/~sr/computing/basic-unix.html
http://cmgm.stanford.edu/classes/unix/vi.html
http://en.wikipedia.org
http://www.ccsf.edu/Pub/Fac/vi.html
Friday, July 22, 2011
Installing your own jar into Local Repository
- Update your maven setting to point the localRepository to where you want to install the jar
- Go to <MAVEN_HOME>\conf directory
- Open settings.xml and change <localRepositorygt; tag to the path where you want to install the jar file
- In command prompt, type:
mvn install:install-file -Dfile=your-artifact-1.0.jar \ [-DpomFile=your-pom.xml] \ [-Dsources=src.jar] \ [-Djavadoc=apidocs.jar] \ [-DgroupId=org.some.group] \ [-DartifactId=your-artifact] \ [-Dversion=1.0] \ [-Dpackaging=jar] \ [-Dclassifier=sources] \ [-DgeneratePom=true] \ [-DcreateChecksum=true] Where: <path-to-file> the path to the file to load <group-id> the group that the file should be registered under <artifact-id> the artifact name for the file <version> the version of the file <packaging> the packaging of the file e.g. jar
Sample:
mvn install:install-file -Dfile=C:\bel\docs\lib\jxl-2.6.3.jar -DgroupId=jexcelapi -DartifactId=jxl -Dversion=2.6.3 -Dpackaging=jar -DgeneratePom -DcreateChecksum=true - In your repository, you will find the new jar installed
- To use the jar, add it in your pom.xml like:
<dependency> <groupId>jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.6.3</version> </dependency>
Monday, April 25, 2011
Maven Setup
- Install Maven
- Update {MAVEN_HOME}\conf\settings.xml
Update the following:- localRepository
- proxies
- profiles
- activeProfiles
Sunday, March 6, 2011
Deployment
- Create the package for full release
- Check out the Project in Eclipse
- Open SVN Repositories. Click Window->Open Perspective->SVN Repository Browser
- Assuming that you already have Repository Location set up, find the project in the trunk or branches
- Right click project then click Show History to ensure that it has the latest change/fix needed
- Tag or make a branch out of the project. Right click project then click New->Tag or Branch
- Right click newly created tag/branch then click Show History to ensure that the it has the latest change/fix needed
- Check out the newly created tag or branch. Right click project the click Check Out
- Build the package
- In the console, go to emea-pom of the checked out project
- Type
mvn clean package –DemeaVersion=${currentversion}
- After a successful build, go to the emea-release project and copy the whole target folder in a different directory.
- Check out the Project in Eclipse
- Generate the config files/folders of the package
- Create a config folder inside the target folder or where the jar is located
- Create folders dev, sit, uat and prod inside config folder
- Open you FTP Client (e.g. FileZilla) and copy the config files to the newly created folders
- DEV
- SIT
- UAT
- PROD
- DEV
- Update the ini file with the changes from project and change the VERSION property
- Create a config folder inside the target folder or where the jar is located
- Deploy DEV using the exploded jar
- In FileZilla, upload/add target/classes/versions to /ams/domains/ACCTSVCS102/versions
- In FileZilla, copy target/config/dev to/ams/domains/ACCTSVCS102/versions/config
- On DEV WEBLOGIC, stop and delete previously deployed ear
- Open Putty and login to DEV (ehdeapp10v.uk.jpmorgan.com)
- Point latest to latest deployed version
- Go to /ams/domains/ACCTSVCS102/versions/biz-rules
- Type rm latest
- Type ln -s {newversionFolder} latest
- Do step 1-3 to config & emea folders as well
- Go to /ams/domains/ACCTSVCS102/versions/biz-rules
- On DEV WEBLOGIC, deploy new ear and start
- Delete temporary files
- Go to /ams/domains/ACCTSVCS102/scripts and type stop_all.sh
- Go to /ams/domains/ACCTSVCS102/servers/admACCTSVCS
- Delete tmp folder. Type rm -rf {folderName}
- Go to /ams/domains/ACCTSVCS102/servers/mngACCTSVCS
- Delete tmp & stage folder
- Go to /ams/domains/ACCTSVCS102/scripts and type start_all.sh
- Go to /ams/domains/ACCTSVCS102/scripts and type stop_all.sh
- Check server: DEV
- In FileZilla, upload/add target/classes/versions to /ams/domains/ACCTSVCS102/versions
- Copy package(jar) and config files to SIT (ehdeapp10v.uk.jpmorgan.com), /home/eis_dev/a_pfdv01/AMSNA
- Create JIRA
- Finish!
Labels:
Apache Maven,
Application Server,
Eclipse,
Operating System,
Technologies,
Tools,
Unix,
Weblogic
Subscribe to:
Posts (Atom)