1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.fatwire.gst.foundation.taglib.install;
18
19 import java.io.IOException;
20 import java.util.ArrayList;
21 import java.util.Arrays;
22 import java.util.List;
23 import java.util.Map;
24
25 import javax.servlet.jsp.JspException;
26
27
28
29
30
31
32
33
34
35 public class Install extends InstallStatus {
36
37 private String[] components;
38
39 public void doTag() throws JspException, IOException {
40 InstallerEngine ie = new InstallerEngine(getICS(), getPageContext().getServletContext(),
41 getTargetFlexFamilies());
42 Map<GSFComponent, Boolean> bInstallStatus = ie.getInstallStatus();
43 List<String> toInstall = new ArrayList<String>();
44 List<String> todo = new ArrayList<String>();
45 todo.addAll(Arrays.asList(components));
46 for (Map.Entry<GSFComponent, Boolean> e : bInstallStatus.entrySet()) {
47 String n = e.getKey().getClass().getSimpleName();
48 if (e.getValue() == false && todo.contains(n)) {
49 toInstall.add(n);
50 }
51
52 }
53 ie.doInstall(toInstall);
54 super.doTag();
55 }
56
57
58
59
60 public String[] getComponents() {
61 return components;
62 }
63
64
65
66
67 public void setComponents(String[] components) {
68 this.components = components;
69 }
70
71 }