Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.WGContent


        params.setCustomParam(parameter);

        // Perform update
      String source = getforminfo().getSource();
      if (source.equals("content")) {
          WGContent content = gettargetcontext().content();
          params.setContentClass(content.getContentClass());
          try {
              hdb.updateContent(content, params);
              return true;
          }
          catch (WGHierarchicalDatabaseEventCanceledException e) {
View Full Code Here


    }
   
   
    private TMLContext retrieveContext(WGHierarchicalDatabaseEvent event) throws WGAPIException, TMLException {
        // determine content for context
        WGContent content = null;
        if (event.getType().equals(WGHierarchicalDatabaseEvent.TYPE_POST_CREATE_CONTENT) ||
                event.getType().equals(WGHierarchicalDatabaseEvent.TYPE_PRE_DELETE_CONTENT) ||
                event.getType().equals(WGHierarchicalDatabaseEvent.TYPE_PRE_UPDATE_CONTENT) ||
                event.getType().equals(WGHierarchicalDatabaseEvent.TYPE_POST_UPDATE_CONTENT) ||
                event.getType().equals(WGHierarchicalDatabaseEvent.TYPE_PRE_MOVE_CONTENT_TO) ||
View Full Code Here

import de.innovationgate.wgpublisher.webtml.utils.TMLContext;

public class StaticLanguageBehaviour implements LanguageBehaviour {
   
    public WGContent requestSelectContentForName(WGDatabase db, HttpServletRequest req, String name, boolean isBI) throws WGAPIException {
        WGContent content = LanguageBehaviourTools.chooseNamedContentByRequestLocales(db, name, req, isBI);
        if (content != null) {
            return content;
        }
        else {
            return db.getContentByName(name, db.getDefaultLanguage());
View Full Code Here

            return db.getContentByName(name, db.getDefaultLanguage());
        }
    }

    public WGContent requestSelectContentForPage(WGStructEntry page, HttpServletRequest req, boolean isBI) throws WGAPIException {
        WGContent content = LanguageBehaviourTools.chooseContentByRequestLocales(page, req, isBI);
        if (content != null) {
            return content;
        }
        else {
            return LanguageBehaviourTools.getRelevantContent(page, page.getDatabase().getDefaultLanguage(), isBI);
View Full Code Here

                return LanguageBehaviourTools.getRelevantContent(page, page.getDatabase().getDefaultLanguage(), isBI);
            }
        }
       
        String sourceLangName = context.content().getLanguage().getName();
        WGContent content = LanguageBehaviourTools.getRelevantContent(page, sourceLangName, isBI);
        if (content != null) {
            return content;
        }
       
        // If the source context is a dummy content we may ignore its language and choose from request locales (#00000543)
View Full Code Here

                return db.getContentByName(name, db.getDefaultLanguage());
            }
        }
       
        String sourceLangName = context.content().getLanguage().getName();
        WGContent content = db.getContentByName(name, sourceLangName);
        if (content != null) {
            return content;
        }
       
     // If the source context is a dummy content we may ignore its language and choose from request locales (#00000543)
View Full Code Here

        Enumeration<Locale> locales = req.getLocales();
        while (locales.hasMoreElements()) {
            Locale locale = locales.nextElement();
            WGLanguage lang = db.getLanguageForLocale(locale);
            if (lang != null && !lang.isDummy()) {
                WGContent content = getRelevantContent(page, lang.getName(), isBI);
                if (content != null) {
                    return content;
                }
            }
        }
View Full Code Here

       
       
        // BI mode: Prefer drafts over released docs
        Iterator contents = page.getAllContent().iterator();
        ArrayList allContent = new ArrayList();
        WGContent content = null;

        // Filter documents of correct workflow status and language and put them to list
        while (contents.hasNext()) {
            content = (WGContent) contents.next();
            if (!language.equalsIgnoreCase(content.getLanguage().getName())) {
                continue;
            }
           
            allContent.add(content);
        }
View Full Code Here

        Enumeration<Locale> locales = req.getLocales();
        while (locales.hasMoreElements()) {
            Locale locale = locales.nextElement();
            WGLanguage lang = db.getLanguageForLocale(locale);
            if (lang != null && !lang.isDummy()) {
                WGContent content = db.getContentByName(name, lang.getName());
                if (content != null) {
                    return content;
                }
            }
        }
View Full Code Here

            try {
                if (!(o1 instanceof WGContent) || !(o2 instanceof WGContent)) {
                    throw new IllegalArgumentException();
                }

                WGContent content1 = (WGContent) o1;
                WGContent content2 = (WGContent) o2;

                Integer statValue1 = getStatusValue(content1.getStatus());
                Integer statValue2 = getStatusValue(content2.getStatus());
               
                return statValue1.compareTo(statValue2);
            }
            catch (WGAPIException e) {
                throw new IllegalArgumentException("Cannot retrieve content status for comparing");
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.WGContent

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.