ThinkingRock Forum

To go back to http://www.trgtd.com.au
It is currently Sat May 25, 2013 6:47 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Jul 02, 2007 6:43 am 
Offline

Joined: Sat Jun 30, 2007 8:36 am
Posts: 2
I'm a programmer and would like to develop new modules (addons) to TR (which BTW rocks!). High on my list is a module to synchronize the data file to a website/ftpsite so that it can be used at home and work on different computers.

I could not find any documentation on the mechanics of creating a module. Is there a How-To or some manual that shows how to accomplish this? Thanks for your help,

MPX


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 12:01 am 
Offline

Joined: Wed Jul 05, 2006 10:51 am
Posts: 898
Location: Sydney, Australia
Hi

TR is now built on the NetBeans ( http://www.netbeans.org ) platform - or in other words its a NetBeans Rich Client Program (RCP). There is documentation on this at http://www.netbeans.org/kb/trails/platform.html

Basically you need to get NetBeans 5.1 and the TR source then open the top level tr project. To create a new module click the ThinkingRock main project (in NetBeans) and go File, New Project, then choose NetBeans Plug-in Modules, then Module Project. You then give it a name and a few other things and you have a new TR module.

Have a look at the "TR Data" module/project for some actions dealing with opening the data file etc, to get started.

Please let me know if you have any other questions.

_________________
ThinkingRock Developer


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 2:40 pm 
Offline

Joined: Mon May 07, 2007 11:03 am
Posts: 74
Location: Amsterdam, NL
Hi mpx,

Nice initiative!
Personally, I always thought of ThinkingRock modules as parts working *on* the data, and not *with* the data. That's why I created my own very simple (Windows) batch script to copy the XML data file before and after working with ThinkingRock to a central location. It works with Unison (open source, cross platform) to distribute the XML file across multiple locations so that everywhere I want to use ThinkingRock, I can.

Let me know if you're interested.

charlieMOGUL


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 1:45 am 
Offline

Joined: Sat Jun 30, 2007 8:36 am
Posts: 2
charlieMOGUL, Excellent idea. It's always better to divvy up the responsibility to individual tools ala unix style.

BTW, I had not heard about Unison - wow the joys of opensource - it always amazes me the amount of quality open source software available. Thank you for letting know of that software.

Would you mind sharing your script?
Also any tips on which public accessible central location (website/ftpsite) to save the data?

-mpx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 1:25 pm 
Offline

Joined: Mon May 07, 2007 11:03 am
Posts: 74
Location: Amsterdam, NL
Ok, maybe a bit off-topic, but here's my setup.
Use with care at your own risk: it's not very user-friendly.
Suggestions/additions etcetera are always more than welcome.

What this does:
The batch file ThinkingRockWrapper.cmd is executed when you want to run ThinkingRock. It starts the UnisonWrapper.cmd script which on it's turn synchronizes the ThinkingRock XML files with a central location.
After synchronizing, it starts up ThinkingRock.
After ThinkingRock finishes, it starts the UnisonWrapper again to make sure all changes are synchronized.
Unison works by looking for changes in files, it doesn't work with a master-slave setup between files. This way, you can run ThinkingRock on all your different computers and know that you're always using the right XML file.
Unison stores previous versions of the XML file as well, so you can use a backup in case something goes wrong.

Note that you'll have to have a central repository where you can store the XML file on (eg. a Networked Attached Storage server or a server where Unison runs as server).

How to use (Windows OS):
*) Copy all the needed files to your computer
*) Adjust the paths in ThinkingRockWrapper.cmd and UnisonWrapper.cmd where necessary
*) Adjust the paths in ThinkingRock.prf where necessary
*) Create a shortcut with the ThinkingRock icon pointing to the ThinkingRockWrapper.cmd exe script

Unison (to synchronize files) is a GNU-licensed free download at http://www.cis.upenn.edu/~bcpierce/unison/download.html
It's cross-platform, so this can be used on non-Windows OSes as well.

* ThinkingRockWrapper.cmd is the main script which starts UnisonWrapper .cmd and ThinkingRock
* UnisonWrapper.cmd is a wrapper around Unison
* ThinkingRock.prf is a Unison profile where the paths to synchronize are stated


Good luck,

charlieMOGUL


Top
 Profile  
 
 Post subject: ThinkingRockWrapper.cmd
PostPosted: Wed Jul 04, 2007 1:26 pm 
Offline

Joined: Mon May 07, 2007 11:03 am
Posts: 74
Location: Amsterdam, NL
Code:
@echo off
setlocal enabledelayedexpansion

REM ThinkingRockWrapper
REM initial version - 19-06-2007 - charlieMOGUL

set NAME=ThinkingRockWrapper
set VERSION=0.2

REM make sure this points to your ThinkinRock executable
set THINKINGROCKEXE=C:\Program Files\ThinkingRock2\thinkingrock\bin\thinkingrock.exe

REM make sure this points to the UnisonWrapper.cmd script
set UNISONWRAPPER=c:\scripts\UnisonWrapper.cmd

if not exist "%UNISONWRAPPER%" (
   echo Could not find %UNISONWRAPPER%"
   echo exiting...
   pause
   exit /b
)
if not exist "%THINKINGROCKEXE%" (
   echo Could not find %THINKINGROCKEXE%"
   echo exiting...
   pause
   exit /b
)

cmd.exe /c "%UNISONWRAPPER%"
"%THINKINGROCKEXE%"
cmd.exe /c "%UNISONWRAPPER%"

endlocal


Last edited by charlieMOGUL on Wed Jul 04, 2007 1:27 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: UnisonWrapper.cmd
PostPosted: Wed Jul 04, 2007 1:27 pm 
Offline

Joined: Mon May 07, 2007 11:03 am
Posts: 74
Location: Amsterdam, NL
Code:
@echo off
setlocal enabledelayedexpansion

REM UnisonWrapper
REM initial version - 19-06-2007 - charlieMOGUL

set NAME=UnisonWrapper
set VERSION=0.2
set TEMPFILE=%TMP%\%NAME%.tmp
set LOGDIR=c:\logging\scripts
set LOGFILE=%LOGDIR%\%NAME%.log

REM Make sure this points  to the Unison executable
set UNISONEXE=c:\Unison\Unison-2.28.17 Text.exe

REM Make sure this points to the directory where ThinkingRock.prf is kept
set UNISON=c:\settings\Unison\

REM Make sure this has the name of the Unison profile without extension
set PROFILE=ThinkingRock

if not exist %LOGDIR% mkdir %LOGDIR% 1>nul 2>&1
if not exist "%UNISONEXE%" (
   echo %UNISONEXE% not found >> %LOGFILE%
   exit /b
)
if not exist "%UNISON%\%PROFILE%.prf" (
   echo %UNISON%\%PROFILE%.prf not found >> %LOGFILE%
   exit /b
)

"%UNISONEXE%" %PROFILE% 1>>%LOGFILE% 2>>&1

endlocal


Top
 Profile  
 
 Post subject: ThinkingRock.prf
PostPosted: Wed Jul 04, 2007 1:28 pm 
Offline

Joined: Mon May 07, 2007 11:03 am
Posts: 74
Location: Amsterdam, NL
Code:
# The local directory where the ThinkingRock.xml file is stored
root = c:/Program Files/ThinkingRock2/ThinkingRock/
# The remote directory where the ThinkingRock.xml file is stored
root = //MY/UNC/PATH/ThinkingRock/
# Maximum number of old versions to keep
maxbackups = 2
# The directory where old versions are kept
backupdir = //MY/UNC/PATH/Old/
batch = true
auto = true
backup = Name *


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group