Class Resource
In: lib/resource.rb
Parent: ActiveRecord::Base

Methods

content   plid   portletid  

External Aliases

resourcecode -> code

Public Instance methods

finds content for primkey

[Source]

    # File lib/resource.rb, line 32
32:   def content
33:     key = self.primkey
34: 
35:     _class = Classname.model(self.code.name)
36:     if _class
37:       _class.find key
38: 
39:     else
40:       if key[/LAYOUT/]
41:         Web::PortletPreferences.find(:first, :conditions => "plid=#{self.plid} AND portletid='#{self.portletid}'" )
42:       else
43:   #         unless groups_ids.include? key
44:         STDERR.puts "fixme: #{self.code.name} (#{key})"
45:         return nil
46:   #         end
47:       end
48:     end
49:   end

[Source]

    # File lib/resource.rb, line 23
23:   def plid
24:     self.primkey[/([0-9]*)_LAYOUT_(.*)/,1]
25:   end

[Source]

    # File lib/resource.rb, line 27
27:   def portletid
28:     self.primkey[/([0-9]*)_LAYOUT_(.*)/,2]
29:   end

[Validate]