Package org.drools.guvnor.client.rpc

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


    }

    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


        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

    }

    @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

        this(asset);
    }

    public DSLRuleEditor(RuleAsset asset) {

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

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

public class SpringContextContentHandler extends PlainTextContentHandler implements IHasCustomValidator {
    public void retrieveAssetContent(RuleAsset asset, PackageItem 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(RuleAsset 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

public abstract class PlainTextContentHandler extends ContentHandler {

    public void retrieveAssetContent(RuleAsset asset,
                                     AssetItem item) throws SerializationException {
        //default to text, goode olde texte, just like mum used to make.
        RuleContentText text = new RuleContentText();
        text.content = item.getContent();
        asset.setContent( text );

    }
View Full Code Here

                                                            "workItem1description",
                                                            "testLoadingWorkDefinitionsFromPackageAssetsCategory",
                                                            "testLoadingWorkDefinitionsFromPackageAssets",
                                                            "wid" );
        Asset asset1 = repositoryAssetService.loadRuleAsset( uuid1 );
        RuleContentText content1 = new RuleContentText();
        content1.content = ""
                           + "import org.drools.process.core.datatype.impl.type.StringDataType;\n"
                           + "[\n"
                           + "[\n"
                           + "\"name\" : \"MyTask1\",\n"
                           + "\"parameters\" : [\n"
                           + "\"StringParam\" : new StringDataType()\n"
                           + "],\n"
                           + "\"results\" : [\n"
                           + "\"StringResult\" : new StringDataType()\n"
                           + "],\n"
                           + "\"displayName\" : \"My Task1\","
                           + "\"icon\" : \"\",\n"
                           + "]\n"
                           + "]";

        asset1.setContent( content1 );
        repositoryAssetService.checkinVersion( asset1 );

        //Create #2 Work Item definition
        String uuid2 = serviceImplementation.createNewRule( "workItem2",
                                                            "workItem2description",
                                                            "testLoadingWorkDefinitionsFromPackageAssetsCategory",
                                                            "testLoadingWorkDefinitionsFromPackageAssets",
                                                            "wid" );
        Asset asset2 = repositoryAssetService.loadRuleAsset( uuid2 );
        RuleContentText content2 = new RuleContentText();
        content2.content = ""
                           + "import org.drools.process.core.datatype.impl.type.IntegerDataType;\n"
                           + "[\n"
                           + "[\n"
                           + "\"name\" : \"MyTask2\",\n"
                           + "\"parameters\" : [\n"
                           + "\"IntegerParam\" : new IntegerDataType()\n"
                           + "],\n"
                           + "\"results\" : [\n"
                           + "\"IntegerResult\" : new IntegerDataType()\n"
                           + "],\n"
                           + "\"displayName\" : \"My Task2\","
                           + "\"icon\" : \"\",\n"
                           + "]\n"
                           + "]";

        asset2.setContent( content2 );
        repositoryAssetService.checkinVersion( asset2 );

        //Create #3 Work Item definition
        String uuid3 = serviceImplementation.createNewRule( "workItem3",
                                                            "workItem3description",
                                                            "testLoadingWorkDefinitionsFromPackageAssetsCategory",
                                                            "testLoadingWorkDefinitionsFromPackageAssets",
                                                            "wid" );
        Asset asset3 = repositoryAssetService.loadRuleAsset( uuid3 );
        RuleContentText content3 = new RuleContentText();
        content3.content = ""
                           + "import org.drools.process.core.datatype.impl.type.ObjectDataType;\n"
                           + "[\n"
                           + "[\n"
                           + "\"name\" : \"MyTask3\",\n"
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.