Examples of WGContentType


Examples of de.innovationgate.webgate.api.WGContentType

    private boolean contentTypeAllowed(WGDocument doc) throws WGAPIException {

        // With specified content type
        if (getContenttype() != null) {
            WGContentType contentType = getTMLContext().db().getContentType(getContenttype());
            if (contentType != null) {
                return contentType.mayCreateContent() && contentType.mayCreateChildEntry(doc);
            }
            else {
                addWarning("Contenttype '" + getContenttype() + "' could not be found in database '" + getTMLContext().db().getDbReference() + "'.");
                return false;
            }
        }

        // no content type specified. Look if any content type is usable at this position
        else {
            Iterator contentTypes = getTMLContext().db().getContentTypes().iterator();
            boolean ctFound = false;
            while (contentTypes.hasNext()) {
                WGContentType ct = (WGContentType) contentTypes.next();
                if (ct.mayCreateContent() && ct.mayCreateChildEntry(doc)) {
                    ctFound = true;
                    break;
                }
            }
            return ctFound;
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContentType

    List contentTypesList = db.getContentTypes();
    if (contentTypesList == null) {
        return;
    }
        Iterator contentTypes = contentTypesList.iterator();
    WGContentType contentType;
    while (contentTypes.hasNext()) {
      contentType = (WGContentType) contentTypes.next();
      updateDatabaseEvents(dbKey, contentType);
    }
        } catch (WGAPIException e) {
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContentType

            return errorReturnContext;
        }
    }

    else if (contextFunction.equals("$contenttype")) {
        WGContentType contentType = db.getContentType(contextExpression);
        if (contentType != null) {
            return context.getTMLContextForDocument(contentType);
        }
        else {
            context.setLastError("Could not retrieve contenttype with name '" + contextExpression + "'");
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContentType

          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.WGContentType

            return;
        }
       
        _log.info("Cloning content types...");
        Iterator cts = _from.getContentTypes().iterator();
        WGContentType ct;
        WGContentType ctClone = null;

        while (cts.hasNext()) {
            ct = (WGContentType) cts.next();
            validate(ct);
            _log.info("Cloning content type '" + ct.getName() + "'");
            try {
                ctClone = (WGContentType) createDumpClone(ct, null);
            }
            catch (WGAPIException e) {
                handleException("Error cloning content type", e, ct);
            }

            if (ctClone == null) {
                handleSaveError("Unable to clone content type.", ct);
                continue;
            }
           
            ctClone.dropCore();
            ct.dropCore();

            incSourceDocCounter();
            incTargetDocCounter();
        }
View Full Code Here

Examples of de.innovationgate.webgate.api.WGContentType

            _log.info("Omitted deletion of old content types in target database, bc. of design provider");
            return;
        }
       
        Iterator cts = _to.getContentTypes().iterator();
        WGContentType ct;
        if (cts.hasNext()) {

            _log.info("Deleting old content types...");
            while (cts.hasNext()) {
                ct = (WGContentType) cts.next();
                _log.info("Deleting old content type '" + ct.getName() + "'");

                if (!ct.remove()) {
                    _log.error("Cannot delete content type. See application log for error details");
                    throw new WGBackendException("Canceled import because of failed deletion: " + ct.getDocumentKey());
                }

                incTargetDocCounter();
            }
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.