Class Web::LayoutSet
In: lib/web/layout_set.rb
Parent: ActiveRecord::Base

LayoutSets contain individual Layout s. They are either private or public.

Methods

Public Class methods

[Source]

    # File lib/web/layout_set.rb, line 12
12:     def initialize(params)
13:       super(params)
14:       self.logo             ||= false
15:       self.logoid           ||= 0
16:       self.pagecount        ||= 0
17:       self.themeid          ||= ''
18:       self.colorschemeid    ||= '01'
19:       self.wapthemeid       ||= 'mobile'
20:       self.wapcolorschemeid ||= '01'
21:       self.css              ||= ''
22:       self.virtualhost      ||= ''
23: 
24:       self.save
25:     end

Public Instance methods

[Source]

    # File lib/web/layout_set.rb, line 43
43:     def has_logo?
44:       self.logo
45:     end

[Source]

    # File lib/web/layout_set.rb, line 39
39:     def is_private?
40:       self.privatelayout
41:     end

[Source]

    # File lib/web/layout_set.rb, line 35
35:     def is_public?
36:       !self.privatelayout
37:     end

[Source]

    # File lib/web/layout_set.rb, line 47
47:     def layouts
48:       Web::Layout.find(:all, :conditions => "groupid=#{self.groupid} AND privatelayout=#{self.privatelayout}" )
49:     end

com.liferay.portal.model.LayoutSet

[Source]

    # File lib/web/layout_set.rb, line 8
 8:     def liferay_class
 9:       'com.liferay.portal.model.LayoutSet'
10:     end

lookup the path prefix for this LayoutSet

[Source]

    # File lib/web/layout_set.rb, line 52
52:     def url_prefix
53:       return '/web' if self.is_public?
54: 
55:       _class = Classname.model(Classname.find(self.group.classnameid).value)
56:       if _class == User
57:         return '/user' #if self.is_private?
58:         #return '/web'
59: 
60:       elsif _class == Group
61:         return '/group' #if self.is_private?
62:         #return '/web'
63: 
64:       else
65:         logger.debug 'FIXME: ' + _class
66:         return nil
67:       end
68:     end

[Validate]