preload
Mrz 30

To fix some menu entries in your menu so that they are displayed all the time use the following sample code:

?View Code JAVASCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
lib.mainMenu.alwaysActivePIDlist = 3,4,5
#  main menu
lib.mainMenu= HMENU
lib.mainMenu.entryLevel = 0
#  show these uids of sites no matter where we are lib.mainMenu.alwaysActivePIDlist  = 3,4,5 lib.mainMenu {
# erstes level
1 = TMENU
1.wrap = <ul  id="topnavigation">|</ul>
1{
  # no state: normale  Formatierung
  NO{
    wrapItemAndSub =  <li>|</li>
  }
  # act state: gültig von der rootseite  bis zur aktuellen Seite
  ACT=1
  ACT{
    wrapItemAndSub = <li  class="menu-level1-active">|</li>
  }
  # cur state: gültig für die aktuelle  Seite
  CUR=1
  CUR{
    wrapItemAndSub = <li  class="menu-level1-current-active">|</li>
  }
  # ifsub state: gültig für seiten die  unterseiten haben
  IFSUB=1
  IFSUB{
    wrapItemAndSub = <li  class="menu-level1-with-subpage">|</li>
  }
}
# zweites level
2 = TMENU
2.wrap = <ul  class="menu-level2">|</ul>
2{
  NO{
    wrapItemAndSub =  <li>|</li>
  }
  ACT=1
  ACT{
  wrapItemAndSub = <li  class="menu-level2-active">|</li>
  }
  CUR=1
  CUR{
    wrapItemAndSub = <li  class="menu-level2-current-active">|</li>
  }
  IFSUB=1
  IFSUB{
    wrapItemAndSub = <li  class="menu-level2-with-subpage">|</li>
  }
}
Tagged with:
Mrz 30

Found an interesting article about Data URIs.
It is possible to embed the image data directly into the document. This can either be the html document or a css-file.

1
2
3
4
5
6
7
li {
  background:
    url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7)
    no-repeat
    left center;
  padding: 5px 0 5px 25px;
}

This is cool stuff but will not run in IE<8.

So why should i use this? Normally not, but to save requests.

Great article from http://css-tricks.com/data-uris/

Tagged with:
Mrz 25

Sometimes you have to revert changes in svn from lets say a commit you made some days ago. Since then more commits where done and this can be a hard job to undo your changes. So how to undo the changes e.g. from your change in revision 120 when the actual revision is 140?

Go to your trunk workdir and use the following:

1
mvn merge -r 120:119 http://my.svn.repo/trunk/

The changes you made will be reverted. If there are some conflicts they will be shown.
Maybe it is a good idea to make a dry run via:

1
mvn merge --dry-run -r 120:119 http://my.svn.repo/trunk/

So no changes are really made but only shows them.

Of course you can use this for reverting merges.

Tagged with:
Mrz 02

Due to the fact I got in touch with maven2 and I think that maven2 is very helpful will give a short introduction. Bigger projects normally have a more complex configuration but I will start from the scratch.

Maven will create a kind of project sceleton with the following command

1
mvn archetype:create -DgroupId=info.sobek.testapp -DartifactId=testapp

If you work with e.g. eclipse, you can create the project files for eclipse:

1
mvn eclipse:eclipse

Now you can import it into eclipse with “import into existing workspace” option of eclipse.

Maven will normally copy the created so called “artifacts” into your local maven repository. Normally located under your home dir and then .m2

When you program depends on several jars and these dependencies are defined in the pom.xml, then maven will copy the jars in their specific version into the local maven repository. This is very helpful because you can simply build your project with another newer or older version of your dependent jar-file.

How to create multi-module projects will be explained in another episode.

Tagged with: