1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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          jsonObj.put("layoutSetPrototypeId", model.getLayoutSetPrototypeId());
58  
59          return jsonObj;
60      }
61  
62      public static JSONArray toJSONArray(
63          com.liferay.portal.model.LayoutSet[] models) {
64          JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
65  
66          for (LayoutSet model : models) {
67              jsonArray.put(toJSONObject(model));
68          }
69  
70          return jsonArray;
71      }
72  
73      public static JSONArray toJSONArray(
74          com.liferay.portal.model.LayoutSet[][] models) {
75          JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
76  
77          for (LayoutSet[] model : models) {
78              jsonArray.put(toJSONArray(model));
79          }
80  
81          return jsonArray;
82      }
83  
84      public static JSONArray toJSONArray(
85          List<com.liferay.portal.model.LayoutSet> models) {
86          JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
87  
88          for (LayoutSet model : models) {
89              jsonArray.put(toJSONObject(model));
90          }
91  
92          return jsonArray;
93      }
94  }