01: package org.enhydra.shark.xpdl;
02:
03: import java.util.Collection;
04: import java.util.List;
05: import java.util.Locale;
06: import java.util.Map;
07:
08: import org.enhydra.shark.xpdl.elements.Package;
09:
10: /**
11: * Class which purpose is to provide methods which are
12: * used by classes that represents program apstraction of
13: * XML elements. These methods offers support for reading or
14: * writting an XML document.
15: *
16: * @author Sasa Bojanic
17: */
18: public interface XMLInterface {
19:
20: void setValidation(boolean isActive);
21:
22: public void clearParserErrorMessages();
23:
24: public boolean isPackageOpened(String pkgId);
25:
26: public Package getPackageById(String pkgId);
27:
28: public Package getPackageByIdAndVersion(String pkgId, String version);
29:
30: public Package getPackageByFilename(String filename);
31:
32: public Package getExternalPackageByRelativeFilePath(
33: String relativePathToExtPkg, Package rootPkg);
34:
35: public String getAbsoluteFilePath(Package pkg);
36:
37: public Collection getAllPackages();
38:
39: public Collection getAllPackageIds();
40:
41: public Collection getAllPackageVersions(String pkgId);
42:
43: public Collection getAllPackageFilenames();
44:
45: public boolean doesPackageFileExists(String xmlFile);
46:
47: public String getParentDirectory(Package pkg);
48:
49: public Package openPackage(String pkgReference,
50: boolean handleExternalPackages);
51:
52: public Package openPackagesFromStreams(List pkgContents,
53: boolean isFileStream) throws Exception;
54:
55: public Package openPackageFromStream(byte[] pkgContent,
56: boolean isFileStream) throws Exception;
57:
58: public Package parseDocument(String toParse, boolean isFile);
59:
60: /**
61: * This method should be called immediatelly after opening a document,
62: * otherwise, messages could be invalid.
63: * @return The map which keys are opened packages, and values are the sets
64: * of errors for corresponding package.
65: */
66: public Map getParsingErrorMessages();
67:
68: public List closePackages(String pkgId);
69:
70: public Package closePackageVersion(String pkgId, String version);
71:
72: public void closeAllPackages();
73:
74: public void synchronizePackages(XMLInterface xmlInterface);
75:
76: public void setLocale(Locale locale);
77: }
|