当前位置: 首页>>代码示例>>Java>>正文


Java Content2类代码示例

本文整理汇总了Java中de.espirit.firstspirit.access.store.contentstore.Content2的典型用法代码示例。如果您正苦于以下问题:Java Content2类的具体用法?Java Content2怎么用?Java Content2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Content2类属于de.espirit.firstspirit.access.store.contentstore包,在下文中一共展示了Content2类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addToExportOperation

import de.espirit.firstspirit.access.store.contentstore.Content2; //导入依赖的package包/类
@Override
public void addToExportOperation(StoreAgent storeAgent, boolean useReleaseState, ExportOperation exportOperation) {
    ContentStoreRoot store = (ContentStoreRoot) storeAgent.getStore(Store.Type.CONTENTSTORE, useReleaseState);

    final Content2 content2 = store.getContent2ByName(uid);
    if(content2 == null) {
        throw new IllegalStateException("Content2 with uid '" + uid + "' couldn't be found.");
    }
    Schema schema = content2.getSchema();
    if(schema == null) {
        throw new IllegalStateException("Schema for content2 object with uid " + uid + " couldn't be found.");
    }
    final ExportOperation.SchemaOptions schemaOptions = exportOperation.addSchema(schema);

    for (Dataset dataset : content2.getDatasets()) {
        schemaOptions.addEntity(dataset.getEntity());
    }
}
 
开发者ID:e-Spirit,项目名称:FSDevTools,代码行数:19,代码来源:EntitiesIdentifier.java

示例2: release

import de.espirit.firstspirit.access.store.contentstore.Content2; //导入依赖的package包/类
/**
 * Main release method that distinguishes between Entity and StoreElement. StoreElements are released within this method. For entities the
 * releaseEntity method is called.
 *
 * @param checkOnly Determines if the method should do only a check or really release the object.
 * @return true if successful.
 */
public boolean release(boolean checkOnly) {
    final boolean result;
    Set<Long> lockedList = new HashSet<Long>();
    Set<Long> permList = new HashSet<Long>();

    // release entity
    if (this.entity != null) {
        final ContentWorkflowable contentWorkflowable = (ContentWorkflowable) workflowScriptContext.getWorkflowable();
        final Content2 content2 = contentWorkflowable.getContent();
        result = releaseEntity(content2, this.entity, checkOnly);
    } else {
        result = releaseStoreElement(checkOnly, lockedList, permList);
    }

    // set in integration tests
    final String suppressDialog = (String) workflowScriptContext.getSession().get("wfSuppressDialog");
    if (!WorkflowConstants.TRUE.equals(suppressDialog)) {
        showLockedElementsIfAny(lockedList);
        showDeniedElementsIfAny(permList);
        showInvalidElementsIfAny();
    }
    return result;
}
 
开发者ID:e-Spirit,项目名称:basicworkflows,代码行数:31,代码来源:ReleaseObject.java

示例3: releaseEntity

import de.espirit.firstspirit.access.store.contentstore.Content2; //导入依赖的package包/类
/**
 * This method is used to release an entity.
 *
 * @param content2 The content2 object of the entity.
 * @param entity The Entity to release.
 * @param checkOnly Determines if the method should do only a check or really release the object.
 * @return true if successful.
 */
private boolean releaseEntity(Content2 content2, Entity entity, boolean checkOnly) {
    boolean result = true;

    String validationError = new FormValidator(workflowScriptContext).isValid(content2, entity);
    if (validationError == null) {
        if (!checkOnly) {
            try {
                entity.refresh();
                content2.refresh();
                content2.release(entity);
                content2.refresh();
                content2.getParent().refresh();
            } catch (LockException e) {
                Logging.logError("Exception during Release of " + entity, e, LOGGER);
                result = false;
            }
        }
    } else {
        Logging.logError("Validation failure during release!", LOGGER);
        validationErrorList.add(validationError);
        result = false;
    }
    return result;
}
 
开发者ID:e-Spirit,项目名称:basicworkflows,代码行数:33,代码来源:ReleaseObject.java

示例4: data

import de.espirit.firstspirit.access.store.contentstore.Content2; //导入依赖的package包/类
@Parameterized.Parameters(name = "{0}/execute:{2}")
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[]{Store.Type.PAGESTORE, mock(Page.class), Boolean.TRUE},
                         new Object[]{Store.Type.PAGESTORE, mock(PageFolder.class), Boolean.FALSE},
                         new Object[]{Store.Type.SITESTORE, mock(PageRef.class), Boolean.FALSE},
                         new Object[]{Store.Type.MEDIASTORE, mock(Media.class), Boolean.FALSE},
                         new Object[]{Store.Type.CONTENTSTORE, mock(Content2.class), Boolean.FALSE},
                         new Object[]{Store.Type.TEMPLATESTORE, mock(Template.class), Boolean.FALSE});
}
 
开发者ID:e-Spirit,项目名称:FSTestTools,代码行数:10,代码来源:MyContextMenuItemTest.java

示例5: getContent2ObjectsForEntity

import de.espirit.firstspirit.access.store.contentstore.Content2; //导入依赖的package包/类
private Listable<Content2> getContent2ObjectsForEntity(final Entity entityFromReference) {

        StoreAgent storeAgent = workflowScriptContext.requireSpecialist(StoreAgent.TYPE);
        ContentStoreRoot contentStoreRoot = (ContentStoreRoot) storeAgent.getStore(Store.Type.CONTENTSTORE);

        return contentStoreRoot.getChildren(new TypedFilter<Content2>(Content2.class) {
            @Override
            public boolean accept(Content2 storeElement) {
                return (storeElement.getEntityType().equals(entityFromReference.getEntityType())) && storeElement.getEntity(entityFromReference.getKeyValue()) != null;
            }
        }, true);
    }
 
开发者ID:e-Spirit,项目名称:basicworkflows,代码行数:13,代码来源:WorkflowObject.java

示例6: isDataRecord

import de.espirit.firstspirit.access.store.contentstore.Content2; //导入依赖的package包/类
private static boolean isDataRecord(final Object o) {
    return o instanceof Content2;
}
 
开发者ID:e-Spirit,项目名称:basicworkflows,代码行数:4,代码来源:WorkflowObject.java

示例7: isFolder

import de.espirit.firstspirit.access.store.contentstore.Content2; //导入依赖的package包/类
/**
 * Detects if the given StoreElement is a Folder or Content2.
 *
 * @param element the workflow element
 * @return true if the given element is a Folder
 */
private static boolean isFolder(StoreElement element) {
    return element instanceof StoreElementFolder && !(element instanceof Content2);
}
 
开发者ID:e-Spirit,项目名称:basicworkflows,代码行数:10,代码来源:WfBranchIfFolderExecutable.java

示例8: isValid

import de.espirit.firstspirit.access.store.contentstore.Content2; //导入依赖的package包/类
/**
 * Convenience method to check if validation of gui form (of an Entity) is successful.
 *
 * @param content2 The Content2 object of the entity.
 * @param entity   The Entity to check.
 * @return The error String of null.
 */
public String isValid(Content2 content2, Entity entity) {
    return isValid(null, content2, entity);
}
 
开发者ID:e-Spirit,项目名称:basicworkflows,代码行数:11,代码来源:FormValidator.java


注:本文中的de.espirit.firstspirit.access.store.contentstore.Content2类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。