⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jahiacategories.java

📁 java 写的一个新闻发布系统
💻 JAVA
字号:
////                                   ____.//                       __/\ ______|    |__/\.     _______//            __   .____|    |       \   |    +----+       \//    _______|  /--|    |    |    -   \  _    |    :    -   \_________//   \\______: :---|    :    :           |    :    |         \________>//           |__\---\_____________:______:    :____|____:_____\//                                      /_____|////                 . . . i n   j a h i a   w e   t r u s t . . .//package org.jahia.data.categories;import java.util.*;                     // Hashtable/***    * Title :       JahiaCategories    * desc : This class returns the categories proposed to the user when    *               he creates an undefined field.    *               In the (near) future, this class should be able to add    *               (and remove ?) dynamically categories : that's why    *               categories are not static.    *               Another possibility would be that the categories are    *               returned by a market place server via a SOAP call, but    *               this should be done only after appropriate research    *               (for example : what happens in a closed Intranet ?, etc.)    * Copyright :   Copyright Jahia (c) 2001    * Company :     Jahia Ltd    * @author       Eric Vassalli    * @version      1.0    */public class JahiaCategories {    private static  JahiaCategories     theObject;    /**     * @associates CategoryBean      */    private         Vector              theCategories;    /***        *  constructor is protected, because class is a singleton        *        */    protected JahiaCategories() {        createInitialCategories();    } // end constructor    /***        * returns a unique instance of the class        * @return       unique instance of the class        *        */    public static synchronized JahiaCategories getInstance()    {        if (theObject == null) {            theObject = new JahiaCategories();        }        return theObject;    } // end getInstance    /***        * creates the initial categories        * TODO : the categories must be read from a text file !        *        */    private void createInitialCategories()    {        theCategories = new Vector();        CategoryBean aCat;        // Basics        aCat = new CategoryBean( 1, "Basics",            "Texts, Files, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // Web        aCat = new CategoryBean( 2, "Web",            "Menus, Counters, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // Collaborative        aCat = new CategoryBean( 3, "Collaborative",            "Forums, Chats, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // Personal        aCat = new CategoryBean( 4, "Basics",            "Address Books, Calendars, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // Business/Finance        aCat = new CategoryBean( 5, "Business/Finance",            "Enterprise tools, Stock Watchers, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // Home/Education        aCat = new CategoryBean( 6, "Home/Education",            "All-purposes Lists, Virtual Classrooms, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // Content sources        aCat = new CategoryBean( 7, "Content Sources",            "Weather Forecasts, Stock market, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // E-Services        aCat = new CategoryBean( 8, "E-Services",            "Shared Calendars, Order Systems, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // Fun Stuff        aCat = new CategoryBean( 9, "Fun Stuff",            "Games, Multimedia, ..." );        if (aCat != null) {            theCategories.add( aCat );        }        // Other        aCat = new CategoryBean( 10, "Other",            "..." );        if (aCat != null) {            theCategories.add( aCat );        }    } // end createInitialCategories    /***        * returns the categories        * @return       a Vector containing all Jahia Categories        *        */    public Vector getList()    {        if (theCategories != null) {            return (Vector) theCategories.clone();        } else {            return new Vector();        }    } // end getList} // end JahiaCategories

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -