Examples of WGContent


Examples of de.innovationgate.webgate.api.WGContent

       
    }

    private WGAbstractResultSet getRelationTargets(WGContent content, String contentClass, Element relationNode) throws WGAPIException, HDBModelException {
       
        WGContent baseContent = null;
       
        // Get target and base class
        String targetClass = relationNode.attributeValue("targetclass");
        if (targetClass == null) {
            throw new HDBModelException("Missing attribute targetclass on relation '" + relationNode.attributeValue("name") + "' of content class '" + content.getContentClass() + "'");
        }
       
        String baseClass = relationNode.attributeValue("baseclass");
        if (baseClass != null) {
            if (baseClass.equals(content.getContentClass())) {
                baseContent = content;
            }
            else {
                baseContent = content.getRelation("parent-" + baseClass);
                if (baseContent == null) {
                    throw new HDBModelException("Cannot find base class '" + baseClass + "' from content " + content.getContentKey());
                }
            }
        }
       
        List<String> conditions = new ArrayList<String>();
        List<String> orders = new ArrayList<String>();
        Map<String,Object> params = new HashMap<String,Object>();
        params.putAll(Query.buildDefaultQueryParams(content));
       
        // Add relation targets as parameters
        for (String relationName : content.getRelationNames()) {
            WGContent relationTarget = content.getRelation(relationName);
            if (relationTarget != null) {
                params.put("relation_" + Query.makeQueryParameterName(relationName), relationTarget);
            }
        }
       
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

           
            // collect group struct entries / if any exist
            Map groupMembership = new HashMap();
            if (_groupsRootDoc != null) {
                WGStructEntryList groupStructEntries = null;
                WGContent rootContent = db.getContentByName(_groupsRootDoc);
                if (rootContent != null) {
                    groupStructEntries = rootContent.getStructEntry().getChildEntries();
                }
   
                if (groupStructEntries == null) {
                    WGArea area = db.getArea(_groupsRootDoc);
                    if (area != null) {
                        groupStructEntries = area.getRootEntries();
                    }
                }
   
                if (groupStructEntries == null) {
                    throw new WGException("Root doc name '" + _groupsRootDoc + "' is neither the unique name of a content nor an area name. Please check if the default language " + db.getDefaultLanguage() + " of this database matches the language of group documents.");
                }
   
                // Recurse through group docs
                Iterator structsIt = groupStructEntries.iterator();
                while (structsIt.hasNext()) {
                    recurseGroupDocuments((WGStructEntry) structsIt.next(), groupMembership, newGroupInformation);
                }
            }

            // Collect user struct entries {
            WGStructEntryList structEntries = null;
            WGContent rootContent = db.getContentByName(_userRootDoc);
            if (rootContent != null) {
                structEntries = rootContent.getStructEntry().getChildEntries();
            }

            if (structEntries == null) {
                WGArea area = db.getArea(_userRootDoc);
                if (area != null) {
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

        }

        private void recurseGroupDocuments(WGStructEntry entry, Map groupMembership, Set<String> groupInformation) throws WGAPIException {
           
            // Look for content with necessary items. Fetch logins if available
            WGContent content = entry.getReleasedContent(entry.getDatabase().getDefaultLanguage());
            if (content != null && isGroupDefinition(content)) {
                fetchDefaultGroupsFromDocument(groupMembership, content, groupInformation);
            }
            // Recurse thru children
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

        }

        private void recurseLoginDocuments(WGStructEntry entry, Map logins) throws WGAPIException {

            // Look for content with necessary items. Fetch logins if available
            WGContent content = entry.getReleasedContent(entry.getDatabase().getDefaultLanguage());
            if (content != null && isLoginDefinition(content)) {
                fetchDefaultLoginsFromDocument(logins, content);
            }

            // Recurse thru children
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

  /* (Kein Javadoc)
   * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
   */
  public int compare(Object o1, Object o2) {
   
    WGContent content1 = (WGContent) o1;
    WGContent content2 = (WGContent) o2;
    TMLContext context1;
        TMLContext context2;
       
        context1 = _tag.getTMLContextForDocument(content1);
        context2 = _tag.getTMLContextForDocument(content2);
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

        }

        // Fetch the TML module to include
        WGTMLModule tmllib;
        if (type.equals(TYPE_INNERLAYOUT)) {
          WGContent currentContent =  this.getTMLContext().content();
          if (currentContent.isDummy() || !currentContent.hasCompleteRelationships()) {
            throw new TMLException("The inner layout of this content cannot be determined, bc. it is either a dummy document, or it doesnt have complete document relationships.");
          }
          tmllib = currentContent.getStructEntry().getInnerLayout(mediaKey);
          designDBKey =  currentContent.getDatabase().getDbReference();
          if (tmllib == null || tmllib.isDummy()) {
            throw new TMLException("Cannot find inner layout for doctype " + this.getTMLContext().content().getStructEntry().getContentType().getName());
          }
        }
       
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

      Boolean bi = (Boolean) this._pageContext.getSession().getAttribute(WGACore.ATTRIB_BROWSERINTERFACE);
    if (bi == null || bi.booleanValue() == false) {
      return false;
    }
   
        WGContent content = (WGContent) _pageContext.getRequest().getAttribute(WGACore.ATTRIB_MAINCONTEXT);
        if (content != null) {
            WGDatabase db = content.getDatabase();
            String startPageEnabled = (String) db.getAttribute(WGACore.DBATTRIB_STARTPAGE);
            if (startPageEnabled != null && startPageEnabled.equals("false")) {
                return false;
            }
        }
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

        String structKeyStr = "null";
        String titleStr = "null";
      
        // Try to retrieve content key to fill content specific information
        try {
            WGContent content = (WGContent) _pageContext.getRequest().getAttribute(WGACore.ATTRIB_MAINCONTEXT);
            if (content != null) {
                dbKeyStr = quote + content.getDatabase().getDbReference() + quote;
                contentKeyStr = quote + content.getContentKey().toString() + quote;
                structKeyStr = quote + content.getContentKey().getStructKey() + quote;
                titleStr = quote + content.getTitle() + quote;
            }
        }
        catch (Exception e) {
            // Fail silently. Better to display info of the originating error than to show info of internal error in error handling
        }
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

        if (params.containsKey(WGDatabase.QUERYOPTION_ONLYLANGUAGE)) {
            builtQuery.append(" and languages.name = '").append(params.get(WGDatabase.QUERYOPTION_ONLYLANGUAGE).toString()).append("'");
        }

        if (params.containsKey(WGDatabase.QUERYOPTION_EXCLUDEDOCUMENT)) {
            WGContent content = (WGContent) params.get(WGDatabase.QUERYOPTION_EXCLUDEDOCUMENT);
            if (content.getDatabase() == this._db) {
                WGDocumentCore contentCore = content.getCore();
                if (contentCore instanceof WGDocumentImpl) {
                    Content contentEntity = (Content) ((WGDocumentImpl) content.getCore()).getEntity();
                    builtQuery.append(" and not (content.cuid = '" + contentEntity.getCuid() + "')");
                }
            }
        }
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContent

                fullQuery.add("content.language.name = '" + params.get(WGDatabase.QUERYOPTION_ONLYLANGUAGE).toString() + "'");
            }
           
            // Filter the "current document"
            if (params.containsKey(WGDatabase.QUERYOPTION_EXCLUDEDOCUMENT)) {
                WGContent content = (WGContent) params.get(WGDatabase.QUERYOPTION_EXCLUDEDOCUMENT);
                if (content.getDatabase() == this._db) {
                    WGDocumentCore contentCore = content.getCore();
                    if (contentCore instanceof WGDocumentImpl) {
                        Content contentEntity = (Content) ((WGDocumentImpl) content.getCore()).getEntity();
                        if (_ddlVersion >= WGDatabase.CSVERSION_WGA5) {
                            fullQuery.add("not content.id = :wgaparamEntityId");
                            queryParams.put("wgaparamEntityId", contentEntity.getId());
                        }
                        else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.