Creation Zone

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 9 November 2009

Java Code to Convert TWiki URLs to HTML Links

Posted on 01:50 by Unknown
Few days ago I was looking for some code or tool with the ability to convert TWiki URLs to equivalent HTML URLs. (For the uninitiated, TWiki supports wide variety of URL formats in addition to the standard HTML format.). I spent almost 3 hours searching the web and trying out different code, Java classes etc., But at the end, none of the things that I found elsewhere seems to have the ability to convert almost all the TWiki URL formats that I'm trying to convert [to HTML]. So, I gave up looking for some readymade code and quickly wrote some Java code to resolve the issue that I'm trying to solve.



Now that I have the code, thought publishing it in my blog would help other people who are looking for something similar to this. So here it is. Download the source code from the following location.



        TwikiToHTML.java



The code assumes that the TWiki system is deployed on http://www.mandalika.com (a fake web site), and is capable of handling the following TWiki URL formats:





[[http://twiki.etclabs.com/pub/MDE/IsveSeeameRomanIvanovMeraJanuaryTechEval/MeraJanuaryScoping.pdf][MeraJanuaryScoping]]

[[Main.JNetX#April_22nd_2008_Whats_new_at_Sun][report]]

[[Main.RomanIvanovLDomsCheatSheet][Executiontrackingpage]]

[[MDE.IsveBravoJeffTaylorProgressApamaSolarisx64Pott][Link]]

[[IsveSeeameOrgadKimchiIGTvLabProcedures][docs]]

[[http://scweb.france.com/~fparient/pub/europa08solaris.odp][solarisprezo]]<br>[[http://scweb.france.com/~fparient/pub/europa08fx.pdf][fxbenchmark]]

[[OmalleyDataProject]]

[[http://twiki.etclabs.com/bin/view/Main/MySQL64NvPlan][Plan]],[[http://twiki.etclabs.com/bin/view/Main/IntegrateSFW][Detail]]

MDE.IsveAlphaBogdanVasiliuSynopsysVCSPerformanceOptimization

http://sidc.israel.com/~mk147459/Reports/ana.html

SofCheck

<a href="http://twiki.org">twiki</a>





Sample inputs and outputs:





% java TwikiToHTML



TWiki URL: NotSoPl@inY0uKnow

HTTP equivalent:



TWiki URL: ItIsJustplain

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Downloads/ItIsJustplain" target="_new">ItIsJustplain</a>



TWiki URL: GiriK@lyanaChakravarth!

HTTP equivalent:



TWiki URL: &ersand

HTTP equivalent:



TWiki URL: Harisha

HTTP equivalent:



TWiki URL: Janaki Lakshmi

HTTP equivalent:



TWiki URL: JanakiLakshmi

HTTP equivalent:



TWiki URL: [[OmalleyDataProject]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Downloads/OmalleyDataProject" target="_new">OmalleyDataProject</a>



TWiki URL: [[Giri][Mandalika]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Downloads/Giri" target="_new">Mandalika</a>



TWiki URL: [[Giri][Mandalika]], [[Kalyana][Chakravarthy]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Downloads/Giri" target="_new">Mandalika</a><BR><a href="http://www.mandalika.com/bin/view/Downloads/Kalyana" target="_new">Chakravarthy</a>



TWiki URL: [[Giri][Mandalika]], [[Kalyana][Chakravarthy]], [[IsveSeeameOrgadKimchiIGTvLabProcedures][docs]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Downloads/Giri" target="_new">Mandalika</a><BR><a href="http://www.mandalika.com/bin/view/Downloads/Kalyana" target="_new">Chakravarthy</a><BR><a href="http://www.mandalika.com/bin/view/Downloads/IsveSeeameOrgadKimchiIGTvLabProcedures" target="_new">docs</a>



TWiki URL: [[Giri][Mandalika]], [[Kalyana][Chakravarthy]], [[IsveSeeameOrgadKimchiIGTvLabProcedures][docs]], [[OmalleyDataProject][Omalley]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Downloads/Giri" target="_new">Mandalika</a><BR><a href="http://www.mandalika.com/bin/view/Downloads/Kalyana" target="_new">Chakravarthy</a><BR><a href="http://www.mandalika.com/bin/view/Downloads/IsveSeeameOrgadKimchiIGTvLabProcedures" target="_new">docs</a><BR><a href="http://www.mandalika.com/bin/view/Downloads/OmalleyDataProject" target="_new">Omalley</a>



TWiki URL: http://sidc.israel.etclabs.com/~mk147459/Reports/ana.html

HTTP equivalent: <a href="http://sidc.israel.etclabs.com/~mk147459/Reports/ana.html" target="_new">ana.html</a>



TWiki URL: http://sidc.israel.etclabs.com/~mk147459/Reports/ana.html,http://technopark02.blogspot.com

HTTP equivalent: <a href="http://sidc.israel.etclabs.com/~mk147459/Reports/ana.html" target="_new">ana.html</a><BR><a href="http://technopark02.blogspot.com" target="_new">technopark02.blogspot.com</a>



TWiki URL: [[http://www.mandalika.com/pub/MDE/IsveSeeameRomanIvanovMeraJanuaryTechEval/MeraJanuaryScoping.pdf][MeraJanuaryScoping]]

HTTP equivalent: <a href="http://www.mandalika.com/pub/MDE/IsveSeeameRomanIvanovMeraJanuaryTechEval/MeraJanuaryScoping.pdf" target="_new">MeraJanuaryScoping</a>



TWiki URL: [[http://www.mandalika.com/bin/view/Main/RomanIvanovRStyleSoftlabRSBankV6][execution details]] <BR> [[http://www.mandalika.com/bin/view/Main/OracleRAConLDom][OracleRAConLDom]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Main/RomanIvanovRStyleSoftlabRSBankV6" target="_new">execution details</a><BR><a href="http://www.mandalika.com/bin/view/Main/OracleRAConLDom" target="_new">OracleRAConLDom</a>



TWiki URL: [[http://www.mandalika.com/pub/ISVeProjects/ISVeProject20080213161851/Project20080213161851scoping.odt][scoping document]] , [[http://www.mandalika.com/pub/MDE/IsveSeeameRomanIvanovMeraJanuaryTechEval/MeraJanuaryScoping.pdf][MeraJanuaryScoping]] <BR> [[http://sidc.israel.etclabs.com/~ok134283/techeval/snooggie.html][techeval]] , [[http://sidc.israel.etclabs.com/~ok134283/techeval/servision.html][techeval]]

HTTP equivalent: <a href="http://www.mandalika.com/pub/ISVeProjects/ISVeProject20080213161851/Project20080213161851scoping.odt" target="_new">scoping document</a><BR><a href="http://www.mandalika.com/pub/MDE/IsveSeeameRomanIvanovMeraJanuaryTechEval/MeraJanuaryScoping.pdf" target="_new">MeraJanuaryScoping</a><BR><a href="http://sidc.israel.etclabs.com/~ok134283/techeval/snooggie.html" target="_new">techeval</a><BR><a href="http://sidc.israel.etclabs.com/~ok134283/techeval/servision.html" target="_new">techeval</a>



TWiki URL: [[Main.RomanIvanovLDomsCheatSheet][Execution tracking page]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Main/RomanIvanovLDomsCheatSheet" target="_new">Execution tracking page</a>



TWiki URL: [[MDE.IsveBravoJeffTaylorProgressApamaSolarisx64Pott][Link]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/MDE/IsveBravoJeffTaylorProgressApamaSolarisx64Pott" target="_new">Link</a>



TWiki URL: [[Main.JNetX#April_22nd_2008_Whats_new_at_Sun][report]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Main/JNetX#April_22nd_2008_Whats_new_at_Sun" target="_new">report</a>



TWiki URL: [[Main.RomanIvanovLDomsCheatSheet][Execution tracking page]], [[MDE.IsveBravoJeffTaylorProgressApamaSolarisx64Pott][Link]] <BR> [[Main.JNetX#April_22nd_2008_Whats_new_at_Sun][report]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Main/RomanIvanovLDomsCheatSheet" target="_new">Execution tracking page</a><BR><a href="http://www.mandalika.com/bin/view/MDE/IsveBravoJeffTaylorProgressApamaSolarisx64Pott" target="_new">Link</a><BR><a href="http://www.mandalika.com/bin/view/Main/JNetX#April_22nd_2008_Whats_new_at_Sun" target="_new">report</a>



TWiki URL: [[http://www.mandalika.com/bin/view/MDE/IsveKylinPDSChinaVolumeISVWorldonline][World-Online]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/MDE/IsveKylinPDSChinaVolumeISVWorldonline" target="_new">World-Online</a>



TWiki URL: [[ISVeProjects.IsveIndividualSummaryCarylTakvorian][Caryl Takvorian]] Tom Duell

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/ISVeProjects/IsveIndividualSummaryCarylTakvorian" target="_new">Caryl Takvorian</a>



TWiki URL: [[http://www.mandalika.com/bin/view/MDE/IsveGANEIndividualSummaryAndrewWalton][Andrew Walton]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/MDE/IsveGANEIndividualSummaryAndrewWalton" target="_new">Andrew Walton</a>



TWiki URL: [[http://etclabswebcollab.east.etclabs.com/gm/folder-1.11.1890618][Project Folder]]

HTTP equivalent: <a href="http://etclabswebcollab.east.etclabs.com/gm/folder-1.11.1890618" target="_new">Project Folder</a>



TWiki URL: [[http://etclabswebcollab.east.etclabs.com/gm/document-1.9.3262994/SUN%25E4%25B8%25BB%25E6%259C%25BAOCS%25E6%2580%25A7%25E8%2583%25BD%25E6%25B5%258B%25E8%25AF%2595%25E6%258A%25A5%25E5%2591%258A.doc][Cust. Report]], [[http://etclabswebcollab.east.etclabs.com/gm/document-1.9.3270163/ocs_perftune_t2000.odt][ISVE Report]]

HTTP equivalent: <a href="http://etclabswebcollab.east.etclabs.com/gm/document-1.9.3262994/SUN%25E4%25B8%25BB%25E6%259C%25BAOCS%25E6%2580%25A7%25E8%2583%25BD%25E6%25B5%258B%25E8%25AF%2595%25E6%258A%25A5%25E5%2591%258A.doc" target="_new">Cust. Report</a><BR><a href="http://etclabswebcollab.east.etclabs.com/gm/document-1.9.3270163/ocs_perftune_t2000.odt" target="_new">ISVE Report</a>



TWiki URL: MDE.IsveAlphaBogdanVasiliuSynopsysVCSPerformanceOptimization

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/MDE/IsveAlphaBogdanVasiliuSynopsysVCSPerformanceOptimization" target="_new">IsveAlphaBogdanVasiliuSynopsysVCSPerformanceOptimization</a>



TWiki URL: [[Main.RomanIvanovLDomsCheatSheet]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Main/RomanIvanovLDomsCheatSheet" target="_new">RomanIvanovLDomsCheatSheet</a>



TWiki URL: MDE.PostgreSQLAutoTune <BR> [[Main.RomanIvanovLDomsCheatSheet]] , MDE.IsveAlphaBogdanVasiliuSynopsysVCSPerformanceOptimization

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/Main/RomanIvanovLDomsCheatSheet" target="_new">RomanIvanovLDomsCheatSheet</a><BR><a href="http://www.mandalika.com/bin/view/MDE/PostgreSQLAutoTune" target="_new">PostgreSQLAutoTune</a><BR><a href="http://www.mandalika.com/bin/view/MDE/IsveAlphaBogdanVasiliuSynopsysVCSPerformanceOptimization" target="_new">IsveAlphaBogdanVasiliuSynopsysVCSPerformanceOptimization</a>



TWiki URL: [[http://www.mandalika.com/bin/view/ISVeProjects/IsveIndividualSummaryMohammedYousuf][Mohammed Yousuf]], Thiagarajan Chandrasekaran

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/ISVeProjects/IsveIndividualSummaryMohammedYousuf" target="_new">Mohammed Yousuf</a>



TWiki URL: MDE.IsveDabuboirProsDamienCookeMyStaffMyStaffPostgreSQLAdoption [[http://twiki.etclabs/pub/MDE/IsveDabuboirProsDamienCookeMyStaffMyStaffPostgreSQLAdoption/MyStaff.html][Project Status]]

HTTP equivalent: <a href="http://twiki.etclabs/pub/MDE/IsveDabuboirProsDamienCookeMyStaffMyStaffPostgreSQLAdoption/MyStaff.html" target="_new">Project Status</a><BR><a href="http://www.mandalika.com/bin/view/MDE/IsveDabuboirProsDamienCookeMyStaffMyStaffPostgreSQLAdoption" target="_new">IsveDabuboirProsDamienCookeMyStaffMyStaffPostgreSQLAdoption</a>



TWiki URL: [[http://www.xxx.yyy]], <a href="http://www.xyz.com">xyz</a>, http://www.yahoo.com , <a href="www.giril.com">giri</a> , [[http://www.harisha.com][harisha]], <a href="www.etclabs.com">etclabs</a>

HTTP equivalent: <a href="http://www.xyz.com">xyz</a><BR><a href="www.giril.com">giri</a><BR><a href="www.etclabs.com">etclabs</a><BR><a href="http://www.xxx.yyy" target="_new">www.xxx.yyy<BR><a href="http://www.harisha.com" target="_new">harisha</a><BR><a href="http://www.yahoo.com" target="_new">www.yahoo.com</a>



TWiki URL: New link YousufCertificationofOracleRAConSolaris10u6Containers , old link http://blogs.etclabs.com/rac

HTTP equivalent: <a href="http://blogs.etclabs.com/rac" target="_new">rac</a>



TWiki URL: attached email.

HTTP equivalent:



TWiki URL: [[http://www.mandalika.com/bin/view/MDE/Caucho Caucho]] [[http://www.mandalika.com/bin/view/MDE/ISVeProject20070812164315 20070812164315]]

HTTP equivalent: <a href="http://www.mandalika.com/bin/view/MDE/Caucho" target="_new">Caucho</a><BR><a href="http://www.mandalika.com/bin/view/MDE/ISVeProject20070812164315" target="_new">20070812164315</a>



TWiki URL: http://download.sap.com/download.epd?context=40E2D9D5E00EEF7CB82813BD3F95797BAEB80527B36EC026E03386D659E4DE48

HTTP equivalent: <a href="http://download.sap.com/download.epd?context=40E2D9D5E00EEF7CB82813BD3F95797BAEB80527B36EC026E03386D659E4DE48" target="_new">download.epd?context=40E2D9D5E00E ... BAEB80527B36EC026E03386D659E4DE48</a>







Disclaimer:

This code is poorly documented, not perfect and most importantly may not even meet the minimum Java coding standards. However it does the intended job with minor modifications. Feel free to use, modify, reproduce or redistribute - but please do not come back complaining. I have no intention of fixing or improving this code.
Email ThisBlogThis!Share to XShare to Facebook
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Database: Oracle Server Architecture (overview)
    Oracle server consists of the following core components: 1) database(s) & 2) instance(s) 1) database consists of: 1) datafil...
  • C/C++: Printing Stack Trace with printstack() on Solaris
    libc on Solaris 9 and later, provides a useful function called printstack , to print a symbolic stack trace to the specified file descripto...
  • Binary compatibility
    What's It? "Binary compatibility" (BC) is the ability of one machine to run software that was written for another without hav...
  • C/C++: Structure Vs Union
    A structure is a collection of items of different types; and each data item will have its own memory location. Where as only one item withi...
  • UNIX/Linux: File Permissions (chmod)
    A file's permissions are also known as its 'mode'; so to change them we need to use the 'chmod' command (change mode). T...
  • C++: Virtual Function
    A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacemen...
  • Achievement Award
    Got an Achievement Award/Certificate from Sun Microsystems, in recognition for my effort with Siebel Benchmark!! =:) Related post: http:...
  • Solaris/C/C++: Benefit(s) of Linker (symbol) Scoping
    Introduction By default, the static linker (ld) makes all ELF symbols global in scope. This means it puts the symbols into the dynamic symbo...
  • C/C++/Java: ++ unary operator
    #include <stdio.h> int main() { int i = 5, j = 5; int total = 0; total = ++i + j++; printf("\ntotal o...
  • Linux: Finding out the amount of free & used memory
    The command free can be used to display the total amount of free and used physical and swap memory in the system,as well as the shared memor...

Categories

  • 80s music playlist
  • bandwidth iperf network solaris
  • best
  • black friday
  • breakdown database groups locality oracle pmap sga solaris
  • buy
  • deal
  • ebiz ebs hrms oracle payroll
  • emca oracle rdbms database ORA-01034
  • friday
  • Garmin
  • generic+discussion software installer
  • GPS
  • how-to solaris mmap
  • impdp ora-01089 oracle rdbms solaris tips upgrade workarounds zombie
  • Magellan
  • music
  • Navigation
  • OATS Oracle
  • Oracle Business+Intelligence Analytics Solaris SPARC T4
  • oracle database flashback FDA
  • Oracle Database RDBMS Redo Flash+Storage
  • oracle database solaris
  • oracle database solaris resource manager virtualization consolidation
  • Oracle EBS E-Business+Suite SPARC SuperCluster Optimized+Solution
  • Oracle EBS E-Business+Suite Workaround Tip
  • oracle lob bfile blob securefile rdbms database tips performance clob
  • oracle obiee analytics presentation+services
  • Oracle OID LDAP ADS
  • Oracle OID LDAP SPARC T5 T5-2 Benchmark
  • oracle pls-00201 dbms_system
  • oracle siebel CRM SCBroker load+balancing
  • Oracle Siebel Sun SPARC T4 Benchmark
  • Oracle Siebel Sun SPARC T5 Benchmark T5-2
  • Oracle Solaris
  • Oracle Solaris Database RDBMS Redo Flash F40 AWR
  • oracle solaris rpc statd RPC troubleshooting
  • oracle solaris svm solaris+volume+manager
  • Oracle Solaris Tips
  • oracle+solaris
  • RDC
  • sale
  • Smartphone Samsung Galaxy S2 Phone+Shutter Tip Android ICS
  • solaris oracle database fmw weblogic java dfw
  • SuperCluster Oracle Database RDBMS RAC Solaris Zones
  • tee
  • thanksgiving sale
  • tips
  • TomTom
  • windows

Blog Archive

  • ►  2013 (16)
    • ►  December (3)
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (2)
    • ►  January (1)
  • ►  2012 (14)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ►  2011 (15)
    • ►  December (2)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (19)
    • ►  December (3)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (5)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ▼  2009 (25)
    • ►  December (1)
    • ▼  November (2)
      • PeopleSoft North American Payroll on Sun Solaris w...
      • Java Code to Convert TWiki URLs to HTML Links
    • ►  October (1)
    • ►  September (1)
    • ►  August (2)
    • ►  July (2)
    • ►  June (1)
    • ►  May (2)
    • ►  April (3)
    • ►  March (1)
    • ►  February (5)
    • ►  January (4)
  • ►  2008 (34)
    • ►  December (2)
    • ►  November (2)
    • ►  October (2)
    • ►  September (1)
    • ►  August (4)
    • ►  July (2)
    • ►  June (3)
    • ►  May (3)
    • ►  April (2)
    • ►  March (5)
    • ►  February (4)
    • ►  January (4)
  • ►  2007 (33)
    • ►  December (2)
    • ►  November (4)
    • ►  October (2)
    • ►  September (5)
    • ►  August (3)
    • ►  June (2)
    • ►  May (3)
    • ►  April (5)
    • ►  March (3)
    • ►  February (1)
    • ►  January (3)
  • ►  2006 (40)
    • ►  December (2)
    • ►  November (6)
    • ►  October (2)
    • ►  September (2)
    • ►  August (1)
    • ►  July (2)
    • ►  June (2)
    • ►  May (4)
    • ►  April (5)
    • ►  March (5)
    • ►  February (3)
    • ►  January (6)
  • ►  2005 (72)
    • ►  December (5)
    • ►  November (2)
    • ►  October (6)
    • ►  September (5)
    • ►  August (5)
    • ►  July (10)
    • ►  June (8)
    • ►  May (9)
    • ►  April (6)
    • ►  March (6)
    • ►  February (5)
    • ►  January (5)
  • ►  2004 (36)
    • ►  December (1)
    • ►  November (5)
    • ►  October (12)
    • ►  September (18)
Powered by Blogger.

About Me

Unknown
View my complete profile