當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。