Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.Asset


                -1);
    }

    public DefaultRuleContentWidget(Asset a,
                                    int visibleLines) {
        Asset asset = a;
        data = (RuleContentText) asset.getContent();

        if (data.content == null) {
            data.content = "";
        }
View Full Code Here


    public Asset loadRuleAsset(String uuid) throws SerializationException {

        long time = System.currentTimeMillis();

        AssetItem item = rulesRepository.loadAssetByUUID(uuid);
        Asset asset = new AssetPopulator().populateFrom(item);

        asset.setMetaData(repositoryAssetOperations.populateMetaData(item));

        serviceSecurity.checkIsPackageReadOnlyOrAnalystReadOnly(asset);
        ModuleItem pkgItem = handlePackageItem(item,
                asset);
View Full Code Here

        return userName;
    }

    protected Asset loadAsset(AssetItem item) throws SerializationException {

        Asset asset = new Asset();
        asset.setUuid(item.getUUID());
        asset.setName(item.getName());
        asset.setDescription(item.getDescription());
        asset.setLastModified(item.getLastModified().getTime());
        asset.setLastContributor(item.getLastContributor());
        asset.setState((item.getState() != null) ? item.getState().getName() : "");
        asset.setDateCreated(item.getCreatedDate().getTime());
        asset.setCheckinComment(item.getCheckinComment());
        asset.setVersionNumber(item.getVersionNumber());
        asset.setFormat(item.getFormat());

        asset.setMetaData(populateMetaData(item));
        ContentHandler handler = ContentManager.getHandler(asset.getFormat());
        handler.retrieveAssetContent(asset,
                item);

        return asset;
    }
View Full Code Here

        RuleCoverageListener coverage = new RuleCoverageListener(expectedRules(bin));

        while (it.hasNext()) {
            AssetItem as = it.next();
            if (!as.getDisabled()) {
                Asset asset = repositoryAssetOperations.loadAsset(as);
                Scenario sc = (Scenario) asset.getContent();
                runScenario(packageItem.getName(),
                        sc,
                        coverage);

                int[] totals = sc.countFailuresTotal();
                resultSummaries.add(new ScenarioResultSummary(totals[0],
                        totals[1],
                        asset.getName(),
                        asset.getDescription(),
                        asset.getUuid()));
            }
        }

        ScenarioResultSummary[] summaries = resultSummaries.toArray(new ScenarioResultSummary[resultSummaries.size()]);
View Full Code Here

import org.drools.guvnor.client.rpc.Asset;
import org.drools.repository.AssetItem;

public class AssetPopulator {
    public Asset populateFrom(final AssetItem assetItem) {
        Asset ruleAsset = new Asset();
        ruleAsset.setUuid( assetItem.getUUID() );
        ruleAsset.setName( assetItem.getName() );
        ruleAsset.setDescription( assetItem.getDescription() );
        ruleAsset.setLastModified( assetItem.getLastModified().getTime() );
        ruleAsset.setLastContributor( assetItem.getLastContributor() );
        ruleAsset.setState( (assetItem.getState() != null) ? assetItem.getState().getName() : "" );
        ruleAsset.setDateCreated( assetItem.getCreatedDate().getTime() );
        ruleAsset.setCheckinComment( assetItem.getCheckinComment() );
        ruleAsset.setVersionNumber( assetItem.getVersionNumber() );
        ruleAsset.setFormat(assetItem.getFormat());
        return ruleAsset;
    }
View Full Code Here

                                     packageName,
                                     format );

        //Set the Table Format and check-in
        //TODO Is it possible to alter the content and save without checking-in?
        Asset asset = repositoryAssetService.loadRuleAsset( uuid );
        GuidedDecisionTable52 content = (GuidedDecisionTable52) asset.getContent();
        content.setTableFormat( configuration.getTableFormat() );
        asset.setCheckinComment( "Table Format automatically set to [" + configuration.getTableFormat().toString() + "]" );
        repositoryAssetService.checkinVersion( asset );

        return uuid;
    }
View Full Code Here

              projectRootPath,
                    "" );
        }
  
        try {
            Asset jcrAsset = jcrRepositoryAssetService.loadRuleAsset(jcrAssetItem.getUUID());
           
            FactModels factModels = ((FactModels) jcrAsset.getContent());
            DataModelTO dataModelTO  = new DataModelTO();
           
            String packageName = getPackageName(jcrModule);
            packageName = migrationPathManager.normalizePackageName(packageName);
            AnnotationDefinitionTO positionAnnotationDef = getPositionAnnotationDefinition();
View Full Code Here

        RuleCoverageListener coverage = new RuleCoverageListener(expectedRules(bin));

        while (it.hasNext()) {
            AssetItem as = it.next();
            if (!as.getDisabled()) {
                Asset asset = repositoryAssetOperations.loadAsset(as);
                Scenario sc = (Scenario) asset.getContent();
                runScenario(packageItem.getName(),
                        sc,
                        coverage);

                int[] totals = sc.countFailuresTotal();
                resultSummaries.add(new ScenarioResultSummary(totals[0],
                        totals[1],
                        asset.getName(),
                        asset.getDescription(),
                        asset.getUuid()));
            }
        }

        ScenarioResultSummary[] summaries = resultSummaries.toArray(new ScenarioResultSummary[resultSummaries.size()]);
View Full Code Here

        RuleCoverageListener coverage = new RuleCoverageListener(expectedRules(bin));

        while (it.hasNext()) {
            AssetItem as = it.next();
            if (!as.getDisabled()) {
                Asset asset = repositoryAssetOperations.loadAsset(as);
                Scenario sc = (Scenario) asset.getContent();
                runScenario(packageItem.getName(),
                        sc,
                        coverage);

                int[] totals = sc.countFailuresTotal();
                resultSummaries.add(new ScenarioResultSummary(totals[0],
                        totals[1],
                        asset.getName(),
                        asset.getDescription(),
                        asset.getUuid()));
            }
        }

        ScenarioResultSummary[] summaries = resultSummaries.toArray(new ScenarioResultSummary[resultSummaries.size()]);
View Full Code Here

              projectRootPath,
                    "" );
        }
  
        try {
            Asset jcrAsset = jcrRepositoryAssetService.loadRuleAsset(jcrAssetItem.getUUID());
           
            FactModels factModels = ((FactModels) jcrAsset.getContent());
            DataModelTO dataModelTO  = new DataModelTO();
           
            String packageName = getPackageName(jcrModule);
            packageName = migrationPathManager.normalizePackageName(packageName);
           
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.rpc.Asset

Copyright © 2018 www.massapicom. 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.