User:Matt

Wiki Page about the project : http://wiki.ooo4kids.org/index.php/NewWriterWizard

Project description
WSU groups mission is to learn from Object Oriented Design Analysis class curriculum that is offered to seniors with a goal to have students to work on a collaborative open source project.

Why OOo4Kids


 * The 4 students of WSU group in Object Oriented Design Analysis class that wanted to work with openoffice.org to gain experience.
 * After researching the openoffice.org website we found that there was a program that would introduce software development to students at http://education.openoffice.org/.
 * We were not sure how we could contribute to such a large software project at this point.

Diary Tasks

I'll be writing the essential outlines of our work.

1.2.1
 * How would we contact the project developers at the Education Project for Openoffice.org?
 * How do we choose an Incubator project for something that would be right for our group, and how would we get set up to work on a project?


 * We found was that the organization uses IRC channels to communicate on specified weekly meetings and that we should first subscribe to a mailing list from http://education.openoffice.org/servlets/ProjectMailingListList to the following address dev@education.openoffice.org.
 * After subscribing to the education mailing list WSU group meet with Eric on the education projects IRC channel, we agreed that OOO4Kids project would be right for us to contribute to.
 * We found the OOo4Kids website to be well organized and welcoming to students wanting to learn through experience.

1.2.2 OS Platform
 * WSU group was not initially setup to all work on the same OS platform.
 * 2 students were working on linux
 * 1 was working on windows 7
 * 1 was working on mac OSx.

Linux Solution
 * On mac OSx I downloaded & installed VMware Fusion (Virtual Machine for Macs) that would run linux within OSx.
 * I would not have to partition the Hard Drive.
 * VMware Fusion is only an emulator for an OS
 * I downloaded a VMware ISO Linux Ubuntu file that I installed directly in to VMware Fusion.
 * To allocate the Linux virtual machine sufficient memory for programs the virtual disc must be reallocated.
 * Then expanded before a user finishes the install, otherwise the default is to run linux with a 10GB limit.
 * Once you set up the OOo4kids environment on linux you will have less that 1GB of free space that should give an error.
 * Allocate at least 46GB, because after installation of linux your free space on you virtual disc should be 38GB.
 * After setting up the OOo4Kids linux contributors environment you will about 26GB Free space.
 * WSU group is now using linux.

Environments Installs
 * WSU through the instructions for Ubuntu linux at Environment Setup
 * We ran a bash shell for all of the suggested installs
 * Then installed ccache to speed up any future builds of the code and enables it to 1GB or more.
 * WSU installed subversion for putting our designs to the revison control system.

1.2.3 Downloading the Source #You may need to download needed to download libxslt-dev
 * A svn call to checkout the latest verion of the OOo4Kids source worked for all of us.
 * While running the configuration script I got 1 error:
 * Then we ran the configure script again from the OOo4kids directory without any errors
 * bootstrap then ran without any errors.

Compiling the Source set | grep OOo4Kids #output OOo4Kids=YES
 * Source compilation environment for linux Intel (source LinuxX86Env.Set.sh) worked:

Building the Source
 * Building the source worked from within the instsetoo_native directory.
 * Starting the build at 11:15pm it finishing before 5:15am.

Installing OOo4Kids cd $SOUCE_ROOT/instsetoo_native/unxlngx6.pro/OOo4Kids/rpm/install/en-US_download tar -zxvf filename*tar.gz dpkg -i *.deb
 * The install instructions I ran the first time installed OOo4Kids suit in some other language.
 * A WSU group member knew how to reinstall the software in english:
 * Reinstall everything with:

1.2.4 Editors Install
 * As for VMware Fusion linux Ubuntu it works okay
 * We installed emacs & vim editor.
 * The emacs & vim that come with linux are not the full version and then are difficulty to work with.
 * OOo4Kids suit now is running

1.2.5 concerns
 * Are there more student level steps to take before working with source code?
 * How can WSU group open up a branch of source code for the WriterWizard in emacs to study it without breaking what we have installed?
 * Where will we go to with any C++ questions?
 * How do we get started?

1.2.6 solutions
 * WSU group needs to focus on our wiki pages and familiarizing our selves vim or emacs.
 * With ccache installed it will allow us to only compile certain packages of the source code separately.
 * We might have to install different packages again.
 * C++ designs within the source code probably can be answered collaboratively
 * Some of the advanced concepts of C++ will be challenging.
 * Intercommunication within WSU group through emails and IRC needed.

1.2.7 emacs chmod u+x myprogram.cpp #worked g++ myprogram.cpp #compiled ./a.out #runs the program
 * running a basic c++ program from the command line of a terminal is working:

1.2.8 rebuilding libs including symbols source LinuxX86_64Set.Env.sh
 * symbols are helpful debugging tools not within OOo4kids source when it is build
 * the libs themselves are binargy files used at runtime by OOo4kids
 * first build the environment again:

cd my_OOo4Kids/sfx2 mv unxlngi6.pro unxlngi6.pro_back
 * then make a back up of the working files incase they need to be restored:

build debug=t
 * next build the previous file with debug variable:

# allows for OOo4kids to be installed with symbols for sfx2 lib $SOURCE/my_OOo4Kids/sfx2/unxlngi6.pro/lib libsfxli.so
 * you should be able to view:

$SOURCE/my_OOo4Kids/vcl/unxlngi6.pro/lib libdesktop_detectorli.so libvclli.so  libvclplug_genli.so  libvclplug_svpli.so
 * repeat for SOURCE/my_OOo4Kids/vcl :

cd instsetoo_native export PKGFORMAT=installed build
 * Now install a new version of ooO4kids with symbols:


 * The build takes around 20 minutes

cd $SOURCE/my_OOo4Kids/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/basis1.0/program mv libvclli.so libvclli.so_back mv libvclplug_genli.so libvclplug_genli.so_back mv libvclli.so libvclli.so_back mv libvclplug_svpli.so libvclplug_svpli.so_back mv libdesktop_detectorli.so libdesktop_detectorli.so_back cp ../../../../../../../../../vcl/unxlngi6.pro/lib/* cp ../../../../../../../../../vcl/unxlngi6.pro/lib/*. cp ../../../../../../../../../sfx2/unxlngi6.pro/lib/*. mv libsfxli.so libsfxli.so_back cp ../../../../../../../../../sfx2/unxlngi6.pro/lib/*.
 * Also run a back up of *.so files for the following:

./soffice
 * finally from the current directory:

1.2.9 subversion svn checkout URL myfolder --username myusername
 * Worcester State has allocated WSU group a local subversion repository, to be used as a method of version control.
 * I have contacted our universities request for our involvement in setting up this repository, and I have successfully made a connection with:

1.2.10 emacs
 * with OOo4Kids rebuilt with symbols WSU group can experiment with our editors to set break points for the files pertain to the New Writer Wizard.
 * emacs using gdb should stop on the exact line of code that gives any error(s).

1.2.11 irc classroom on gdb gdb -q --args myprogram #that should print Reading symbols from $home/Desktop/myprogram...done. #and the prompt (gdb)
 * GDB is a useful in finding bugs within programs code from the command line, by being able to pause the program at breakpoints and watch expressions.
 * For example for myprogram.c gdb can be use with:

(gdb) run Starting program: $home/Desktop/myprogram #type 'bt' and Type a command : bt #prints a backtrace of the program stack
 * Then run the program:

#0 0x0018b418 in gets  from /lib/tls/i686/cmov/libc.so.6 #1 0x080484ef in read_string (s=0x0) at myprogram.c:30 #2 0x08048491 in main  at myprogram.c:16
 * The printout of the programs stack will then be displayed:

(gdb) shell file myprogram myprogram: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
 * Check the status of the program with:

(gdb) l
 * To list the first 23 lines of the program use:

#and set a breakpoint on line 13 with (gdb) b 13 #that prints Breakpoint 1 at 0x804847d: file myprogram.c, line 13. #run the program again (gdb) r

#choose to start the program from the beginning The program being debugged has been started already. Start it from the beginning? (y or n) y

Starting program: $home/Desktop/myprogram


 * Then gdb will stop the program at the breakpoint that was set:

Breakpoint 1, main at myprogram.c:13 13	   char           *my_string = NULL;

#print an expression with (gdb) p *my_string

#evaluates and prints in this example $1 = 124 '|'

(gdb) n #steps over function calls to arrive at a function call on line 16 16	   read_string(my_string);
 * Next to step passed the set breakpoint / expression:


 * By printing a list of the programs code or examining the breakpoint you might think that the my_string char pointer has a bug:

#point the my_string pointer to the array of chars "buf" (gdb) set my_string=buf #the program is temporarily working

(gdb) c Continuing.
 * Continue with the programs execution:

#The programs input Type a command : hello world

#The programs output you entered : hello world


 * a bug from myprogram.c has been found to be fixed in emacs editor.

1.2.12 WSU local Subversion Repository svn checkout URL myfolder #creates an initial connection to your subversion repository, #that will prompt the user for a username and password svn list --verbose. #lists the user that submitted a revision & date/time along with the files within the repository. svn list URL #Within the local current directory established for svn svn mkdir myversion1 svn URL #output A        myversion1 svn import myfolder/myversion1 URL #then a prompt Log message unchanged or not specified (a)bort, (c)ontinue, (e)dit: c  Adding         myversion1/layeroptionsdlg.cxx Adding        myversion1/gluectrl.cxx Adding        myversion1/printdlg.cxx ...           ...  Adding         myversion1/vectdlg.src svn commit #The same log screen file as before and then (c)continue, Log message unchanged or not specified (a)bort, (c)ontinue, (e)dit: c
 * WSU group has been allocated access to a Subversion server for the files of the new Writer Wizard pertaining to us.
 * After a Subversion is set up, along with a new unique project the contributers are issued usernames and passwords before anything else.
 * A fundamental svn calls have been worked so far, for example:
 * Followed by (Run this command from within the initial checkout's setup directory):
 * To list all files from within your repository from any current directory run:
 * Create a local directory for project source files to be push onto the Subversion repository:
 * To push the most recent version of your project to Subversion you need to run:
 * The terminal might show the user a new screen for the Subversion log (CTRL ^X to exit),
 * Subversion will add the files to the repository:
 * Commit the project directory update to the repository:

#The lastest project version will be added Adding        myversion1 Committed revision 1.

svn list URL #output myversion1/
 * View all revisions in the repository:

#make sure the receiving folder is empty svn checkout URL myfolder/mycheckoutfolder
 * To restore to a version of a project run the svn checkout command again:

#Make sure it worked cd myfolder/mycheckoutfolder ls -l
 * These is just the are testing trials of the WSU Subversion repository.

1.2.13 rebuilding "sw" libs including symbols source LinuxX86Env.Set.sh #check if all is ok  set | grep OOo4Kids #output OOo4Kids=YES
 * Exactly as in section 1.2.8 symbols are helpful debugging tools
 * OOo4kids libs need to be built again
 * the libs themselves are binargy files used at runtime by OOo4kids
 * build the environment again:

cd sw mv unxlngi6.pro unxlngi6.pro_back build debug=t cd unxlngi6.pro/lib libmswordli.so   libswdli.so    libswli.so    libswuili.so  cd instsetoo_native export PKGFORMAT=installed build cd my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/basis1.0/program mv libsddli.so libsddli.so_back mv libsdfiltli.so libsdfiltli.so_back mv libsdli.so libsdli.so_back mv libsduili.so libsduili.so_back cp ../../../../../../../../../sw/unxlngi6.pro/lib/*. sudo cp ../../../../../../../../../sw/unxlngi6.pro/lib/*. cd my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/program ./soffice
 * make a back up of these files incase they need to be restored:
 * next run (approximately 10 minutes to run):
 * OOo4kids can be installed with symbols for sw lib:
 * Now install the effected source code with symbols:
 * Make a back up of *.so files for the following:
 * Run OOo4Kids with symbols that can be used by gdb to debug the New Writer Wizard:

1.2.14 gdb intro with soffice cd /my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/program ./soffice #displays the process_ids for soffice ps ax | grep soffice | grep -v grep #output 3062 pts/0   S+     0:00 /bin/sh ./soffice 3069 pts/0   Sl+    0:00 ../my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/program/soffice.bin gdb -q #gives the prompt (gdb) (gdb) attach 3069 #pauses soffice from continuing normal execution #wait for the gdb prompt (gdb) c  #will resume soffice into its normal execution (gdb) detach
 * OOo4kids basics for using gdb to stop the execution soffice with symbols and debugging tools are accomplished from the instsetoo_native/... directory:
 * From the current directory run ooo4kids with symbols:
 * Then find the desired process id:
 * Next start gdb in quiet mode:
 * Finally attach the process id for soffice.bin:
 * see section 1.2.11 for basic gdb commands
 * soffice has been given back control from gdb when it resumes but its process id is still needs to be unattached form gdb (run):

1.2.14 WSU local Subversion Repository update svn mkdir myversion1 svn URL #you might not need this command to get started. svn import mysourcecode URL #mysourcecode directory may contain multiple sub directories with source code content. #Outputs: Adding        mysourcecode/mysubfolder1 Adding        mysourcecode/mysubfolder1/backingwindow-OOo4Kids.cxx ...           ...
 * Subversion in our initial tests form section 1.2.12, would not import a directory with its content, not commit the latest revisions, checkout all revisions (meaning not the latest revision), and not list all revisions that were in the project.
 * WSU deleted all revisions from the Subversion project and started over.
 * To use the following svn command will create a repository on your local hard drive subversion making things difficult:
 * Push to the Subversion repository again:

Adding        mysourcecode/mysubfolder2 Adding        mysourcecode/mysubfolder2/dlgass.cxx ...           ...  Committed revision 8. svn checkout URL getmysourcecode #getmysourcecode folder did not need to exist before the svn checkout call.
 * Subversion can share the revision with all group members:
 * 'getmysourcecode' is the name of the folder that will be automatically generate within the local hard drives svn folder, to receive the mysourcecode files.

touch mytestfile.c #add some unique content svn add mytestfile.c #output A      mytestfile.c  ### svn commit #output Adding        mytestfile.c  Transmitting file data. Committed revision 9.
 * Project members already have these files locally, and unless an individual file was been updated it does not need to be imported to the Subversion server.
 * Project members only need to share and restore source code files that were debugged.
 * Create a new file with:
 * Push only that 'c' program to Subversion:

svn update #output A   mytestfile.c  Updated to revision 10. #prompt Conflict discovered in 'mytestfile.c'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: # (p) stops the update # (e) opens the conflicted file in the svn default editor. # (mc) chooses the local file update # (tc) chooses subversions file update # (df) displays the differences between the files
 * Different project members may now update from the previous checkout:
 * Project members may get updates and add program resources with the changes that they make.
 * svn update may run into a conflict with different project members programming different versions of files:

svn delete mytestfile.c #output D        mytestfile.c  ### svn commit #output Deleting      mytestfile.c  Committed revision 11.
 * Subversion delete command allows project members to remove repository files:

1.2.15 WSU group was instructed on the basics of setting a conditional breakpoint for OOo4Kids in gdb classroom 2

WSU group was also instructed to check Subversions servers status information in Subversion svn info basic

1.2.16 WSU group has explored basic applications of Subversion svu update with supporting documentation

1.2.17 Applying a patch to an OOo4Kids feature

The following instructions can be used to modifiy the feature within a ooo4Kids writer - 'untitled' document, that attempts to insert > special characters from a dialog box. Observe that writer > insert > special characters dialog box, colors of the focused characters and position of the help button. cd ~/my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/program$ ./soffice

Find the location of the patch within the my_OOo4Kids directory cd my_OOo4Kids/

ls -l | grep -E "svx_insert_no_close_22_sept.diff" svx_insert_no_close_22_sept.diff
 * 1) output

From the current location, apply the patch my_OOo4Kids$ patch -p0 < svx_insert_no_close_22*.diff

patching file svx/source/cui/charmap.src patching file svx/source/cui/cuicharmap.hxx patching file svx/source/cui/cuicharmap.cxx patching file svx/source/cui/charmap.hrc
 * 1) output

Prepare to build the patch supporting libs again source LinuxX86Env.Set.sh

Build the supporting libs cd ~/my_OOo4Kids/svx/source/cui

touch charmap.src && build

Next find the .so and .res supporting files that need to be copied to the second installation of OOo4Kids cd ~/my_OOo4Kids/svx/unxlngi6.pro/lib ls -l

libcuili.so libsvxcoreli.so  libsvxli.so  libsvxmsfilterli.so  libtextconversiondlgsli.so
 * 1) output

cd ~/my_OOo4Kids/svx/unxlngi6.pro/bin ls -l | grep -E "svxen-US.res"

svxen-US.res
 * 1) output

Copy the .so and the .res files to the required directory cd ~/my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/basis1.0/program$
 * 1) goto /program directory

sudo cp /home/mattd/my_OOo4Kids/svx/unxlngi6.pro/lib/libcuili.so.
 * 1) copy libcuili.so/ to the current directory

ls -lh | grep -E "libcuili.so" libcuili.so
 * 1) output

cd ~/my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/basis1.0/program/resource
 * 1) goto /program/resource directory

sudo cp /home/mattd/my_OOo4Kids/svx/unxlngi6.pro/bin/svxen-US.res.
 * 1) copy svxen-US.res/ to the current directory

ls -l | grep -E "svxen-US.res" svxen-US.res
 * 1) output

Again observe that writer > insert > special characters dialog box, colors of the focused characters and position of the help button. has been changed. cd ~/my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/en-US/ooo4kids1.0/program$ ./soffice

1.2.18 Downloading/Using Doxygen with graphviz

Download doxygen at [www.doxygen.org]

Decompress the package tar -zxvf doxygen-1.7.2.linux.bin.tar.gz

Follow these installation instructions cd doxygen-1.7.2

./configure

sudo make

sudo make install

Next download graphviz sudo dpkg -i graphviz_2.16-3ubuntu2_i386.deb

cd into the project directory to be documented/charted, then Create a configuration file doxygen -g doxygen_configure

Open the configuration file view doxygen_configure

With in the configuration file set the following variables PROJECT_NAME          ="folername" OUTPUT_DIRECTORY      = "thisfolder" WARN_IF_DOC_ERROR     = NO

HAVE_DOT              = YES CALLER_GRAPH          = YES
 * 1) These could change depending on the type of documentation needed.

Run doxygen with the configuration file doxygen doxygen_configure

Terminal should display Generating graphical class hierarchy... Generating namespace index... Generating namespace member index... Generating graph info page... Generating file index... Generating example index... Generating file member index... finalizing index lists... Generating dot graphs using 2 parallel threads... Running dot for graph 1/49 .... Running dot for graph 49/49 Inserting map/figure 1/25 .... Inserting map/figure 25/25 finished...

Open the project directory with a web browser to FILE ~projectname/folername/thisfolder/html/* to view the documentation/diagrams of the c++ project folder.

1.2.19 doxygen usage for c++ documenation diagrams from doxygen & graphviz, to OOo4Kids directory svx