Package org.drools.guvnor.server.contenthandler

Examples of org.drools.guvnor.server.contenthandler.ContentHandler


    public static GuvnorDroolsDocsBuilder getInstance(ModuleItem packageItem) throws DroolsParserException {
        return new GuvnorDroolsDocsBuilder(packageItem);
    }

    private static String getDRL(AssetItem item) {
        ContentHandler handler = ContentManager.getHandler(item.getFormat());

        if (!handler.isRuleAsset()) {
            return null;
        }

        StringBuilder stringBuilder = new StringBuilder();
        BRMSPackageBuilder builder = new BRMSPackageBuilder();
View Full Code Here


        item.updateBinaryContentAttachmentFileName( fileName );
        item.getModule().updateBinaryUpToDate( false );
        item.checkin( "Attached file: " + fileName );

        // Special treatment for model and ruleflow attachments.
        ContentHandler handler = ContentManager.getHandler( item.getFormat() );
        if ( handler instanceof ICanHasAttachment ) {
            ((ICanHasAttachment) handler).onAttachmentAdded( item );
        }

    }
View Full Code Here

            pkg = repository.loadModuleSnapshot( packageName,
                                                  packageVersion );
        }

        AssetItem item = pkg.loadAsset( assetName );
        ContentHandler handler = ContentManager.getHandler( item.getFormat() );
        StringBuilder stringBuilder = new StringBuilder();
        if ( handler.isRuleAsset() ) {

            BRMSPackageBuilder builder = new BRMSPackageBuilder();
            builder.setDSLFiles( DSLLoader.loadDSLMappingFiles( item.getModule() ) );
            ((IRuleAsset) handler).assembleDRL( builder,
                                                item,
View Full Code Here

    }


    private AssetItem getAssetItem(Asset asset) throws SerializationException {
        AssetItem assetItem = rulesRepository.loadAssetByUUID(asset.getUuid());
        ContentHandler contentHandler = ContentManager.getHandler(asset.getFormat());
        contentHandler.storeAssetContent(asset, assetItem);
        return assetItem;
    }
View Full Code Here

        item.updateBinaryContentAttachmentFileName( fileName );
        item.getModule().updateBinaryUpToDate( false );
        item.checkin( "Attached file: " + fileName );

        // Special treatment for model and ruleflow attachments.
        ContentHandler handler = ContentManager.getHandler( item.getFormat() );
        if ( handler instanceof ICanHasAttachment ) {
            ((ICanHasAttachment) handler).onAttachmentAdded( item );
        }

    }
View Full Code Here

            pkg = repository.loadModuleSnapshot( packageName,
                                                  packageVersion );
        }

        AssetItem item = pkg.loadAsset( assetName );
        ContentHandler handler = ContentManager.getHandler( item.getFormat() );
        StringBuilder stringBuilder = new StringBuilder();
        if ( handler.isRuleAsset() ) {

            BRMSPackageBuilder builder = new BRMSPackageBuilder();
            builder.setDSLFiles( DSLLoader.loadDSLMappingFiles( item.getModule() ) );
            ((IRuleAsset) handler).assembleDRL( builder,
                                                item,
View Full Code Here

    /**
     * Builds assets that are "rule" assets (ie things that are not functions
     * etc).
     */
    protected void buildAsset(AssetItem asset) {
        ContentHandler contentHandler = ContentManager.getHandler( asset.getFormat() );

        if ( contentHandler instanceof ICompilable && !asset.getDisabled() ) {
            try {
                compile( asset,
                         (ICompilable) contentHandler );
View Full Code Here

        }
    }

    private void addRuleAsset(AssetItem asset) {
        if (!asset.isArchived() && !asset.getDisabled()) {
            ContentHandler handler = ContentManager.getHandler(asset.getFormat());
            if (handler.isRuleAsset()) {
                IRuleAsset ruleAsset = (IRuleAsset) handler;
                ruleAsset.assembleDRL(builder,
                        asset,
                        src);
            }
View Full Code Here

    private ModuleItem handlePackageItem(AssetItem item,
                                         Asset asset) throws SerializationException {
        ModuleItem packageItem = item.getModule();

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

        asset.setReadonly( asset.getMetaData().isHasSucceedingVersion() || asset.isArchived() );

        if ( packageItem.isSnapshot() ) {
View Full Code Here

        if ( item.getModule().isArchived() ) {
            throw new RulesRepositoryException( "The package [" + item.getModuleName() + "] that asset [" + item.getName() + "] belongs to is archived. You need to unarchive it first." );
        }
        log.info( "USER:" + getCurrentUserName() + " ARCHIVING asset: [" + item.getName() + "] UUID: [" + item.getUUID() + "] " );
        try {
            ContentHandler handler = getContentHandler( item );
            if ( handler instanceof ICanHasAttachment ) {
                ((ICanHasAttachment) handler).onAttachmentRemoved( item );
            }
        } catch ( IOException e ) {
            log.error( "Unable to remove asset attachment",
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.contenthandler.ContentHandler

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.