annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/AttrList.java @ 4215:c179cd02177d

Logout the current user Add code to the logout button to remove the current user from the session and to redirect the browser window to the login page. Part of flys/issue916 (Logout: "Abmelden" Knopf mit Funktion belegen)
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 23 Oct 2012 09:59:16 +0200
parents ffb98b228b3c
children
rev   line source
813
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.shared.model;
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 import java.util.List;
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 import java.util.ArrayList;
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6 import java.io.Serializable;
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
8 public class AttrList implements Serializable
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9 {
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10 protected List<String> keyValues;
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12 public AttrList() {
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13 this(5);
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14 }
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16 public AttrList(int size) {
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17 keyValues = new ArrayList<String>(size*2);
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 }
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 public int size() {
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21 return keyValues != null ? keyValues.size()/2 : null;
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 }
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 public String getKey(int index) {
822
ffb98b228b3c Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 813
diff changeset
25 return keyValues.get(index*2);
813
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 }
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 public String getValue(int index) {
822
ffb98b228b3c Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 813
diff changeset
29 return keyValues.get(index*2 + 1);
813
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 }
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 public void add(String key, String value) {
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 keyValues.add(key);
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 keyValues.add(value);
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 }
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36 }
57ea5af8a967 Meta data service converter: transfer attributes to client, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org