1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 /*** |
|
19 * @author - Symbian Ltd 2005 |
|
20 * |
|
21 * This file is a plugin file which takes XML and XSL input files and |
|
22 * requests the DocumentLoaderFactory class to create a data model out of it |
|
23 * |
|
24 */ |
|
25 |
|
26 import com.symbian.et.viewer.loader.*; |
|
27 import java.io.File; |
|
28 |
|
29 public class TefDocumentLoader implements LoaderFactory |
|
30 { |
|
31 //Constructor |
|
32 public TefDocumentLoader() |
|
33 { |
|
34 } |
|
35 //To call the transformation function with the specified xml and xsl file |
|
36 public void loadDocument() throws PluginLoaderException |
|
37 { |
|
38 DocumentLoaderFactory lFactory = DocumentLoaderFactory.getInstance(); |
|
39 lFactory.transform(fXml, fXsl); |
|
40 lFactory.setModel(); |
|
41 |
|
42 } |
|
43 |
|
44 //Set the editable to false |
|
45 public boolean isEditable() |
|
46 { |
|
47 return false; |
|
48 } |
|
49 |
|
50 //Set the filterable to true |
|
51 public boolean isFilterable() |
|
52 { |
|
53 return true; |
|
54 } |
|
55 |
|
56 //Set the sortable to true |
|
57 public boolean isSortable() |
|
58 { |
|
59 return true; |
|
60 } |
|
61 |
|
62 //Assign xml file to fxml |
|
63 public void setXmlFile(String aFile) |
|
64 { |
|
65 fXml = new File(aFile); |
|
66 } |
|
67 |
|
68 //Assign xsl file to fxsl |
|
69 public void setXslFile(String aFile) |
|
70 { |
|
71 fXsl = new File(aFile); |
|
72 } |
|
73 |
|
74 |
|
75 public String getPluginComment() |
|
76 { |
|
77 return "TEF report plugin for general purpose viewer"; |
|
78 } |
|
79 |
|
80 private File fXml; |
|
81 private File fXsl; |
|
82 } |
|