Class: PortfolioSiteObject
- Inherits:
-
Object
- Object
- PortfolioSiteObject
- Includes:
- DataFactory, DateFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-cle/data_objects/portfolio.rb
Instance Attribute Summary collapse
-
#access ⇒ Object
Returns the value of attribute access.
-
#contact_email ⇒ Object
Returns the value of attribute contact_email.
-
#creation_date ⇒ Object
Returns the value of attribute creation_date.
-
#creator ⇒ Object
Returns the value of attribute creator.
-
#default_role ⇒ Object
Returns the value of attribute default_role.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#participants ⇒ Object
Returns the value of attribute participants.
-
#short_description ⇒ Object
Returns the value of attribute short_description.
-
#site_contact_name ⇒ Object
Returns the value of attribute site_contact_name.
-
#site_email ⇒ Object
Returns the value of attribute site_email.
-
#status ⇒ Object
Returns the value of attribute status.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #add_official_participants(role, *participants) ⇒ Object
- #create ⇒ Object
- #delete ⇒ Object
- #edit(opts = {}) ⇒ Object
-
#initialize(browser, opts = {}) ⇒ PortfolioSiteObject
constructor
A new instance of PortfolioSiteObject.
- #view ⇒ Object
Methods included from Workflows
menu_link, #open_my_site_by_name, #reset
Constructor Details
#initialize(browser, opts = {}) ⇒ PortfolioSiteObject
Returns a new instance of PortfolioSiteObject.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 13 def initialize(browser, opts={}) @browser = browser defaults = { :title=>random_alphanums, :site_email=>random_nicelink(32), :participants=>{} } = defaults.merge(opts) () requires @title end |
Instance Attribute Details
#access ⇒ Object
Returns the value of attribute access.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def access @access end |
#contact_email ⇒ Object
Returns the value of attribute contact_email.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def contact_email @contact_email end |
#creation_date ⇒ Object
Returns the value of attribute creation_date.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def creation_date @creation_date end |
#creator ⇒ Object
Returns the value of attribute creator.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def creator @creator end |
#default_role ⇒ Object
Returns the value of attribute default_role.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def default_role @default_role end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def id @id end |
#participants ⇒ Object
Returns the value of attribute participants.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def participants @participants end |
#short_description ⇒ Object
Returns the value of attribute short_description.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def short_description @short_description end |
#site_contact_name ⇒ Object
Returns the value of attribute site_contact_name.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def site_contact_name @site_contact_name end |
#site_email ⇒ Object
Returns the value of attribute site_email.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def site_email @site_email end |
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def status @status end |
#title ⇒ Object
Returns the value of attribute title.
9 10 11 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 9 def title @title end |
Instance Method Details
#add_official_participants(role, *participants) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 92 def add_official_participants(role, *participants) list_of_ids=participants.join("\n") open_my_site_by_name @title site_editor on SiteEditor do |site| site.add_participants end on SiteSetupAddParticipants do |add| add.official_participants.set list_of_ids add.continue end on SiteSetupChooseRole do |choose| choose.(role).set choose.continue end on SiteSetupParticipantEmail do |send| send.continue end on SiteSetupParticipantConfirm do |confirm| confirm.finish end if @participants.has_key?(role) @participants[role].insert(-1, participants).flatten! else @participants.store(role, participants) end end |
#create ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 27 def create my_workspace site_setup on_page SiteSetup do |page| page.new end on SiteType do |page| # Select the Portfolio Site radio button page.portfolio_site.set page.continue end on PortfolioSiteInfo do |info| info.title.set @title info.description=@description unless @description==nil info.short_description.fit @short_description #TODO Add support for other fields here info.continue end on PortfolioSiteTools do |tools| # TODO Add support for individual tool selection and reuse of material from other sites tools.all_tools.set tools.continue end on PortfolioConfigureToolOptions do || .email.set @site_email # TODO Add support for other fields here .continue end on SiteAccess do |access| # TODO Support non-default selections here access.continue end on ConfirmSiteSetup do |confirm| if confirm..present? confirm.request_site else confirm.create_site end end # TODO: Add definition of @participants variable here # Create a string that will match the new Site's "creation date" string @creation_date = right_now[:sakai] on SiteSetup do |site_setup| site_setup.search(Regexp.escape(@title)) # Get the site id for storage @browser.frame(:class=>"portletMainIframe").link(:href=>/xsl-portal.site/, :index=>0).href =~ /(?<=\/site\/).+/ @id = $~.to_s end end |
#delete ⇒ Object
88 89 90 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 88 def delete end |
#edit(opts = {}) ⇒ Object
79 80 81 82 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 79 def edit opts={} (opts) end |
#view ⇒ Object
84 85 86 |
# File 'lib/sambal-cle/data_objects/portfolio.rb', line 84 def view end |