Package org.jayasoft.woj.portal.model

Examples of org.jayasoft.woj.portal.model.ClufVersionImpl


        return ((ClufVersionImpl)foundClufs.get(0));
    }

    public synchronized ClufImpl getCurrentVersion(String language) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());
        ClufVersionImpl version = getCurrentClufVersion();
        List currentCluf = t.find("from " + ClufImpl.class.getName() + " c where c.clufVersion = ? and c.language = ?", new Object[] {version, language});
        if (currentCluf.size() == 0) {
            if ("en".equals(language)) {
                throw new IllegalStateException("no cluf found for "+version.getVersion()+" language=en");
            } else {
                // maybe the language is unknown, let's try with english
                currentCluf = t.find("from " + ClufImpl.class.getName() + " c where c.clufVersion = ? and c.language = ?", new Object[] {version, "en"});
                if (currentCluf.size() == 0) {
                    throw new IllegalStateException("no cluf found for "+version.getVersion()+" language="+language+",en");
                }
            }
        }
        LOGGER.debug("found " + currentCluf.size() + " cluf as current cluf for "+language);
        return ((ClufImpl)currentCluf.get(0));
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.portal.model.ClufVersionImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.