read config from json. Many refactoring to prepare multi language support
[pnews.git] / war / src / main / java / pnews / Category.java
index b67e7d9..1156acf 100644 (file)
@@ -1,29 +1,26 @@
 package pnews;
 
-public enum Category {
-        TOP("actualite", "Les actualités à la une"),
-        FRANCE("france", "France"),
-        SPORT("sport", "Sport"),
-        EUROPE("europe", "Europe"),
-        MONDE("monde", "Monde"),
-        ECO("economie", "Economie"),
-        ESSONNE("essonne", "Essonne"),
-        TECHNOLOGIE("technologie", "Technologie"),
-        PEOPLE("people", "People");
-        
-        private final String id;
-        private final String title;
+public class Category {
+        private final String name;
+                
+        public Category(String name) {
+                this.name = name;
+        }
                 
-        private Category(String id, String title) {
-                this.id = id;
-                this.title = title;
+        public String getTitle() {
+                return name;
         }
         
-        public String getId() {
-                return id;
+        public String getURL() {
+                return "/fr/" + name.toLowerCase();
         }
         
-        public String getTitle() {
-                return title;
+        public String getName() {
+                return name;
+        }        
+        
+        @Override
+        public String toString() {
+                return getName();
         }
 }