001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }