當前位置: 首頁>>代碼示例>>Java>>正文


Java DataSetDef.setUUID方法代碼示例

本文整理匯總了Java中org.dashbuilder.dataset.def.DataSetDef.setUUID方法的典型用法代碼示例。如果您正苦於以下問題:Java DataSetDef.setUUID方法的具體用法?Java DataSetDef.setUUID怎麽用?Java DataSetDef.setUUID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.dashbuilder.dataset.def.DataSetDef的用法示例。


在下文中一共展示了DataSetDef.setUUID方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerDataSetDef

import org.dashbuilder.dataset.def.DataSetDef; //導入方法依賴的package包/類
@Override
public void registerDataSetDef(DataSetDef def,
                               String subjectId,
                               String message) {

    if (def.getUUID() == null) {
        final String uuid = uuidGenerator.newUuid();
        def.setUUID(uuid);
    }

    if (subjectId == null || message == null) {
        ioService.startBatch(fileSystem);
    } else {
        ioService.startBatch(fileSystem,
                             new CommentedOption(subjectId,
                                                 message));
    }

    try {
        String defJson = getDataSetDefJsonMarshaller().toJsonString(def);
        Path defPath = resolveNioPath(def);
        ioService.write(defPath,
                        defJson);

        // CSV specific
        if (def instanceof CSVDataSetDef) {
            saveCSVFile((CSVDataSetDef) def);
        }
        super.registerDataSetDef(def,
                                 subjectId,
                                 message);
    } catch (Exception e) {
        throw exceptionManager.handleException(
                new Exception("Can't register the data set definition\n" + def,
                              e));
    } finally {
        ioService.endBatch();
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:40,代碼來源:DataSetDefRegistryCDI.java

示例2: registerDataSetDef

import org.dashbuilder.dataset.def.DataSetDef; //導入方法依賴的package包/類
@Override
public String registerDataSetDef(DataSetDef definition, String comment) {
    // Data sets registered from the UI does not contain a UUID.
    if (definition.getUUID() == null) {
        final String uuid = uuidGenerator.newUuid();
        definition.setUUID(uuid);
    }
    dataSetDefRegistry.registerDataSetDef(definition,
            identity != null ? identity.getIdentifier() : "---",
            comment);
    return definition.getUUID();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:13,代碼來源:DataSetDefServicesImpl.java

示例3: lookupDataSet

import org.dashbuilder.dataset.def.DataSetDef; //導入方法依賴的package包/類
public DataSet lookupDataSet(DataSetDef def, DataSetLookup lookup) throws Exception {
    try {
        // Although if using a not registered definition, it must have an uuid set for performing lookups.
        if (def.getUUID() == null) {
            final String uuid = uuidGenerator.newUuid();
            def.setUUID(uuid);
            lookup.setDataSetUUID(uuid);
        }
        return dataSetManager.resolveProvider(def)
                .lookupDataSet(def, lookup);
    } catch (Exception e) {
        throw exceptionManager.handleException(e);
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:15,代碼來源:DataSetLookupServicesImpl.java

示例4: copyDataSetDef

import org.dashbuilder.dataset.def.DataSetDef; //導入方法依賴的package包/類
public DataSetDef copyDataSetDef(DataSetDef def,
                                 String newName,
                                 String subjectId,
                                 String message) {
    DataSetDef clone = def.clone();
    clone.setUUID(uuidGenerator.newUuid());
    clone.setName(newName);

    if (subjectId == null || message == null) {
        ioService.startBatch(fileSystem);
    } else {
        ioService.startBatch(fileSystem,
                             new CommentedOption(subjectId,
                                                 message));
    }
    try {
        // CSV specific
        if (def instanceof CSVDataSetDef) {
            CSVDataSetDef csvDef = (CSVDataSetDef) def;
            CSVDataSetDef csvCloneDef = (CSVDataSetDef) clone;
            Path csvPath = resolveCsvPath(csvDef);
            Path cloneCsvPath = resolveCsvPath(csvCloneDef);
            ioService.copy(csvPath,
                           cloneCsvPath);
            csvCloneDef.setFilePath(convert(cloneCsvPath).toURI());
        }
        String defJson = getDataSetDefJsonMarshaller().toJsonString(clone);
        Path clonePath = resolveNioPath(clone);
        ioService.write(clonePath,
                        defJson);

        super.registerDataSetDef(clone,
                                 subjectId,
                                 message);
        return clone;
    } catch (Exception e) {
        throw exceptionManager.handleException(
                new Exception("Can't register the data set definition\n" + def,
                              e));
    } finally {
        ioService.endBatch();
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:44,代碼來源:DataSetDefRegistryCDI.java

示例5: createDataSetDef

import org.dashbuilder.dataset.def.DataSetDef; //導入方法依賴的package包/類
@Override
public DataSetDef createDataSetDef(DataSetProviderType type) {
    DataSetDef result = type != null ? type.createDataSetDef() : new DataSetDef();
    result.setUUID(uuidGenerator.newUuid());
    return result;
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:7,代碼來源:DataSetDefServicesImpl.java


注:本文中的org.dashbuilder.dataset.def.DataSetDef.setUUID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。