Package org.drools.guvnor.server.contenthandler

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


    }

    //The Asset is being effectively deleted from the source package so treat as though the Content is being deleted
    private void attachmentRemoved(AssetItem item) {
        ICanHasAttachment attachmentHandler = null;
        ContentHandler contentHandler = ContentManager.getHandler( item.getFormat() );
        if ( contentHandler instanceof ICanHasAttachment ) {
            attachmentHandler = (ICanHasAttachment) contentHandler;
            try {
                attachmentHandler.onAttachmentRemoved( item );
            } catch ( IOException ioe ) {
View Full Code Here


    }

    //The Asset is being effectively added to the target package so treat as though the Content is being added
    private void attachmentAdded(AssetItem item) {
        ICanHasAttachment attachmentHandler = null;
        ContentHandler contentHandler = ContentManager.getHandler( item.getFormat() );
        if ( contentHandler instanceof ICanHasAttachment ) {
            attachmentHandler = (ICanHasAttachment) contentHandler;
            try {
                attachmentHandler.onAttachmentAdded( item );
            } catch ( IOException ioe ) {
View Full Code Here

                newName);
    }

    protected BuilderResult validateAsset(Asset asset) {
        try {
            ContentHandler handler = ContentManager
                    .getHandler(asset.getFormat());
            AssetItem item = rulesRepository.loadAssetByUUID(asset.getUuid());

            handler.storeAssetContent(asset,
                    item);

            AssetItemValidator assetItemValidator = new AssetItemValidator(handler,
                    item);
            return assetItemValidator.validate();
View Full Code Here

        repoAsset.updateDateExpired(dateToCalendar(meta.getDateExpired()));

        repoAsset.updateCategoryList(meta.getCategories());
        repoAsset.updateDescription(asset.getDescription());

        ContentHandler handler = ContentManager.getHandler(repoAsset.getFormat());
        handler.storeAssetContent(asset,
                repoAsset);

        if (!asset.getFormat().equals(AssetFormats.TEST_SCENARIO) || asset.getFormat().equals(AssetFormats.ENUMERATION)) {
            ModuleItem pkg = repoAsset.getModule();
            pkg.updateBinaryUpToDate(false);
View Full Code Here

                numRows);
    }

    // TODO: Very hard to unit test -> needs refactoring
    protected String buildAssetSource(Asset asset) throws SerializationException {
        ContentHandler handler = ContentManager.getHandler(asset.getFormat());

        StringBuilder stringBuilder = new StringBuilder();
        if (handler.isRuleAsset()) {
            BRMSPackageBuilder builder = new BRMSPackageBuilder();
            // now we load up the DSL files
            ModuleItem moduleItem = rulesRepository.loadModule(asset.getMetaData().getModuleName());
            builder.setDSLFiles(DSLLoader.loadDSLMappingFiles(moduleItem));
            if (asset.getMetaData().isBinary()) {
                AssetItem item = rulesRepository.loadAssetByUUID(
                        asset.getUuid());

                handler.storeAssetContent(asset,
                        item);
                ((IRuleAsset) handler).assembleDRL(builder,
                        item,
                        stringBuilder);
            } else {
View Full Code Here

        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

        final AssetItemIterator assetIterator = newModule.listAssetsByFormat( new String[]{AssetFormats.RULE_FLOW_RF, AssetFormats.BPMN_PROCESS, AssetFormats.BPMN2_PROCESS} );

        while ( assetIterator.hasNext() ) {
            final AssetItem asset = assetIterator.next();
            final String assetFormat = asset.getFormat();
            final ContentHandler contentHandler = ContentManager.getHandler( assetFormat );
            if ( contentHandler instanceof ICanHasAttachment ) {
                ICanHasAttachment attachmentHandler = (ICanHasAttachment) contentHandler;
                try {
                    attachmentHandler.onAttachmentAdded( asset );
                } catch ( IOException ioe ) {
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 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

    /**
     * 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

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.