001 /** 002 * Copyright (c) 2000-present 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.model; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.util.Accessor; 020 021 /** 022 * The extended model interface for the Layout service. Represents a row in the "Layout" database table, with each column mapped to a property of this class. 023 * 024 * @author Brian Wing Shun Chan 025 * @see LayoutModel 026 * @see com.liferay.portal.model.impl.LayoutImpl 027 * @see com.liferay.portal.model.impl.LayoutModelImpl 028 * @generated 029 */ 030 @ProviderType 031 public interface Layout extends LayoutModel, PersistedModel { 032 /* 033 * NOTE FOR DEVELOPERS: 034 * 035 * Never modify this interface directly. Add methods to {@link com.liferay.portal.model.impl.LayoutImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 036 */ 037 public static final Accessor<Layout, Long> LAYOUT_ID_ACCESSOR = new Accessor<Layout, Long>() { 038 @Override 039 public Long get(Layout layout) { 040 return layout.getLayoutId(); 041 } 042 043 @Override 044 public Class<Long> getAttributeClass() { 045 return Long.class; 046 } 047 048 @Override 049 public Class<Layout> getTypeClass() { 050 return Layout.class; 051 } 052 }; 053 054 /** 055 * Returns all layouts that are direct or indirect children of the current 056 * layout. 057 * 058 * @return the layouts that are direct or indirect children of the current 059 layout 060 */ 061 public java.util.List<com.liferay.portal.model.Layout> getAllChildren(); 062 063 /** 064 * Returns the ID of the topmost parent layout (e.g. n-th parent layout) of 065 * the current layout. 066 * 067 * @return the ID of the topmost parent layout of the current layout 068 * @throws PortalException if a matching layout could not be found 069 */ 070 public long getAncestorLayoutId() 071 throws com.liferay.portal.kernel.exception.PortalException; 072 073 /** 074 * Returns the plid of the topmost parent layout (e.g. n-th parent layout) 075 * of the current layout. 076 * 077 * @return the plid of the topmost parent layout of the current layout 078 * @throws PortalException if a matching layout could not be found 079 */ 080 public long getAncestorPlid() 081 throws com.liferay.portal.kernel.exception.PortalException; 082 083 /** 084 * Returns all parent layouts of the current layout. The list is retrieved 085 * recursively with the direct parent layout listed first, and most distant 086 * parent listed last. 087 * 088 * @return the current layout's list of parent layouts 089 * @throws PortalException if a matching layout could not be found 090 */ 091 public java.util.List<com.liferay.portal.model.Layout> getAncestors() 092 throws com.liferay.portal.kernel.exception.PortalException; 093 094 /** 095 * Returns all child layouts of the current layout, independent of user 096 * access permissions. 097 * 098 * @return the list of all child layouts 099 */ 100 public java.util.List<com.liferay.portal.model.Layout> getChildren(); 101 102 /** 103 * Returns all child layouts of the current layout that the user has 104 * permission to access. 105 * 106 * @param permissionChecker the user-specific context to check permissions 107 * @return the list of all child layouts that the user has permission to 108 access 109 * @throws PortalException if a portal exception occurred 110 */ 111 public java.util.List<com.liferay.portal.model.Layout> getChildren( 112 com.liferay.portal.security.permission.PermissionChecker permissionChecker) 113 throws com.liferay.portal.kernel.exception.PortalException; 114 115 /** 116 * Returns the color scheme that is configured for the current layout, or 117 * the color scheme of the layout set that contains the current layout if no 118 * color scheme is configured. 119 * 120 * @return the color scheme that is configured for the current layout, or 121 the color scheme of the layout set that contains the current 122 layout if no color scheme is configured 123 * @throws PortalException if a portal exception occurred 124 */ 125 public com.liferay.portal.model.ColorScheme getColorScheme() 126 throws com.liferay.portal.kernel.exception.PortalException; 127 128 /** 129 * Returns the CSS text for the current layout, or for the layout set if no 130 * CSS text is configured in the current layout. 131 * 132 * <p> 133 * Layouts and layout sets can configure CSS that is applied in addition to 134 * the theme's CSS. 135 * </p> 136 * 137 * @return the CSS text for the current layout, or for the layout set if no 138 CSS text is configured in the current layout 139 * @throws PortalException if a portal exception occurred 140 */ 141 public java.lang.String getCssText() 142 throws com.liferay.portal.kernel.exception.PortalException; 143 144 public java.lang.String getDefaultThemeSetting(java.lang.String key, 145 java.lang.String device, boolean inheritLookAndFeel); 146 147 /** 148 * Returns the layout's friendly URL for the given locale. 149 * 150 * @param locale the locale that the friendly URL should be retrieved for 151 * @return the layout's friendly URL for the given locale 152 */ 153 public java.lang.String getFriendlyURL(java.util.Locale locale); 154 155 /** 156 * Returns the friendly URLs for all configured locales. 157 * 158 * @return the friendly URLs for all configured locales 159 */ 160 public java.util.Map<java.util.Locale, java.lang.String> getFriendlyURLMap(); 161 162 public java.lang.String getFriendlyURLsXML(); 163 164 /** 165 * Returns the current layout's group. 166 * 167 * <p> 168 * Group is Liferay's technical name for a site. 169 * </p> 170 * 171 * @return the current layout's group 172 * @throws PortalException if a group with the primary key could not be 173 found 174 */ 175 public com.liferay.portal.model.Group getGroup() 176 throws com.liferay.portal.kernel.exception.PortalException; 177 178 /** 179 * Returns the current layout's HTML title for the given locale, or the 180 * current layout's name for the given locale if no HTML title is 181 * configured. 182 * 183 * @param locale the locale that the HTML title should be retrieved for 184 * @return the current layout's HTML title for the given locale, or the 185 current layout's name for the given locale if no HTML title is 186 configured 187 */ 188 public java.lang.String getHTMLTitle(java.util.Locale locale); 189 190 /** 191 * Returns the current layout's HTML title for the given locale language ID, 192 * or the current layout's name if no HTML title is configured. 193 * 194 * @param localeLanguageId the locale that the HTML title should be 195 retrieved for 196 * @return the current layout's HTML title for the given locale language ID, 197 or the current layout's name if no HTML title is configured 198 */ 199 public java.lang.String getHTMLTitle(java.lang.String localeLanguageId); 200 201 /** 202 * Returns <code>true</code> if the current layout has a configured icon. 203 * 204 * @return <code>true</code> if the current layout has a configured icon; 205 <code>false</code> otherwise 206 */ 207 public boolean getIconImage(); 208 209 /** 210 * Returns the current layout's {@link LayoutSet}. 211 * 212 * @return the current layout's layout set 213 * @throws PortalException if a portal exception occurred 214 */ 215 public com.liferay.portal.model.LayoutSet getLayoutSet() 216 throws com.liferay.portal.kernel.exception.PortalException; 217 218 /** 219 * Returns the current layout's {@link LayoutType}. 220 * 221 * @return the current layout's layout type 222 */ 223 public com.liferay.portal.model.LayoutType getLayoutType(); 224 225 /** 226 * Returns the current layout's linked layout. 227 * 228 * @return the current layout's linked layout, or <code>null</code> if no 229 linked layout could be found 230 */ 231 public com.liferay.portal.model.Layout getLinkedToLayout(); 232 233 /** 234 * Returns the current layout's parent plid. 235 * 236 * @return the current layout's parent plid, or <code>0</code> if the 237 current layout is the topmost parent layout 238 * @throws PortalException if a matching layout could not be found 239 */ 240 public long getParentPlid() 241 throws com.liferay.portal.kernel.exception.PortalException; 242 243 public java.lang.String getRegularURL( 244 javax.servlet.http.HttpServletRequest request) 245 throws com.liferay.portal.kernel.exception.PortalException; 246 247 public java.lang.String getResetLayoutURL( 248 javax.servlet.http.HttpServletRequest request) 249 throws com.liferay.portal.kernel.exception.PortalException; 250 251 public java.lang.String getResetMaxStateURL( 252 javax.servlet.http.HttpServletRequest request) 253 throws com.liferay.portal.kernel.exception.PortalException; 254 255 public com.liferay.portal.model.Group getScopeGroup() 256 throws com.liferay.portal.kernel.exception.PortalException; 257 258 public java.lang.String getTarget(); 259 260 /** 261 * Returns the current layout's theme, or the layout set's theme if no 262 * layout theme is configured. 263 * 264 * @return the current layout's theme, or the layout set's theme if no 265 layout theme is configured 266 * @throws PortalException if a portal exception occurred 267 */ 268 public com.liferay.portal.model.Theme getTheme() 269 throws com.liferay.portal.kernel.exception.PortalException; 270 271 public java.lang.String getThemeSetting(java.lang.String key, 272 java.lang.String device); 273 274 public java.lang.String getThemeSetting(java.lang.String key, 275 java.lang.String device, boolean inheritLookAndFeel); 276 277 public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties(); 278 279 public java.lang.String getTypeSettingsProperty(java.lang.String key); 280 281 public java.lang.String getTypeSettingsProperty(java.lang.String key, 282 java.lang.String defaultValue); 283 284 public com.liferay.portal.model.ColorScheme getWapColorScheme() 285 throws com.liferay.portal.kernel.exception.PortalException; 286 287 public com.liferay.portal.model.Theme getWapTheme() 288 throws com.liferay.portal.kernel.exception.PortalException; 289 290 /** 291 * Returns <code>true</code> if the given layout ID matches one of the 292 * current layout's hierarchical parents. 293 * 294 * @param layoutId the layout ID to search for in the current layout's 295 parent list 296 * @return <code>true</code> if the given layout ID matches one of the 297 current layout's hierarchical parents; <code>false</code> 298 otherwise 299 * @throws PortalException if any one of the current layout's acestors could 300 not be retrieved 301 */ 302 public boolean hasAncestor(long layoutId) 303 throws com.liferay.portal.kernel.exception.PortalException; 304 305 /** 306 * Returns <code>true</code> if the current layout has child layouts. 307 * 308 * @return <code>true</code> if the current layout has child layouts, 309 <code>false</code> otherwise 310 */ 311 public boolean hasChildren(); 312 313 public boolean hasScopeGroup() 314 throws com.liferay.portal.kernel.exception.PortalException; 315 316 public boolean includeLayoutContent( 317 javax.servlet.http.HttpServletRequest request, 318 javax.servlet.http.HttpServletResponse response) 319 throws java.lang.Exception; 320 321 public boolean isChildSelected(boolean selectable, 322 com.liferay.portal.model.Layout layout) 323 throws com.liferay.portal.kernel.exception.PortalException; 324 325 /** 326 * Returns <code>true</code> if the current layout can be used as a content 327 * display page. 328 * 329 * <p> 330 * A content display page must have an Asset Publisher portlet that is 331 * configured as the default Asset Publisher for the layout. 332 * </p> 333 * 334 * @return <code>true</code> if the current layout can be used as a content 335 display page; <code>false</code> otherwise 336 */ 337 public boolean isContentDisplayPage(); 338 339 /** 340 * Returns <code>true</code> if the current layout is the first layout in 341 * its parent's hierarchical list of children layouts. 342 * 343 * @return <code>true</code> if the current layout is the first layout in 344 its parent's hierarchical list of children layouts; 345 <code>false</code> otherwise 346 */ 347 public boolean isFirstChild(); 348 349 /** 350 * Returns <code>true</code> if the current layout is the topmost parent 351 * layout. 352 * 353 * @return <code>true</code> if the current layout is the topmost parent 354 layout; <code>false</code> otherwise 355 */ 356 public boolean isFirstParent(); 357 358 public boolean isIconImage(); 359 360 /** 361 * Returns <code>true</code> if the current layout utilizes its {@link 362 * LayoutSet}'s look and feel options (e.g. theme and color scheme). 363 * 364 * @return <code>true</code> if the current layout utilizes its layout set's 365 look and feel options; <code>false</code> otherwise 366 */ 367 public boolean isInheritLookAndFeel(); 368 369 public boolean isInheritWapLookAndFeel(); 370 371 /** 372 * Returns <code>true</code> if the current layout is built from a layout 373 * template and still maintains an active connection to it. 374 * 375 * @return <code>true</code> if the current layout is built from a layout 376 template and still maintains an active connection to it; 377 <code>false</code> otherwise 378 */ 379 public boolean isLayoutPrototypeLinkActive(); 380 381 /** 382 * Returns <code>true</code> if the current layout is part of the public 383 * {@link LayoutSet}. 384 * 385 * <p> 386 * Note, the returned value reflects the layout's default access options, 387 * not its access permissions. 388 * </p> 389 * 390 * @return <code>true</code> if the current layout is part of the public 391 layout set; <code>false</code> otherwise 392 */ 393 public boolean isPublicLayout(); 394 395 /** 396 * Returns <code>true</code> if the current layout is the root layout. 397 * 398 * @return <code>true</code> if the current layout is the root layout; 399 <code>false</code> otherwise 400 */ 401 public boolean isRootLayout(); 402 403 public boolean isSelected(boolean selectable, 404 com.liferay.portal.model.Layout layout, long ancestorPlid); 405 406 /** 407 * Returns <code>true</code> if the current layout can hold embedded 408 * portlets. 409 * 410 * @return <code>true</code> if the current layout can hold embedded 411 portlets; <code>false</code> otherwise 412 */ 413 public boolean isSupportsEmbeddedPortlets(); 414 415 public boolean isTypeArticle(); 416 417 public boolean isTypeControlPanel(); 418 419 public boolean isTypeEmbedded(); 420 421 public boolean isTypeLinkToLayout(); 422 423 public boolean isTypePanel(); 424 425 public boolean isTypePortlet(); 426 427 public boolean isTypeURL(); 428 429 public boolean matches(javax.servlet.http.HttpServletRequest request, 430 java.lang.String friendlyURL); 431 432 public void setLayoutSet(com.liferay.portal.model.LayoutSet layoutSet); 433 434 public void setTypeSettingsProperties( 435 com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties); 436 }