View Javadoc

1   /*
2    * Copyright 2008 FatWire Corporation. All Rights Reserved.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.fatwire.gst.foundation.facade.runtag.asset;
17  
18  import java.util.List;
19  
20  import com.fatwire.assetapi.data.AssetId;
21  import com.fatwire.gst.foundation.facade.runtag.AbstractTagRunner;
22  
23  /**
24   * >ASSET.LOADALL
25        TYPE="asset type"
26        [LIST="list object name"]
27        [IDS="asset IDs"]
28        [IDFIELD="field name"]
29        PREFIX="prefix"
30        [INITCOUNT="integer"]
31        [DEPTYPE="exact|exists|none"]
32        [EDITABLE="true|false"]
33        [OPTION="editable|readonly|readonly_complete"]/<
34   *
35   * @author Tony Field
36   * @since 2011-04-07
37   */
38  public final class AssetLoadAll extends AbstractTagRunner {
39      public AssetLoadAll() {
40          super("ASSET.LOADALL");
41      }
42  
43      public void setType(String s) {
44          set("TYPE", s);
45      }
46  
47      public void setList(String s) {
48          set("LIST", s);
49      }
50  
51      public void setIds(String s) { // todo: add IList of IDs
52          set("IDS", s);
53      }
54  
55      public void setIds(List<AssetId> ids ) {
56          StringBuilder s = new StringBuilder();
57          for (AssetId id : ids) {
58              if (s.length() > 0) s.append(",");
59              s.append(Long.toString(id.getId()));
60          }
61          setIds(s.toString());
62      }
63  
64      public void setIdfield(String s) {
65          set("IDFIELD", s);
66      }
67  
68      public void setPrefix(String s) {
69          set("PREFIX", s);
70      }
71  
72      public void setInitCount(int i) {
73          set("INITCOUNT", Integer.toString(i));
74      }
75  
76      public void setDeptype(String s) {  // todo: type enum?
77          set("DEPTYPE", s);
78      }
79  
80      public void setEditable(boolean b) {
81          set("EDITABLE", Boolean.toString(b));
82      }
83  
84      public void setOption(String s) {  // todo: type enum?
85          set("OPTION", s);
86      }
87  
88  
89  }