\n AuthUserFile /path/to/.htpasswd\n AuthName \"geschuetzter Bereich\"\n AuthType Basic\n require valid-user\n\u003C/Location>\n\n",[75,2468,2469,2474,2479,2484,2489,2494],{"__ignoreMap":11},[106,2470,2471],{"class":108,"line":109},[106,2472,2473],{},"\u003CLocation />\n",[106,2475,2476],{"class":108,"line":12},[106,2477,2478],{}," AuthUserFile /path/to/.htpasswd\n",[106,2480,2481],{"class":108,"line":120},[106,2482,2483],{}," AuthName \"geschuetzter Bereich\"\n",[106,2485,2486],{"class":108,"line":126},[106,2487,2488],{}," AuthType Basic\n",[106,2490,2491],{"class":108,"line":132},[106,2492,2493],{}," require valid-user\n",[106,2495,2496],{"class":108,"line":138},[106,2497,2498],{},"\u003C/Location>\n",[41,2500,2501,2502,2507],{},"/ means that any access to your server is restricted. Today I’ve been looking for a way to restrict all resources on the\nserver but one. It’s not that easy using standard regular expression but as Apache\nuses ",[45,2503,2506],{"href":2504,"rel":2505},"http://www.pcre.org/",[49],"Perl compatible regular expressions"," you can use lookahead assertions to negate an\nexpressions:",[68,2509,2511],{"className":1817,"code":2510,"language":1819,"meta":11,"style":11},"\u003CLocation ~ \"^/(?!path/that/doesnt/need/auth)\">\n AuthUserFile /path/to/.htpasswd\n AuthName \"geschuetzter Bereich\"\n AuthType Basic\n require valid-user\n\u003C/Location>\n",[75,2512,2513,2518,2523,2528,2533,2538],{"__ignoreMap":11},[106,2514,2515],{"class":108,"line":109},[106,2516,2517],{},"\u003CLocation ~ \"^/(?!path/that/doesnt/need/auth)\">\n",[106,2519,2520],{"class":108,"line":12},[106,2521,2522],{}," AuthUserFile /path/to/.htpasswd\n",[106,2524,2525],{"class":108,"line":120},[106,2526,2527],{}," AuthName \"geschuetzter Bereich\"\n",[106,2529,2530],{"class":108,"line":126},[106,2531,2532],{}," AuthType Basic\n",[106,2534,2535],{"class":108,"line":132},[106,2536,2537],{}," require valid-user\n",[106,2539,2540],{"class":108,"line":138},[106,2541,2498],{},[41,2543,2544],{},"With ~ you are telling Apache that you are using an extended regular expression. ^ is the beginning of the line, ?!\ninitializes a negated lookahead assertion. Any path that is not in the String given above will require authentication.",[41,2546,2547],{},"Big thank you to our administrators who’ve been kind enough to share a lot of their wisdom with me.",[421,2549,423],{},{"title":11,"searchDepth":12,"depth":12,"links":2551},[],[2553],"administrator-blog","2010-11-10T20:41:53","https://synyx.de/blog/negating-matches-in-apache-location/",{},"/blog/negating-matches-in-apache-location",{"title":2440,"description":2449},"negating-matches-in-apache-location","blog/negating-matches-in-apache-location",[2562],"apache","It took me some time to figure it out so why not sharing it with the world? Apache allows you to add basic auth to parts of your site using…","SY_tZ8i6xf7etcZBs9jW1JoRvctIkAFZQnJ2P494kCs",{"id":2566,"title":2567,"author":2568,"body":2569,"category":2733,"date":2734,"description":2735,"extension":16,"link":2736,"meta":2737,"navigation":23,"path":2738,"seo":2739,"slug":2573,"stem":2741,"tags":2742,"teaser":2744,"__hash__":2745},"blog/blog/using-cmsshell-on-ubuntu-systems.md","Using CmsShell on Ubuntu systems",[26],{"type":8,"value":2570,"toc":2731},[2571,2574,2583,2586,2592,2599,2613,2616,2621,2624,2629,2635,2709,2712,2718,2721,2726,2729],[37,2572,2567],{"id":2573},"using-cmsshell-on-ubuntu-systems",[41,2575,2576,2577,2580,2581,63],{},"CmsShell is a neat tool to access the ",[45,2578,695],{"href":2235,"rel":2579},[49]," VFS from the command line. This can be extremely\nuseful when your system can’t be accessed anymore using the web interface or when performing batch updates. The script\ncan be found in the OpenCms webapp at ",[75,2582,890],{},[41,2584,2585],{},"Unfortunately the script that ships with the OpenCms webapp doesn’t work on Ubuntu systems as it is. These are the steps\nto make it run.",[41,2587,2588,2589],{},"First be sure that it’s executable: ",[75,2590,2591],{},"chmod +x cmsshell.sh",[41,2593,2594,2595,2598],{},"When trying to run it using ",[75,2596,2597],{},"./cmsshell.sh"," you will very likely see an error:",[68,2600,2602],{"className":1817,"code":2601,"language":1819,"meta":11,"style":11},"\nbash: ./cmsshell.sh: /bin/sh^M: bad interpreter: No such file or directory\n\n",[75,2603,2604,2608],{"__ignoreMap":11},[106,2605,2606],{"class":108,"line":109},[106,2607,908],{"emptyLinePlaceholder":23},[106,2609,2610],{"class":108,"line":12},[106,2611,2612],{},"bash: ./cmsshell.sh: /bin/sh^M: bad interpreter: No such file or directory\n",[41,2614,2615],{},"This is caused by dos line breaks that are included in the file. A tool to remove those can be found in the package\ntofrodos (used to be in sysutils):",[41,2617,2618],{},[75,2619,2620],{},"sudo apt-get install tofrodos",[41,2622,2623],{},"Run it on the file by issuing",[41,2625,2626],{},[75,2627,2628],{},"dos2unix cmsshell.sh",[41,2630,2631,2632,2634],{},"Try to run the file again: ",[75,2633,2597],{},", which will result in another error:",[68,2636,2638],{"className":1817,"code":2637,"language":1819,"meta":11,"style":11},"\n/cmsshell.sh: 8: pushd: not found\n./cmsshell.sh: 9: dirs: not found\n./cmsshell.sh: 10: popd: not found\nException in thread \"main\" java.lang.NoClassDefFoundError: org/opencms/main/CmsShell\nCaused by: java.lang.ClassNotFoundException: org.opencms.main.CmsShell\n at java.net.URLClassLoader$1.run(URLClassLoader.java:200)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(URLClassLoader.java:188)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:307)\n at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:252)\n at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)\nCould not find the main class: org.opencms.main.CmsShell. Program will exit.\n\n",[75,2639,2640,2644,2649,2654,2659,2664,2669,2674,2679,2684,2689,2694,2699,2704],{"__ignoreMap":11},[106,2641,2642],{"class":108,"line":109},[106,2643,908],{"emptyLinePlaceholder":23},[106,2645,2646],{"class":108,"line":12},[106,2647,2648],{},"/cmsshell.sh: 8: pushd: not found\n",[106,2650,2651],{"class":108,"line":120},[106,2652,2653],{},"./cmsshell.sh: 9: dirs: not found\n",[106,2655,2656],{"class":108,"line":126},[106,2657,2658],{},"./cmsshell.sh: 10: popd: not found\n",[106,2660,2661],{"class":108,"line":132},[106,2662,2663],{},"Exception in thread \"main\" java.lang.NoClassDefFoundError: org/opencms/main/CmsShell\n",[106,2665,2666],{"class":108,"line":138},[106,2667,2668],{},"Caused by: java.lang.ClassNotFoundException: org.opencms.main.CmsShell\n",[106,2670,2671],{"class":108,"line":184},[106,2672,2673],{}," at java.net.URLClassLoader$1.run(URLClassLoader.java:200)\n",[106,2675,2676],{"class":108,"line":190},[106,2677,2678],{}," at java.security.AccessController.doPrivileged(Native Method)\n",[106,2680,2681],{"class":108,"line":196},[106,2682,2683],{}," at java.net.URLClassLoader.findClass(URLClassLoader.java:188)\n",[106,2685,2686],{"class":108,"line":202},[106,2687,2688],{}," at java.lang.ClassLoader.loadClass(ClassLoader.java:307)\n",[106,2690,2691],{"class":108,"line":208},[106,2692,2693],{}," at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)\n",[106,2695,2696],{"class":108,"line":214},[106,2697,2698],{}," at java.lang.ClassLoader.loadClass(ClassLoader.java:252)\n",[106,2700,2701],{"class":108,"line":220},[106,2702,2703],{}," at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)\n",[106,2705,2706],{"class":108,"line":226},[106,2707,2708],{},"Could not find the main class: org.opencms.main.CmsShell. Program will exit.\n",[41,2710,2711],{},"To make it work you need to open the script and change the line",[41,2713,2714,2717],{},[75,2715,2716],{},"OPENCMS_BASE=","dirs +0``",[41,2719,2720],{},"to",[41,2722,2723,2725],{},[75,2724,2716],{},"pwd``",[41,2727,2728],{},"When saving the change and executing the script you should see OpenCms start and end at the prompt where you can login\nand execute any useful action you can think of.",[421,2730,423],{},{"title":11,"searchDepth":12,"depth":12,"links":2732},[],[2553,510],"2010-11-03T17:13:14","CmsShell is a neat tool to access the OpenCms VFS from the command line. This can be extremely\\nuseful when your system can’t be accessed anymore using the web interface or when performing batch updates. The script\\ncan be found in the OpenCms webapp at WEB-INF/cmsshell.sh.","https://synyx.de/blog/using-cmsshell-on-ubuntu-systems/",{},"/blog/using-cmsshell-on-ubuntu-systems",{"title":2567,"description":2740},"CmsShell is a neat tool to access the OpenCms VFS from the command line. This can be extremely\nuseful when your system can’t be accessed anymore using the web interface or when performing batch updates. The script\ncan be found in the OpenCms webapp at WEB-INF/cmsshell.sh.","blog/using-cmsshell-on-ubuntu-systems",[2743,521],"linux","CmsShell is a neat tool to access the OpenCms VFS from the command line. This can be extremely useful when your system can’t be accessed anymore using the web interface…","D3PyhEOAgZTPGgEbOBhZLYK4-r5C8IWO88rDvPj_q-k",{"id":2747,"title":2748,"author":2749,"body":2750,"category":2788,"date":2789,"description":2790,"extension":16,"link":2791,"meta":2792,"navigation":23,"path":2793,"seo":2794,"slug":2754,"stem":2795,"tags":2796,"teaser":2797,"__hash__":2798},"blog/blog/context-reload-with-tomcat.md","Context reload with Tomcat",[26],{"type":8,"value":2751,"toc":2786},[2752,2755,2764,2767,2772,2775,2778],[37,2753,2748],{"id":2754},"context-reload-with-tomcat",[41,2756,2757,2758,2763],{},"Ever wondered why ",[45,2759,2762],{"href":2760,"rel":2761},"http://tomcat.apache.org/",[49],"Tomcat"," reloads the context when editing web.xml?",[41,2765,2766],{},"This is a default configuration that can also be adjusted to your needs. The file conf/context.xml is the default\ncontext configuration that is used for all webapps. In this file you can find the line",[41,2768,2769],{},[75,2770,2771],{},"\u003CWatchedResource>WEB-INF/web.xml\u003C/WatchedResource>",[41,2773,2774],{},"which triggers the reload for any web.xml.",[41,2776,2777],{},"You can either add more resources here or, preferably, add your own context configuration with your resources.",[41,2779,2780,2781,63],{},"Find out more about context configuration in\nthe ",[45,2782,2785],{"href":2783,"rel":2784},"http://tomcat.apache.org/tomcat-6.0-doc/config/context.html",[49],"Tomcat documentation",{"title":11,"searchDepth":12,"depth":12,"links":2787},[],[427,510],"2010-10-13T16:08:56","Ever wondered why Tomcat reloads the context when editing web.xml?","https://synyx.de/blog/context-reload-with-tomcat/",{},"/blog/context-reload-with-tomcat",{"title":2748,"description":2790},"blog/context-reload-with-tomcat",[441],"Ever wondered why Tomcat reloads the context when editing web.xml? This is a default configuration that can also be adjusted to your needs. The file conf/context.xml is the default context…","rqgNbT2dAL4FFc59uZqZxj2Vd1hSH_5x_lWFp8y9NCs",{"id":2800,"title":2801,"author":2802,"body":2803,"category":2879,"date":2880,"description":2881,"extension":16,"link":2882,"meta":2883,"navigation":23,"path":2884,"seo":2885,"slug":2807,"stem":2886,"tags":2887,"teaser":2888,"__hash__":2889},"blog/blog/console-logging-with-opencms.md","Console logging with OpenCms",[26],{"type":8,"value":2804,"toc":2877},[2805,2808,2814,2817,2843,2845,2872,2875],[37,2806,2801],{"id":2807},"console-logging-with-opencms",[41,2809,2810],{},[2811,2812,2813],"em",{},"We are currently in the process of cleaning up our internal wiki. A lot of information is quite outdated but it also\ncontains some useful snippets that we would like to share with the rest of the world.",[41,2815,2816],{},"The log4j ConsoleAppender is already configured in OpenCms log4j.properties but not enabled by default. To enable it\nchange the configuration",[68,2818,2822],{"className":2819,"code":2820,"language":2821,"meta":11,"style":11},"language-plain shiki shiki-themes github-light github-dark","\nlog4j.rootLogger=\\\n ERROR,\\\n OC\n\n","plain",[75,2823,2824,2828,2833,2838],{"__ignoreMap":11},[106,2825,2826],{"class":108,"line":109},[106,2827,908],{"emptyLinePlaceholder":23},[106,2829,2830],{"class":108,"line":12},[106,2831,2832],{},"log4j.rootLogger=\\\n",[106,2834,2835],{"class":108,"line":120},[106,2836,2837],{}," ERROR,\\\n",[106,2839,2840],{"class":108,"line":126},[106,2841,2842],{}," OC\n",[41,2844,2720],{},[68,2846,2848],{"className":2819,"code":2847,"language":2821,"meta":11,"style":11},"\nlog4j.rootLogger=\\\n ERROR,\\\n OC,\\\n CONSOLE\n\n",[75,2849,2850,2854,2858,2862,2867],{"__ignoreMap":11},[106,2851,2852],{"class":108,"line":109},[106,2853,908],{"emptyLinePlaceholder":23},[106,2855,2856],{"class":108,"line":12},[106,2857,2832],{},[106,2859,2860],{"class":108,"line":120},[106,2861,2837],{},[106,2863,2864],{"class":108,"line":126},[106,2865,2866],{}," OC,\\\n",[106,2868,2869],{"class":108,"line":132},[106,2870,2871],{}," CONSOLE\n",[41,2873,2874],{},"This is useful when starting OpenCms from within an IDE like Netbeans or Eclipse which display the Console window by\ndefault.",[421,2876,423],{},{"title":11,"searchDepth":12,"depth":12,"links":2878},[],[427,510],"2010-10-12T18:44:46","We are currently in the process of cleaning up our internal wiki. A lot of information is quite outdated but it also\\ncontains some useful snippets that we would like to share with the rest of the world.","https://synyx.de/blog/console-logging-with-opencms/",{},"/blog/console-logging-with-opencms",{"title":2801,"description":2813},"blog/console-logging-with-opencms",[521],"We are currently in the process of cleaning up our internal wiki. A lot of information is quite outdated but it also contains some useful snippets that we would like…","YLxxqXYBKnGrglUy2I9bdVGutI6JPiBeaHv7xk9P0FM",{"id":2891,"title":2892,"author":2893,"body":2894,"category":2997,"date":2998,"description":2999,"extension":16,"link":3000,"meta":3001,"navigation":23,"path":3002,"seo":3003,"slug":2898,"stem":3005,"tags":3006,"teaser":3011,"__hash__":3012},"blog/blog/froscon-2010.md","FrOSCon 2010",[26],{"type":8,"value":2895,"toc":2995},[2896,2899,2908,2911,2926,2945,2954,2969,2983,2986],[37,2897,2892],{"id":2898},"froscon-2010",[41,2900,2901,2902,2907],{},"Am 21. und 22.08. fand für mich die 2. ",[45,2903,2906],{"href":2904,"rel":2905},"http://froscon.de/",[49],"Free and Open Source Software Conference FrOSCon"," in St.\nAugustin bei Bonn statt. Der Hauptgrund für meinen Besuch im letzten Jahr war ein ausgedehnter Java-Track, ich war\njedoch von der Atmosphäre und der Vielfalt der Themen so begeistert, dass die Konferenz für mich sicher ein regelmäßiges\nEreignis sein wird.",[41,2909,2910],{},"Die Gelegenheit soll natürlich genutzt werden, um ein paar interessante Vorträge aus diesem Jahr vorzustellen, um dem\nein oder anderen vielleicht auch Lust auf einen Besuch zu machen.",[41,2912,2913,2914,2919,2920,2925],{},"Ein recht verbreitetes Thema, das unter anderem gerne im leider\neingestellten ",[45,2915,2918],{"href":2916,"rel":2917},"http://blog.stackoverflow.com/category/podcasts/",[49],"Stackoverflow-Podcast"," oder auch in diversen Büchern\nangesprochen wird, ist der Nutzen für die eigene Karriere, den man sich durch ein offenes Arbeiten in einer Community\nerarbeiten kann. ",[45,2921,2924],{"href":2922,"rel":2923},"http://www.lornajane.net/",[49],"Lorna Jane Mitchell"," beschrieb in “Open Source Your Career” recht\nunterhaltsam von Ihren Anfängen in der PHP-Community und den ersten Auftritten auf Konferenzen. Eine Anreiz für mehr\nEngagement.",[41,2927,2928,2929,2932,2933,2938,2939,2944],{},"Obwohl ich mit den Grundlagen schon vertraut war, waren zwei Vorträge zu ",[45,2930,2380],{"href":2378,"rel":2931},[49]," interessant:\nEiner über MongoDB im generellen von einem Mitarbeiter von ",[45,2934,2937],{"href":2935,"rel":2936},"http://www.10gen.com/",[49],"10gen",", der Firma hinter der\nDatenbank, und einen zur Integration in Ruby on Rails von ",[45,2940,2943],{"href":2941,"rel":2942},"http://jan.krutisch.de/",[49],"Jan Krutisch",". Auch wenn die\nhorizontale Skalierung für mich momentan noch keine große Rolle spielen wird, kann ich mir vorstellen, dass der\ndokumentenorientierte Ansatz auch beim Einsatz auf einer Maschine Vorteile bringen kann. Ich plane das an einem\nkonkreten Problem einmal auszuprobieren, einfach nur um zu wissen, wie sich die Entwicklung anfühlt.",[41,2946,2947,2948,2953],{},"“Mobile Linux Development” von Christian Küster ging mit einem für mich neuen Blickwinkel auf\nein ",[45,2949,2952],{"href":2950,"rel":2951},"http://mobile.synyx.de",[49],"bekanntes Thema"," zu: Wie unterscheiden sich die unterschiedlichen Linux-basierten mobilen\nBetriebssysteme in Bezug auf die Zugriffsmöglichkeiten auf die Kernkomponenten, welche erlauben beispielsweise ein\nAustauschen des Kernels oder den Zugriff auf Systemkomponenten. Android schnitt bei diesen Aspekten relativ schlecht ab,\nMaemo scheint die meisten Freiheitsgrade zu bieten. Für die Entwicklung auf den Geräten spielt die dies meiner Meinung\njedoch eine recht geringe Rolle, solange höherwertige Funktionen angeboten werden, mit denen die benötigten\nFunktionalitäten abgedeckt werden können.",[41,2955,2956,2957,2962,2963,2968],{},"Der Vortrag, wegen dem ich mich eigentlich zum Besuch der FrOSCon entschlossen hatte, Ruby on Rails 3\nvon ",[45,2958,2961],{"href":2959,"rel":2960},"http://yehudakatz.com/",[49],"Yehuda Katz",", war leider nicht so technisch, wie ich ihn mir gewünscht hatte. Gerade da er\nvon einem Mann aus dem ",[45,2964,2967],{"href":2965,"rel":2966},"http://rubyonrails.org/merb",[49],"Merb-Team"," gehalten wurde, hätte ich mir einen Überblick über die\nUnterschiede zwischen den Versionen gewünscht. Merb war ehemals ein Konkurrenz-Framework und geht mit Version 3 in Ruby\non Rails auf. Auch wenn mir die technischen Konzepte gefehlt haben war der Einblick in die Arbeit des Rails-Teams dann\ndoch interessant.",[41,2970,2971,2972,2977,2978,2982],{},"Kurzfristig eingeschoben wurde ein Talk von ",[45,2973,2976],{"href":2974,"rel":2975},"http://kippdata.de/",[49],"Rainer Jung"," zu den Neuerungen\nin ",[45,2979,2981],{"href":2454,"rel":2980},[49],"Apache httpd"," 2.4. Besonders die Anforderungen an einen Webserver, die sich durch die\nstark steigende Anzahl an Connections durch die Verbreitung von AJAX-Anwendungen und das Offenhalten der Connections\ndurch Techniken wie WebSockets/Comet ergeben, waren spannend. Beeindruckend, dass Rainer Jung es nicht nur schafft, in\nzwei so wichtigen Projekten wie dem in C geschriebenen httpd und dem in Java geschriebenen Servlet-Container Tomcat\nCore-Committer zu sein, sondern auch beide Projekte gleichwertig vertreten kann, indem er Samstags ein Tomcat-Shirt\nund Sonntags ein Apache-Shirt trägt :).",[41,2984,2985],{},"Alles in allem war die FrOSCon auch in diesem Jahr wieder außerordentlich lohnend. Die lockere Atmosphäre ist mit keiner\nanderen Konferenz, die ich kenne, zu vergleichen, was sicher einerseits an dem Termin am Wochenende liegt und\nandererseits daran, dass die Konferenz weniger businesslastig ist, als die mir bekannten Java-Konferenzen. Trotzdem\nkann man jede Menge neuen Input für die tägliche Arbeit bekommen, ein Besuch lohnt sich also nicht nur wegen des extrem\nniedrigen Eintrittspreises von 5€.",[41,2987,2988,2989,2994],{},"Und noch ein praktischer Tipp am Rande: Wer kein Problem mit einem kleinen Fußmarsch hat, ist beim sehr freundlichen\nWirt im ",[45,2990,2993],{"href":2991,"rel":2992},"http://www.zum-laternchen.de/",[49],"Laternchen"," bestens aufgehoben.",{"title":11,"searchDepth":12,"depth":12,"links":2996},[],[510],"2010-08-24T06:16:08","Am 21. und 22.08. fand für mich die 2. Free and Open Source Software Conference FrOSCon in St.\\nAugustin bei Bonn statt. Der Hauptgrund für meinen Besuch im letzten Jahr war ein ausgedehnter Java-Track, ich war\\njedoch von der Atmosphäre und der Vielfalt der Themen so begeistert, dass die Konferenz für mich sicher ein regelmäßiges\\nEreignis sein wird.","https://synyx.de/blog/froscon-2010/",{},"/blog/froscon-2010",{"title":2892,"description":3004},"Am 21. und 22.08. fand für mich die 2. Free and Open Source Software Conference FrOSCon in St.\nAugustin bei Bonn statt. Der Hauptgrund für meinen Besuch im letzten Jahr war ein ausgedehnter Java-Track, ich war\njedoch von der Atmosphäre und der Vielfalt der Themen so begeistert, dass die Konferenz für mich sicher ein regelmäßiges\nEreignis sein wird.","blog/froscon-2010",[2562,3007,3008,3009,2434,520,3010],"froscon","konferenz","mobile","ruby-on-rails","Am 21. und 22.08. fand für mich die 2. Free and Open Source Software Conference FrOSCon in St. Augustin bei Bonn statt. Der Hauptgrund für meinen Besuch im letzten Jahr…","I5FF7sxuFa3dbVLJ3H-3GJIR6OfzFdL06uiY3HOqsj4",{"id":3014,"title":3015,"author":3016,"body":3017,"category":3105,"date":3106,"description":3107,"extension":16,"link":3108,"meta":3109,"navigation":23,"path":3110,"seo":3111,"slug":3021,"stem":3113,"tags":3114,"teaser":3117,"__hash__":3118},"blog/blog/creating-a-mysql-dump-for-jdbc.md","Creating a MySQL dump for JDBC",[26],{"type":8,"value":3018,"toc":3103},[3019,3022,3031,3040,3043,3052,3083,3088,3091,3100],[37,3020,3015],{"id":3021},"creating-a-mysql-dump-for-jdbc",[41,3023,3024,3025,3030],{},"I have just been fighting with\nthe ",[45,3026,3029],{"href":3027,"rel":3028},"https://web.archive.org/web/20150526005826/http://mojo.codehaus.org:80/sql-maven-plugin/",[49],"sql-maven-plugin"," while\ntrying to import an OpenCms MySQL dump automatically. The module wasn’t really verbose with an error message:",[41,3032,3033,3036,3037],{},[75,3034,3035],{},"[ERROR] Failed to execute: INSERT INTO ","CMS_CONTENTS",[75,3038,3039],{}," VALUES",[41,3041,3042],{},"followed by printing the rest of the dump to the standard output.",[41,3044,3045,3046,3051],{},"Fortunately my colleague ",[45,3047,3050],{"href":3048,"rel":3049},"http://blog.synyx.de/autoren/?uid=16",[49],"Marc"," pointed me to the right direction: The dump\ncontains some statements that can’t be executed by JDBC. To create a correct dump for usage with pure JDBC or with the\nsql-maven-plugin the following command has to be applied:",[68,3053,3055],{"className":899,"code":3054,"language":901,"meta":11,"style":11},"mysqldump --hex-blob -u root -p opencms752 > install/opencms752.sql\n\n",[75,3056,3057],{"__ignoreMap":11},[106,3058,3059,3062,3065,3068,3071,3074,3077,3080],{"class":108,"line":109},[106,3060,3061],{"class":1243},"mysqldump",[106,3063,3064],{"class":955}," --hex-blob",[106,3066,3067],{"class":955}," -u",[106,3069,3070],{"class":951}," root",[106,3072,3073],{"class":955}," -p",[106,3075,3076],{"class":951}," opencms752",[106,3078,3079],{"class":947}," >",[106,3081,3082],{"class":951}," install/opencms752.sql\n",[41,3084,3085],{},[710,3086,3087],{},"Edit:",[41,3089,3090],{},"To prevent that some characters are encoded incorrectly, add the following to the configuration options:",[68,3092,3094],{"className":100,"code":3093,"language":102,"meta":11,"style":11},"\u003CescapeProcessing>false\u003C/escapeProcessing>\n",[75,3095,3096],{"__ignoreMap":11},[106,3097,3098],{"class":108,"line":109},[106,3099,3093],{},[421,3101,3102],{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":11,"searchDepth":12,"depth":12,"links":3104},[],[427],"2010-07-09T16:38:56","I have just been fighting with\\nthe sql-maven-plugin while\\ntrying to import an OpenCms MySQL dump automatically. The module wasn’t really verbose with an error message:","https://synyx.de/blog/creating-a-mysql-dump-for-jdbc/",{},"/blog/creating-a-mysql-dump-for-jdbc",{"title":3015,"description":3112},"I have just been fighting with\nthe sql-maven-plugin while\ntrying to import an OpenCms MySQL dump automatically. The module wasn’t really verbose with an error message:","blog/creating-a-mysql-dump-for-jdbc",[3115,439,3116,521],"jdbc","mysql","I have just been fighting with the sql-maven-plugin while trying to import an OpenCms MySQL dump automatically. The module wasn’t really verbose with an error message: [ERROR] Failed to execute:…","utIfI3bzTXA2v77k7OBCmKNqGmfWzL5W5-UgX284X1A",{"id":3120,"title":3121,"author":3122,"body":3123,"category":3214,"date":3215,"description":3216,"extension":16,"link":3217,"meta":3218,"navigation":23,"path":3219,"seo":3220,"slug":3127,"stem":3222,"tags":3223,"teaser":3226,"__hash__":3227},"blog/blog/servlet-container-options-for-maven.md","Servlet container options for Maven",[26],{"type":8,"value":3124,"toc":3212},[3125,3128,3143,3150,3160,3167,3174,3177,3204,3207,3210],[37,3126,3121],{"id":3127},"servlet-container-options-for-maven",[41,3129,3130,3131,3136,3137,3142],{},"When developing web apps with ",[45,3132,3135],{"href":3133,"rel":3134},"http://maven.apache.org/",[49],"Maven"," the de facto standard for running the app is to use the\nexcellent ",[45,3138,3141],{"href":3139,"rel":3140},"https://web.archive.org/web/20150520205353/https://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin",[49],"Maven Jetty Plugin","\nwhich runs the project in an embedded Jetty server. When configured, it can either run the project from the war file\ndirectly via mvn jetty:run or in exploded mode where the war is unpacked before being run (mvn jetty:run-exploded).\nThis noticably speeds up development as there is no need to manually deploy the artifact to a server.",[41,3144,3145,3146,3149],{},"But if the production system does not run on Jetty but on ",[45,3147,2762],{"href":2760,"rel":3148},[49]," you might run into some\nproblems:",[3151,3152,3153,3157],"ul",{},[3154,3155,3156],"li",{},"Some redirects from AJAX calls do work on Jetty but do not work on Tomcat",[3154,3158,3159],{},"When submitting some forms on Jetty the parameters get lost",[41,3161,3162,3163,3166],{},"The latter can be noticed when running ",[45,3164,695],{"href":2235,"rel":3165},[49]," on Jetty: Saving from the editor causes an error\nbecause the parameters are not available to OpenCms.",[41,3168,3169,3170,3173],{},"Fortunately there is a viable alternative:\nThe ",[45,3171,62],{"href":60,"rel":3172},[49],".\nBesides providing several options to deploy artifacts to an external server it can also be run in an embedded mode.",[41,3175,3176],{},"This is how the plugin is configured:",[68,3178,3180],{"className":100,"code":3179,"language":102,"meta":11,"style":11},"\n\u003Cplugin>\n \u003CgroupId>org.codehaus.mojo\u003C/groupId>\n \u003CartifactId>tomcat-maven-plugin\u003C/artifactId>\n\u003C/plugin>\n\n",[75,3181,3182,3186,3190,3195,3200],{"__ignoreMap":11},[106,3183,3184],{"class":108,"line":109},[106,3185,908],{"emptyLinePlaceholder":23},[106,3187,3188],{"class":108,"line":12},[106,3189,326],{},[106,3191,3192],{"class":108,"line":120},[106,3193,3194],{}," \u003CgroupId>org.codehaus.mojo\u003C/groupId>\n",[106,3196,3197],{"class":108,"line":126},[106,3198,3199],{}," \u003CartifactId>tomcat-maven-plugin\u003C/artifactId>\n",[106,3201,3202],{"class":108,"line":132},[106,3203,416],{},[41,3205,3206],{},"It can be run using mvn tomcat:run and mvn tomcat:run-war for running in unpacked war mode.",[41,3208,3209],{},"Using this plugin you can be sure that the features your servlet container provides in production are the same during\ndevelopment.",[421,3211,423],{},{"title":11,"searchDepth":12,"depth":12,"links":3213},[],[427],"2010-07-09T08:48:36","When developing web apps with Maven the de facto standard for running the app is to use the\\nexcellent Maven Jetty Plugin\\nwhich runs the project in an embedded Jetty server. When configured, it can either run the project from the war file\\ndirectly via mvn jetty:run or in exploded mode where the war is unpacked before being run (mvn jetty:run-exploded).\\nThis noticably speeds up development as there is no need to manually deploy the artifact to a server.","https://synyx.de/blog/servlet-container-options-for-maven/",{},"/blog/servlet-container-options-for-maven",{"title":3121,"description":3221},"When developing web apps with Maven the de facto standard for running the app is to use the\nexcellent Maven Jetty Plugin\nwhich runs the project in an embedded Jetty server. When configured, it can either run the project from the war file\ndirectly via mvn jetty:run or in exploded mode where the war is unpacked before being run (mvn jetty:run-exploded).\nThis noticably speeds up development as there is no need to manually deploy the artifact to a server.","blog/servlet-container-options-for-maven",[3224,149,3225,439,441],"development","jetty","When developing web apps with Maven the de facto standard for running the app is to use the excellent Maven Jetty Plugin which runs the project in an embedded Jetty…","fRYI1HRQAdsyYeA7rnRcKDEpC-Azc63aZtMg04FdDvU",{"id":3229,"title":3230,"author":3231,"body":3232,"category":3383,"date":3384,"description":3385,"extension":16,"link":3386,"meta":3387,"navigation":23,"path":3388,"seo":3389,"slug":3236,"stem":3390,"tags":3391,"teaser":3394,"__hash__":3395},"blog/blog/template-based-document-generation-using-odfdom.md","Template based document generation using ODFDOM",[26],{"type":8,"value":3233,"toc":3377},[3234,3237,3240,3255,3260,3269,3280,3283,3287,3295,3298,3301,3304,3307,3310,3314,3317,3324,3329,3332,3335,3338,3341,3344,3347,3350,3353,3356,3359,3362,3364,3367,3370,3374],[37,3235,3230],{"id":3236},"template-based-document-generation-using-odfdom",[41,3238,3239],{},"Generating documents from data that is managed by a web application is a quite common need. Think about letters that are\ngenerated for a customer relationship management system or bills that are to be send for membership fees. For corporate\nidentity reasons you don’t want these documents to look like generated from a plain text file but you want to have\nlogos, tables, address labels and so on.",[41,3241,3242,3243,3248,3249,3254],{},"As the people that are designing the look of these documents often are not programmers it is a good idea to provide a\nway to use well know tools for creating and editing templates for these documents. What we have been doing for some time\nis to let the customer create template documents using ",[45,3244,3247],{"href":3245,"rel":3246},"http://www.openoffice.org/",[49],"OpenOffice.org",", the open source\nword processor, and transform these documents programmatically. OpenOffice.org uses the\nstandardized ",[45,3250,3253],{"href":3251,"rel":3252},"http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office",[49],"Open Document"," format to save its\ndocuments. Open Document files are zip archives that contain some XML documents as well as additional content (images,\nmacros, …).",[3256,3257,3259],"h3",{"id":3258},"the-uno-approach","The UNO approach",[41,3261,3262,3263,3268],{},"One of the older approaches we have been using for document processing is to access an OpenOffice.org instance running\non the server using the ",[45,3264,3267],{"href":3265,"rel":3266},"http://wiki.services.openoffice.org/wiki/Uno",[49],"UNO API",". UNO is a language agnostic API that\nprovides access to a lot of functionality of OpenOffice.org using an IDL. Though really powerful this approach also\nyields some drawbacks:",[3151,3270,3271,3274,3277],{},[3154,3272,3273],{},"Understanding and learning the UNO API is hard and takes a lot of time",[3154,3275,3276],{},"Some features of a document can’t be accessed using the API (e.g. the id of form control elements is saved in the\ndocument but is not accessible using UNO)",[3154,3278,3279],{},"An instance of OpenOffice.org can only be used by one thread at a time so you need some kind of instance pooling.",[41,3281,3282],{},"These drawbacks make it really hard to design and implement a robust system that can handle the load of a typical web\napplication and can still be maintained by a lot of developers.",[3256,3284,3286],{"id":3285},"odfdom","ODFDOM",[41,3288,3289,3290,3294],{},"Some time after the standardization of the Open Document format a new project was\nborn: ",[45,3291,3286],{"href":3292,"rel":3293},"http://odftoolkit.org/projects/odfdom/pages/Home",[49],", a sub project of the odftoolkt project. ODFDOM is a\npure Java API that provides both low level DOM access to the Open Document XML format as well as convenience\nfunctionality to manipulate document data.",[41,3296,3297],{},"As with ODFDOM the application and the document generation all run on the Java Virtual Machine it is easier to maintain\nfrom an adminitrators perspective. Also in contrast to the UNO API ODFDOM is really easy to use.",[41,3299,3300],{},"The following snippet creates a new text document, inserts some text and saves the document to a temp file.",[41,3302,3303],{},"`OdfTextDocument doc = OdfTextDocument.newTextDocument();",[41,3305,3306],{},"doc.addText(\"Hello World!\");",[41,3308,3309],{},"doc.save(File.createTempFile(\"odfdom\", \".odt\"));`",[3256,3311,3313],{"id":3312},"templating","Templating",[41,3315,3316],{},"To use Odfdom for templating you can choose one of the many placeholder approaches in OpenOffice.org. A very simple one\nis the use of user fields. To insert a user field in OpenOffice.org create a new document and go to Insert => Field\ncommand => Others. There you choose the tab variables and user field. You can add a name and a value. The value in our\ncase is only there to have a visual feedback when designing the document. The user field will be replaced automatically.",[41,3318,3319,3320,3323],{},"Let’s see how we can replace our placeholder value. The values for user fields as inserted above are stored in a node\n",[45,3321,3322],{"href":3322},"text:user-field-decl",". This is an excerpt from the Open Document content.xml for a simple example document:",[41,3325,3326],{},[75,3327,3328],{},"\u003Ctext:user-field-decl office:value-type=\"string\" office:string-value=\"hello\" text:name=\"test\"/>",[41,3330,3331],{},"The user field is named test, it’s initial value for visual feedback is set to “hello”.",[41,3333,3334],{},"Imagine that the data that we want to replace with the values in the template is stored in a simple Map of Strings. To\nreplace all dummy values with values from you application you can access the nodes using the method\ngetElementsByTagName(“element”):",[41,3336,3337],{},"`Map\u003CString, String> values = new HashMap\u003CString, String>();",[41,3339,3340],{},"values.put(\"test\", \"inserted automatically\");",[41,3342,3343],{},"OdfDocument doc = OdfDocument.loadDocument(\"/path/to/template.odt\");",[41,3345,3346],{},"NodeList nodes = doc.getOfficeBody().getElementsByTagName(OdfTextUserFieldDecl.ELEMENT_NAME.getQName());",[41,3348,3349],{},"for (int i = 0; i \u003C nodes.getLength(); i++) {",[41,3351,3352],{},"OdfTextUserFieldDecl element = (OdfTextUserFieldDecl) nodes.item(i);",[41,3354,3355],{},"if (values.containsKey(element.getTextNameAttribute())) {",[41,3357,3358],{},"element.setOfficeStringValueAttribute(values.get(element.getTextNameAttribute()));",[41,3360,3361],{},"}",[41,3363,3361],{},[41,3365,3366],{},"doc.save(\"/path/to/result.odt\");`",[41,3368,3369],{},"When running the code above, the value in the document is replaced with the value set programmatically.",[3256,3371,3373],{"id":3372},"conclusion","Conclusion",[41,3375,3376],{},"So far we are running code using ODFDOM for document generation successfully in two larger projects that have been\ndeveloped recently. We believe that ODFDOM will help us delivering additional value for our customers with less\ndevelopment effort.",{"title":11,"searchDepth":12,"depth":12,"links":3378},[3379,3380,3381,3382],{"id":3258,"depth":120,"text":3259},{"id":3285,"depth":120,"text":3286},{"id":3312,"depth":120,"text":3313},{"id":3372,"depth":120,"text":3373},[427,510],"2010-06-13T17:57:40","Generating documents from data that is managed by a web application is a quite common need. Think about letters that are\\ngenerated for a customer relationship management system or bills that are to be send for membership fees. For corporate\\nidentity reasons you don’t want these documents to look like generated from a plain text file but you want to have\\nlogos, tables, address labels and so on.","https://synyx.de/blog/template-based-document-generation-using-odfdom/",{},"/blog/template-based-document-generation-using-odfdom",{"title":3230,"description":3239},"blog/template-based-document-generation-using-odfdom",[3392,149,3285,3393],"document-management","openoffice-org","Generating documents from data that is managed by a web application is a quite common need. Think about letters that are generated for a customer relationship management system or bills…","s3AA3WrDYmRY0S6MePU2SvOKGaEOPjNDiiAX_h4Pn5U",["Reactive",3397],{"$scookieConsent":3398,"$ssite-config":3400},{"functional":3399,"analytics":3399},false,{"_priority":3401,"env":3405,"name":3406,"url":3407},{"name":3402,"env":3403,"url":3404},-10,-15,0,"production","nuxt-app","https://synyx.de",["Set"],["ShallowReactive",3410],{"author-hopf":-1,"roughlyFilteredArticles":-1},"/blog/author/hopf"]