Examples of WGStructEntry


Examples of de.innovationgate.webgate.api.WGStructEntry

        }

        Iterator entriesIt = entries.iterator();
        WGContent foundContent = null;
        while (entriesIt.hasNext()) {
            WGStructEntry entry = (WGStructEntry) entriesIt.next();
            WGContent content = chooser.selectContentForPage(entry, false);
            if (content != null) {
                if (title.matches(content)) {
                    foundContent = content;
                    break;
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

        WGContent foundContent = null;
        Iterator entriesIt = entries.iterator();
       
        // Iterate entries
        while (entriesIt.hasNext()) {
            WGStructEntry entry = (WGStructEntry) entriesIt.next();
           
            WGContent content = null;
           
            // First try the addressed language from the path (if available)
            if (titlePath.getLanguage() != null) {
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

        this.appendResult("<script type=\"text/javascript\">");
        this.appendResult("\nWGA.contentinfo={");
        this.appendResult("\n\tdbkey:\"" + content.getDatabase().getDbReference() + "\"");
        if(!content.isDummy()){
          this.appendResult(",");
          WGStructEntry structentry = content.getStructEntry();       
          this.appendResult("\n\tstructkey:\"" + structentry.getStructKey() + "\",");
          this.appendResult("\n\tcontentkey:\"" + content.getContentKey(true) + "\",");     
          //this.appendResult("\n\ttitle:\"" +  WGUtils.strReplace(content.getTitle(), "\"", "\\\"", true));
          this.appendResult("\n\ttitle:\"" +  WGUtils.strReplace(WGUtils.strReplace(content.getTitle(), "\"", "\\\"", true), "script", "sc\"+\"ript", true));
                this.appendResult("\",");
          this.appendResult("\n\tlanguage:\"" + content.getLanguage().getName() + "\"");
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

  public WGDocumentCore fastAccess(int type, Object key) throws WGAPIException {
    BeanKey beanKey = (BeanKey) key;
    if (type == WGDocument.TYPE_CONTENT) {
       
        // The corresponding struct entry already has it's core we maybe can retrieve the bean from it
        WGStructEntry entry = _db.getStructEntryByKey(beanKey);
        if (entry != null) {
        WrappedKey entryCore = (WrappedKey) entry.getCore();
        Object bean = entryCore.getBean();
                return createWrapper(beanKey, bean, true);
           
       
      //Object bean = getContent(beanKey.getFolder(), beanKey.getKey());
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

    }
    else if (name.equals("structtitle")) {
      return content.getStructEntry().getTitle();
    }
    else if (name.equals("structkey")) {
      WGStructEntry entry = content.getStructEntry();
      if (entry != null) {
        return String.valueOf(entry.getStructKey());
      }
      else {
        return null;
      }
    }
    else if (name.equals("itemnames")) {
      return content.getItemNames();
    }
    else if (name.equals("searchscore")) {
        return new Float(content.getSearchScore());
    }
    else if (name.equals("searchexplanation")) {
      return content.getSearchExplanation();
    }
        else if (name.equals("positionpath")) {
            return content.getStructEntry().getPositionPath();
        }
        else if (name.equals("pagepublished")) {
            return content.getStructEntry().getPublished().get(content.getLanguage().getName());
        }
        else if (name.equals("email")) {
            return content.getAuthorEMail();
        }
    else {
      Object result = null;
      String upperName = name.toUpperCase();
      boolean isNoValidMeta = true;

      if (content.getMetaNames().indexOf(upperName) != -1) {
        result = content.getMetaData(upperName);
        isNoValidMeta = false;
      }

      else if (result == null) {
        WGStructEntry structEntry = content.getStructEntry();
        if (structEntry != null) {
          if (structEntry.getMetaNames().indexOf(upperName) != -1) {
            result = structEntry.getMetaData(upperName);
            isNoValidMeta = false;
          }
          if (result == null) {
            WGContentType docType = structEntry.getContentType();
            if (docType != null) {
              if (docType.getMetaNames().indexOf(upperName) != -1) {
                result = docType.getMetaData(upperName);
                isNoValidMeta = false;
              }
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

        Iterator it = locks.values().iterator();
        while (it.hasNext()) {
            Lock lock = (Lock) it.next();
            if (!lock.isOwnedBy(owner)) {
                if (lock.getLockable() instanceof WGStructEntry) {                   
                    WGStructEntry lockedStructEntry = (WGStructEntry) lock.getLockable();
                    // check if locked structentry is a descendant of given entry
                    if (lockedStructEntry.isDescendantOf(entry)) {
                        return true;
                    }
                } else if (lock.getLockable() instanceof WGContent) {
                    WGContent lockedContent = (WGContent) lock.getLockable();
                    // check if lockedContent is a content of a descendant structentry or equals given entry
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

      Iterator it = locks.values().iterator();
        while (it.hasNext()) {
            Lock lock = (Lock) it.next();
            if (!lock.isOwnedBy(owner)) {
                if (lock.getLockable() instanceof WGStructEntry) {                   
                    WGStructEntry lockedStructEntry = (WGStructEntry) lock.getLockable();
                    if (lockedStructEntry.getArea().equals(area)) {
                        return true;
                    }
                } else if (lock.getLockable() instanceof WGContent) {
                    WGContent lockedContent = (WGContent) lock.getLockable();
                    // check if structentry of lockedContent belongs to given area
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

            area.dropCore();
           
            incSourceDocCounter();
            incTargetDocCounter();
            Iterator rootEntries = area.getRootEntries().iterator();
            WGStructEntry rootEntry;
            while (rootEntries.hasNext()) {
                rootEntry = (WGStructEntry) rootEntries.next();
                cloneStructEntryTree(rootEntry, areaClone, _to, _contentClones, _oldToNewContentKeys);
            }
        }
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

    private void cloneStructEntryTree(WGStructEntry rootEntry, WGDocument cloneParent, WGDatabase to, List contentClones, Map oldToNewContentKeys)
            throws WGAPIException {

        // Clone entry
        WGStructEntry entryClone = null;
        validate(rootEntry);
        _log.info("Cloning struct entry '" + rootEntry.getStructKey() + "'");
        try {
            entryClone = (WGStructEntry) createDumpClone(rootEntry, cloneParent);
        }
        catch (WGAPIException e) {
           handleException("Error cloning struct entry", e, rootEntry);
            return;
        }

        if (entryClone == null) {
            handleSaveError("Unable to clone struct entry.", rootEntry);
            return;
        }
       
        rootEntry.dropCore();
        entryClone.dropCore();

        incSourceDocCounter();
        incTargetDocCounter();

        // Clone contents of entry
        Iterator contents = rootEntry.getAllContent(true).iterator();
        WGContent content;
        WGContent contentClone;
        while (contents.hasNext()) {
            content = (WGContent) contents.next();
            validate(content);
            _log.info("Cloning content '" + content.getContentKey() + "'");
            try {
                contentClone = (WGContent) createDumpClone(content, entryClone);
            }
            catch (WGAPIException e1) {
                handleException("Error cloning content", e1, content);
                return;
            }
            if (contentClone == null) {
                handleSaveError("Unable to clone content.", content);
                continue;
            }
           
            contentClone.dropCore();
            content.dropCore();

            incSourceDocCounter();
            incTargetDocCounter();

            oldToNewContentKeys.put(content.getContentKey(true).toString(), contentClone.getContentKey().toString());
            if (contentClone.getStatus().equals(WGContent.STATUS_RELEASE)) {
                oldToNewContentKeys.put(content.getContentKey(false).toString(), contentClone.getContentKey(false).toString());
                oldToNewContentKeys.put(content.getStructKey() + "." + content.getLanguage().getName() + ".p", contentClone.getContentKey(false).toString());
            }

            contentClones.add(contentClone);

            entryClone.dropCore();
            rootEntry.dropCore();

        }

        // Proceed with child entries the same way
View Full Code Here

Examples of de.innovationgate.webgate.api.WGStructEntry

                addKeyword(document, VIRTUALMETA_CONTENTTYPE, content.getStructEntry().getContentType().getName());
                addSortField(document, VIRTUALMETA_CONTENTTYPE, content.getStructEntry().getContentType().getName());
            }
           
            if (!content.getStructEntry().isRoot()) {
                WGStructEntry ancestor = content.getStructEntry().getParentEntry();
                addKeyword(document, VIRTUALMETA_PARENT, ancestor.getStructKey().toString());
                do {
                    addKeyword(document, VIRTUALMETA_PATH, ancestor.getStructKey().toString());
                    ancestor = ancestor.getParentEntry();
                } while (ancestor != null);               
               
            }
           
            Iterator contentMetaNames = content.getMetaNames().iterator();
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.