Package org.drools.guvnor.client.rpc

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


        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


    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

                                                initialCategory,
                                                format );

            //Set the Assets content - no need to use AssetTemplateCreator().applyPreBuiltTemplates() as we are provided a model
            //Use a transient Asset object so we can use ContentHandler to convert between model and persisted format correctly.
            Asset asset = new AssetPopulator().populateFrom( assetItem );
            ContentHandler handler = ContentManager.getHandler( assetItem.getFormat() );
            asset.setContent( content );
            handler.storeAssetContent( asset,
                                       assetItem );

            rulesRepository.save();
View Full Code Here

        AssetItem dtItem = rulesRepository.loadAssetByUUID( uuid );
        assertEquals( dtItem.getDescription(),
                      "an initial desc" );

        Asset asset = this.repositoryAssetService.loadRuleAsset( uuid );
        GuidedDecisionTable52 retrievedContent = (GuidedDecisionTable52) asset.getContent();

        assertNotNull( retrievedContent );
        assertEquals( TableFormat.LIMITED_ENTRY,
                      retrievedContent.getTableFormat() );
View Full Code Here

            //fail( "did not get expected exception" );
        } catch ( SerializationException e ) {
            //assertTrue( e.getMessage().indexOf( "'testCreateNewRuleContainsApostropheContains' character' is not a valid path. ''' not a valid name character" ) >= 0 );
        }

        Asset assetWrapper = repositoryAssetService.loadRuleAsset( uuid );
        assertEquals( assetWrapper.getDescription(),
                      "an initial desc" );
        assertEquals( assetWrapper.getName(),
                      "testCreateNewRuleContainsApostropheContains' character" );

    }
View Full Code Here

                                                                null,
                                                                "testStatus",
                                                                AssetFormats.DRL );
        serviceImplementation.createState( "testState" );

        Asset asset = repositoryAssetService.loadRuleAsset( ruleUUID );
        assertEquals( StateItem.DRAFT_STATE_NAME,
                      asset.getState() );
        repositoryAssetService.changeState( ruleUUID,
                                            "testState" );
        asset = repositoryAssetService.loadRuleAsset( ruleUUID );
        assertEquals( "testState",
                      asset.getState() );
        asset = repositoryAssetService.loadRuleAsset( ruleUUID2 );
        assertEquals( StateItem.DRAFT_STATE_NAME,
                      asset.getState() );

        serviceImplementation.createState( "testState2" );
        repositoryAssetService.changePackageState( packagUUID,
                                                   "testState2" );

        Module pkg = repositoryPackageService.loadModule( packagUUID );
        assertEquals( "testState2",
                      pkg.getState() );

        asset = repositoryAssetService.loadRuleAsset( ruleUUID2 );
        assertEquals( "testState2",
                      asset.getState() );

        repositoryAssetService.checkinVersion( asset );
        asset = repositoryAssetService.loadRuleAsset( asset.getUuid() );
        assertEquals( "testState2",
                      asset.getState() );

    }
View Full Code Here

        assertTrue( pkg.getNode().getProperty( "drools:binaryUpToDate" ).getBoolean() );
        assertTrue( pkg.isBinaryUpToDate() );
        assertFalse( RuleBaseCache.getInstance().contains( pkg.getUUID() ) );

        Asset asset = repositoryAssetService.loadRuleAsset( rule1.getUUID() );
        repositoryAssetService.checkinVersion( asset );

        assertFalse( pkg.getNode().getProperty( "drools:binaryUpToDate" ).getBoolean() );
        assertFalse( RuleBaseCache.getInstance().contains( pkg.getUUID() ) );
View Full Code Here

                                                          "",
                                                          "testGuidedDTExecuteCategory",
                                                          pkg.getName(),
                                                          AssetFormats.DECISION_TABLE_GUIDED );

        Asset ass = repositoryAssetService.loadRuleAsset( uid );
        ass.setContent( dt );
        repositoryAssetService.checkinVersion( ass );

        BuilderResult results = repositoryPackageService.buildPackage( pkg.getUUID(),
                                                                       true );
        for ( BuilderResultLine line : results.getLines() ) {
View Full Code Here

        final int PAGE_SIZE = 2;

        UserInbox ib = new UserInbox( rulesRepository );
        ib.clearAll();

        @SuppressWarnings("unused")
        Asset asset;
        String uuid;
        rulesRepository.createModule( "testLoadInboxPackage",
                                      "testLoadInboxDescription" );
        repositoryCategoryService.createCategory( "",
View Full Code Here

        UserInbox ib = new UserInbox( rulesRepository );

        ib.clearAll();

        @SuppressWarnings("unused")
        Asset asset;
        String uuid;
        rulesRepository.createModule( "testLoadInboxFullResults",
                                      "testLoadInboxDescription" );
        repositoryCategoryService.createCategory( "",
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.