1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.http;
16  
17  import com.liferay.portal.kernel.json.JSONArray;
18  import com.liferay.portal.kernel.json.JSONFactoryUtil;
19  import com.liferay.portal.kernel.json.JSONObject;
20  import com.liferay.portal.model.LayoutSet;
21  
22  import java.util.List;
23  
24  /**
25   * <a href="LayoutSetJSONSerializer.java.html"><b><i>View Source</i></b></a>
26   *
27   * <p>
28   * ServiceBuilder generated this class. Modifications in this class will be
29   * overwritten the next time is generated.
30   * </p>
31   *
32   * <p>
33   * This class is used by {@link LayoutSetServiceJSON} to translate objects.
34   * </p>
35   *
36   * @author    Brian Wing Shun Chan
37   * @see       com.liferay.portal.service.http.LayoutSetServiceJSON
38   * @generated
39   */
40  public class LayoutSetJSONSerializer {
41      public static JSONObject toJSONObject(LayoutSet model) {
42          JSONObject jsonObj = JSONFactoryUtil.createJSONObject();
43  
44          jsonObj.put("layoutSetId", model.getLayoutSetId());
45          jsonObj.put("groupId", model.getGroupId());
46          jsonObj.put("companyId", model.getCompanyId());
47          jsonObj.put("privateLayout", model.getPrivateLayout());
48          jsonObj.put("logo", model.getLogo());
49          jsonObj.put("logoId", model.getLogoId());
50          jsonObj.put("themeId", model.getThemeId());
51          jsonObj.put("colorSchemeId", model.getColorSchemeId());
52          jsonObj.put("wapThemeId", model.getWapThemeId());
53          jsonObj.put("wapColorSchemeId", model.getWapColorSchemeId());
54          jsonObj.put("css", model.getCss());
55          jsonObj.put("pageCount", model.getPageCount());
56          jsonObj.put("virtualHost", model.getVirtualHost());
57  
58          return jsonObj;
59      }
60  
61      public static JSONArray toJSONArray(
62          com.liferay.portal.model.LayoutSet[] models) {
63          JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
64  
65          for (LayoutSet model : models) {
66              jsonArray.put(toJSONObject(model));
67          }
68  
69          return jsonArray;
70      }
71  
72      public static JSONArray toJSONArray(
73          com.liferay.portal.model.LayoutSet[][] models) {
74          JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
75  
76          for (LayoutSet[] model : models) {
77              jsonArray.put(toJSONArray(model));
78          }
79  
80          return jsonArray;
81      }
82  
83      public static JSONArray toJSONArray(
84          List<com.liferay.portal.model.LayoutSet> models) {
85          JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
86  
87          for (LayoutSet model : models) {
88              jsonArray.put(toJSONObject(model));
89          }
90  
91          return jsonArray;
92      }
93  }