1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package tools.gsf.facade.runtag.assetset;
18
19 import COM.FutureTense.Interfaces.ICS;
20 import com.fatwire.assetapi.data.AssetId;
21 import tools.gsf.facade.runtag.AbstractTagRunner;
22 import tools.gsf.facade.runtag.listobject.AddRow;
23 import tools.gsf.facade.runtag.listobject.Create;
24 import tools.gsf.facade.runtag.listobject.ToList;
25
26 import java.util.List;
27
28
29
30
31
32
33
34
35 public final class GetMultipleValues extends AbstractTagRunner {
36 public GetMultipleValues() {
37 super("ASSETSET.GETMULTIPLEVALUES");
38 }
39
40 public void setName(String name) {
41 set("NAME", name);
42 }
43
44 public void setPrefix(String prefix) {
45 set("PREFIX", prefix);
46 }
47
48 public void setImmediateOnly(boolean b) {
49 set("IMMEDIATEONLY", b ? "true" : "false");
50 }
51
52 public void setByAsset(boolean b) {
53 set("BYASSET", b ? "true" : "false");
54 }
55
56 public void setList(String inputSortListName) {
57 set("LIST", inputSortListName);
58 }
59
60 public static void getMultipleValues(ICS ics, AssetId id, String prefix, String attrType, List<String> columns) {
61 getMultipleValues(ics, id, null, null, false, false, prefix, attrType, columns);
62 }
63
64 public static void getMultipleValues(ICS ics, AssetId id, String deptype, String locale, boolean byAsset,
65 boolean immediateOnly, String prefix, String attrType, List<String> columns) {
66
67 SetAsset setAsset = new SetAsset();
68 final String assetSetName = "__AssetSet" + ics.genID(true);
69 setAsset.setName(assetSetName);
70 setAsset.setType(id.getType());
71 setAsset.setId(Long.toString(id.getId()));
72 if (deptype != null) {
73 setAsset.setDeptype(deptype);
74 }
75 if (locale != null) {
76 setAsset.setLocale(locale);
77 }
78 setAsset.execute(ics);
79
80
81 Create createSortList = new Create();
82 final String sortListObjectName = "__SortList" + ics.genID(true);
83 createSortList.setName(sortListObjectName);
84 createSortList.setColumns("attributetypename,attributename,direction");
85 createSortList.execute(ics);
86
87
88 for (String col : columns) {
89 AddRow addRow = new AddRow();
90 addRow.setName(sortListObjectName);
91 addRow.setColumnValue("attributetypename", attrType);
92 addRow.setColumnValue("attributename", col);
93 addRow.setColumnValue("direction", "ascending");
94 addRow.execute(ics);
95 }
96
97 final String sortListIListName = "__sortListIList" + ics.genID(true);
98 ToList toList = new ToList();
99 toList.setName(sortListObjectName);
100 toList.setListVarName(sortListIListName);
101 toList.execute(ics);
102
103
104 GetMultipleValues gmv = new GetMultipleValues();
105 gmv.setName(assetSetName);
106 gmv.setByAsset(byAsset);
107 gmv.setImmediateOnly(immediateOnly);
108 gmv.setList(sortListIListName);
109 gmv.setPrefix(prefix);
110 gmv.execute(ics);
111 }
112
113 }