001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.http;
016    
017    import com.liferay.portal.kernel.json.JSONArray;
018    import com.liferay.portal.kernel.json.JSONFactoryUtil;
019    import com.liferay.portal.kernel.json.JSONObject;
020    import com.liferay.portal.model.LayoutSet;
021    
022    import java.util.List;
023    
024    /**
025     * @author    Brian Wing Shun Chan
026     * @generated
027     */
028    public class LayoutSetJSONSerializer {
029            public static JSONObject toJSONObject(LayoutSet model) {
030                    JSONObject jsonObj = JSONFactoryUtil.createJSONObject();
031    
032                    jsonObj.put("layoutSetId", model.getLayoutSetId());
033                    jsonObj.put("groupId", model.getGroupId());
034                    jsonObj.put("companyId", model.getCompanyId());
035                    jsonObj.put("privateLayout", model.getPrivateLayout());
036                    jsonObj.put("logo", model.getLogo());
037                    jsonObj.put("logoId", model.getLogoId());
038                    jsonObj.put("themeId", model.getThemeId());
039                    jsonObj.put("colorSchemeId", model.getColorSchemeId());
040                    jsonObj.put("wapThemeId", model.getWapThemeId());
041                    jsonObj.put("wapColorSchemeId", model.getWapColorSchemeId());
042                    jsonObj.put("css", model.getCss());
043                    jsonObj.put("pageCount", model.getPageCount());
044                    jsonObj.put("virtualHost", model.getVirtualHost());
045                    jsonObj.put("settings", model.getSettings());
046                    jsonObj.put("layoutSetPrototypeId", model.getLayoutSetPrototypeId());
047    
048                    return jsonObj;
049            }
050    
051            public static JSONArray toJSONArray(
052                    com.liferay.portal.model.LayoutSet[] models) {
053                    JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
054    
055                    for (LayoutSet model : models) {
056                            jsonArray.put(toJSONObject(model));
057                    }
058    
059                    return jsonArray;
060            }
061    
062            public static JSONArray toJSONArray(
063                    com.liferay.portal.model.LayoutSet[][] models) {
064                    JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
065    
066                    for (LayoutSet[] model : models) {
067                            jsonArray.put(toJSONArray(model));
068                    }
069    
070                    return jsonArray;
071            }
072    
073            public static JSONArray toJSONArray(
074                    List<com.liferay.portal.model.LayoutSet> models) {
075                    JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
076    
077                    for (LayoutSet model : models) {
078                            jsonArray.put(toJSONObject(model));
079                    }
080    
081                    return jsonArray;
082            }
083    }