Re: [Dspace-tech] Correct procedure to cutomize dspace xmlui from [dspace-source] folder
Thanks again Helix84, i've created a new theme and rebuild everything and it worked! - create new theme (copied Mirage and changed name) cd /home/dspace/dspace-1.8.2-src-release/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes cp -r Mirage MyTheme cd MyTheme modified the following on sitemap.xmap: MyTheme MyTheme mv Mirage.xsl MyTheme.xsl vim ./lib/xsl/core/page-structure.xsl (e.g. changed logo) vim /home/dspace/dspace-1.8.2-src-release/dspace/config/xmlui.xconf : and commented out the old theme and added: cd /home/dspace/dspace-1.8.2-src-release/ mvn package cd dspace/target/dspace-1.8.2-build/ ant update cd /usr/local/dspace ../tomcat/bin/shutdown.sh cp -r webapps/* ../tomcat/webapps/ ../tomcat/bin/startup.sh and the chages are effective, i suppose that when developing the changes will be made directly on the webapp running and applied back to the source afterwords. Cheers, alex On 6 December 2012 12:17, helix84 wrote: > On Thu, Dec 6, 2012 at 6:02 PM, Alexander Kocisky > wrote: > > in particular i've seen that the modules are available in the > > [dspace-source] path but also under [dspace-source]/dspace/modules, what > is > > the relation between these to versions? > > In my email I mentioned overlays. That's what the modules directory > contains. It duplicates the module structure and anything that the > overlay directory ([dspace-source]/dspace/modules/[module]) contains > will replace what the stock module ([dspace-source]/[module]) > contains. > > That's why this is a good place to keep local Java modifications. I > haven't tried putting a customized theme there, a different procedure > is recommended for theme customization, with the goal of reducing > headaches when upgrading: > > https://wiki.duraspace.org/display/DSPACE/Manakin+theme+tutorial > > Just create a new theme (i.e a new directory) in the themes directory. > Inside your theme import the contents of Mirage and overlay any > templates you want. The rest of the templates will thus fall back to > Mirage. > > > > > i though that packaging the source will update also the modules in > > [dspace-source]/dspace/modules, so this is what i've done: > > > > [root@repository dspace-xmlui]# pwd > > /home/dspace/dspace-1.8.2-src-release/dspace-xmlui > > > > vim > > > ./dspace-xmlui-webapp/src/main/webapp/themes/Mirage/lib/xsl/core/page-structure.xsl > > changed: mirage to > id="ds-header-logo-text"> > > mvn package > > No, it doesn't work like that in Java (Maven). You can't expect to > build an individual module. You have to build from [dspace-source], > not from a module directory. I know it takes forever, I also have a > problem with that. > > You have only 2 options, full build and quick build, and they should > be used exactly as described in the Building DSpace link I sent you. > In case quick build behaves strangely, you know you have to use full build. > > > > dspace/modules/xmlui/target/xmlui-1.8.2/themes/Mirage/lib/xsl/core/page-structure.xsl > > > > so i've modified that file but after the "mvn package" it's restored from > > the original, and it's not coming from: > > Ignore the target directory, just like you ignore .o files when you're > compiling C code. It's only a temporary location for compiled code. > This is the grep command I generally use: > > grep -RnI --exclude-dir=.git --exclude-dir=target 'foo' * > > > Regards, > ~~helix84 > > Compulsory reading: DSpace Mailing List Etiquette > https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette > -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
Re: [Dspace-tech] Correct procedure to cutomize dspace xmlui from [dspace-source] folder
Hi Helix, thank you for your quick reply and also the links, the procedure in the wiki is a bit generic and i don't have a full understanding of maven apps!! So i've made many tries but i still don't understand the correct procedure, in particular i've seen that the modules are available in the [dspace-source] path but also under [dspace-source]/dspace/modules, what is the relation between these to versions? i though that packaging the source will update also the modules in [dspace-source]/dspace/modules, so this is what i've done: [root@repository dspace-xmlui]# pwd /home/dspace/dspace-1.8.2-src-release/dspace-xmlui vim ./dspace-xmlui-webapp/src/main/webapp/themes/Mirage/lib/xsl/core/page-structure.xsl changed: mirage to mvn package cd ../dspace mvn package cd ./target/dspace-1.8.2-build/ ant update cd /usr/local/dspace ../tomcat/bin/shutdown.sh cp -r webapps/* ../tomcat/webapps/ ../tomcat/bin/startup.sh i've tracked where the changes were made with: fgrep -R 'mirage' * [root@repository dspace-1.8.2-src-release]# fgrep -R 'mirage' * dspace/target/dspace-1.8.2-build/webapps/xmlui/themes/Mirage/lib/xsl/core/page-structure.xsl: mirage dspace/modules/xmlui/target/xmlui-1.8.2/themes/Mirage/lib/xsl/core/page-structure.xsl: mirage dspace/modules/xmlui/target/war/work/org.dspace/dspace-xmlui-webapp/themes/Mirage/lib/xsl/core/page-structure.xsl: mirage [root@repository dspace-1.8.2-src-release]# it still has the "mirage" text and from the grep it seems that its coming from: dspace/modules/xmlui/target/xmlui-1.8.2/themes/Mirage/lib/xsl/core/page-structure.xsl so i've modified that file but after the "mvn package" it's restored from the original, and it's not coming from: /home/dspace/dspace-1.8.2-src-release/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/Mirage/lib/xsl/core/page-structure.xsl what am i missing? many thanks!! alex On 5 December 2012 11:39, helix84 wrote: > Hi Alexander, > > it appears you're not running ant from the correct directory. > > This article explains how to rebuild DSpace: > > https://wiki.duraspace.org/display/DSPACE/Rebuild+DSpace > > However, if you want to modify only the theme, you can modify it > directly in [dspace]/webapps/xmlui/themes and see changes to it > instantly (sometimes you may need to clear the Cocoon cache, see the > FAQ). Remember that the webapps directory will be moved to > webapps-[date] when you redeploy DSpace, so you may want to copy the > theme back to [dspace-source] when you're done. > > If you want to make loca modifications to Java code, read about > overlays - it's the best way to do it, cut down on build time and make > porting easier during upgrades: > https://www.ideals.illinois.edu/handle/2142/11915 > > > Regards, > ~~helix84 > > Compulsory reading: DSpace Mailing List Etiquette > https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette > -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
[Dspace-tech] Correct procedure to cutomize dspace xmlui from [dspace-source] folder
Hi all, i was trying to figure out how to customize the dspace-xmlui web app (for the logo and other small details) from the [dspace-source], build it and package it for a correct deployment to the [dspace] installation directory. i've tried to: cd [dspace-source]/dspace-xmlui [modify the code] mvn package cd [dspace-source]/dspace-xmlui/target/dspace-xmlui-webapp-1.8.2 cp -rf * /usr/local/dspace/webapps/xmlui/ cp -r webapps/* ../tomcat/webapps/ ../tomcat/bin/startup.sh but i got this exception: log4j:WARN No appenders could be found for logger (org.dspace.servicemanager.DSpaceKernelInit). log4j:WARN Please initialize the log4j system properly. INFO: Loading provided config file: ${dspace.dir}/config/dspace.cfg FATAL: Can't load configuration: file:/usr/local/dspace-1.8.2/$%7Bdspace.dir%7D/config/dspace.cfg java.io.FileNotFoundException: /usr/local/dspace-1.8.2/${dspace.dir}/config/dspace.cfg (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:137) at java.io.FileInputStream.(FileInputStream.java:96) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:87) so i've tried to: [root@repository xmlui]# pwd /home/dspace/dspace-1.8.2-src-release/dspace/modules/xmlui [root@repository xmlui]# vim ./target/xmlui-1.8.2/themes/Mirage/lib/css/style.css [modify the code] ant update_code <- Update compiled code (bin, lib, and etc directories) ant update_webapps <- Update web applications but no code in the xmlui was updated in the [dspace] installation directory nor in [dspace-source]/target folder just to try i've modified directly: [root@repository tomcat]# vim ./webapps/xmlui/themes/Mirage/lib/xsl/core/page-structure.xsl [root@repository tomcat]# vim ../tomcat/webapps/xmlui/themes/Mirage/lib/css/style.css but obviously the changes get rewritten with fresh deployments. What is the correct procedure that enables me to update the code of the dspace-xmlui (or other modules) in order to deploy them to the [dspace] directory? Thanks !!! Alex -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette