Class: UuDevman::Product
- Inherits:
-
Object
- Object
- UuDevman::Product
- Defined in:
- lib/uu_devman/product_create.rb
Overview
Module Product
Class Method Summary (collapse)
-
+ (UU::OS::UESURI) create(products_folder_uri, opts = {})
Create new folder structure and product overview for new product.
Class Method Details
+ (UU::OS::UESURI) create(products_folder_uri, opts = {})
Create new folder structure and product overview for new product.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/uu_devman/product_create.rb', line 14 def create(products_folder_uri, opts = {}) raise UuDevman::ValidationException, "Parameter products_folder_uri must be a valid UU::OS::UESURI or its String representation." unless uesuri?(products_folder_uri) raise UuDevman::ValidationException, "Invalid :code parameter.\nProduct code must be set and match regex [A-Z0-9_\\.]+." if opts[:code].nil? || !opts[:code].match(/^[A-Z0-9_\.]+$/) raise UuDevman::ValidationException, "Parameter :competent role must be nil, valid UU::OS::UESURI or its String representation." unless opts[:competent_role_uri].nil? || uesuri?(opts[:competent_role_uri]) raise UuDevman::ValidationException, "Parameter :product_name must be set." if opts[:name].nil? session = UU::OS::Security::Session.current_session @cmd = UU::OS::CMD::CommandClient.new("uu-devman", session, nil) # create project structure product_folder = @cmd.invoke("ProductOverview/create", products_folder_uri, parameters: {:products_folder => products_folder_uri, :product_code => opts[:code], :product_name => opts[:name], :competent_role => opts[:competent_role_uri]}) product_folder = UU::OS::UESURI.new(product_folder) # parse product overview, product modules folder and product releases codes from product folder uri according to conventions overview = parse_uri product_folder, "/OVERVIEW" modules_folder = parse_uri product_folder, "/MODULES" releases_folder = parse_uri product_folder, "/RELEASES" # update Product Overview main page @cmd.invoke("ProductOverview/update_product_overview", overview, parameters: {:main_entity_uri => overview, :modules => modules_folder, :releases => releases_folder}) # update issues on Product Overview @cmd.invoke("ProductOverview/update_issues", overview, parameters: {:main_entity_uri => overview, :modules => modules_folder, :firstrun => true}) # update unassigned construction task @cmd.invoke("ProductOverview/updateUnassignedCts", overview, parameters: {}) product_folder end |