01: package org.drools.brms.server.contenthandler;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: import java.io.IOException;
20: import java.io.InputStreamReader;
21:
22: import org.drools.brms.client.rpc.RuleAsset;
23: import org.drools.brms.server.builder.BRMSPackageBuilder;
24: import org.drools.brms.server.builder.ContentPackageAssembler.ErrorLogger;
25: import org.drools.compiler.DroolsParserException;
26: import org.drools.repository.AssetItem;
27: import org.drools.repository.PackageItem;
28:
29: import com.google.gwt.user.client.rpc.SerializableException;
30:
31: public class RuleFlowHandler extends ContentHandler implements
32: IRuleAsset {
33:
34: public void retrieveAssetContent(RuleAsset asset, PackageItem pkg,
35: AssetItem item) throws SerializableException {
36: //do nothing, as we have an attachment
37: }
38:
39: public void storeAssetContent(RuleAsset asset, AssetItem repoAsset)
40: throws SerializableException {
41: //do nothing, as we have an attachment
42: }
43:
44: public void assembleDRL(BRMSPackageBuilder builder,
45: AssetItem asset, StringBuffer buf) {
46: //do nothing... as no change to source.
47: }
48:
49: public void compile(BRMSPackageBuilder builder, AssetItem asset,
50: ErrorLogger logger) throws DroolsParserException,
51: IOException {
52: builder.addRuleFlow(new InputStreamReader(asset
53: .getBinaryContentAttachment()));
54: }
55:
56: }
|