Package org.drools.guvnor.client.rpc

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


    }

    @Override
    public void storeAssetContent(Asset asset, AssetItem repoAsset)
            throws SerializationException {
        RuleContentText text = (RuleContentText) asset.getContent();

        try {
            InputStream input = new ByteArrayInputStream(
                    text.content.getBytes("UTF-8"));
            repoAsset.updateBinaryContentAttachment(input);
View Full Code Here


        //Create new assets for Functions
        for ( int iCounter = 0; iCounter < functions.size(); iCounter++ ) {

            //Model should be text-based (as Guvnor does not support all DRL features)
            RuleContentText content = new RuleContentText();
            content.content = functions.get( iCounter );

            final String assetName = makeNewAssetName( "Function " + (iCounter + 1) );
            final String packageName = item.getModule().getName();
            final String packageUUID = item.getModule().getUUID();
View Full Code Here

        //Create new assets for Declared Types
        for ( int iCounter = 0; iCounter < declaredTypes.size(); iCounter++ ) {

            //Model should be text-based (as Guvnor does not support all DRL features)
            RuleContentText content = new RuleContentText();
            content.content = declaredTypes.get( iCounter );

            final String assetName = makeNewAssetName( "Declarative Model " + (iCounter + 1) );
            final String packageName = item.getModule().getName();
            final String packageUUID = item.getModule().getUUID();
View Full Code Here

public class ChangeSetContentHandler extends PlainTextContentHandler implements IHasCustomValidator {
    public void retrieveAssetContent(Asset asset, ModuleItem pkg, AssetItem item)
            throws SerializationException {
        if (item.getContent() != null) {
            RuleContentText text = new RuleContentText();
            text.content = item.getContent();
            asset.setContent( text );
        }
    }
View Full Code Here

    }

    public void storeAssetContent(Asset asset,
                                  AssetItem repoAsset) throws SerializationException {

        RuleContentText text = (RuleContentText) asset.getContent();

        try {
            InputStream input = new ByteArrayInputStream( text.content.getBytes( "UTF-8" ) );
            repoAsset.updateBinaryContentAttachment( input );
        } catch ( UnsupportedEncodingException e ) {
View Full Code Here

        this(asset);
    }

    public DSLRuleEditor(Asset asset) {

        RuleContentText cont = (RuleContentText) asset.getContent();

        this.data = cont;
        text = new TextArea();
        text.setWidth("100%");
        text.setVisibleLines(16);
View Full Code Here

            FactModels ms = new FactModels();
            ms.models = models;
            asset.setContent( ms );
        } catch ( DroolsParserException e ) {
            log.error( "Unable to parse the DRL for the model - falling back to text (" + e.getMessage() + ")" );
            RuleContentText text = new RuleContentText();
            text.content = item.getContent();
            asset.setContent( text );
        }

    }
View Full Code Here

                                                      throws SerializationException {
        if ( asset.getContent() instanceof FactModels ) {
            FactModels fm = (FactModels) asset.getContent();
            repoAsset.updateContent( toDRL( fm.models ) );
        } else {
            RuleContentText text = (RuleContentText) asset.getContent();
            repoAsset.updateContent( text.content );
        }

    }
View Full Code Here

        //Add individual assets to definitions list
        List<String> definitions = new ArrayList<String>();
        for ( AssetPageRow row : assetWorkDefinitions.getPageRowList() ) {
            Asset asset = repositoryAssetService.loadRuleAsset( row.getUuid() );
            RuleContentText content = (RuleContentText) asset.getContent();
            definitions.add( content.content );
        }

        return definitions;
    }
View Full Code Here

public class ChangeSetContentHandler extends PlainTextContentHandler implements IHasCustomValidator {
    public void retrieveAssetContent(Asset asset, ModuleItem pkg, AssetItem item)
            throws SerializationException {
        if (item.getContent() != null) {
            RuleContentText text = new RuleContentText();
            text.content = item.getContent();
            asset.setContent( text );
        }
    }
View Full Code Here

TOP

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

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.