Changeset 129

Show
Ignore:
Timestamp:
07/20/10 03:25:54 (7 weeks ago)
Author:
admin
Message:

The latest and greatest development snapshot.

Location:
mediamosa_snapshot_2-x/sites/all/modules
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa/CHANGELOG.txt

    r128 r129  
    3939  user. 
    4040- Added extra tests for search on metadata dates. 
     41- /user/user_id will now return quota even if user_id has no quota information. 
     42  Old behavour would return invalid user Id error when no quota was available. 
     43  But then you can never get quota information when you haven't uploaded 
     44  anything yet. 
     45- Fixed maxlength on title for collection creation, was unlimited. 
     46- Max length is now shown correctly in REST calls browser. 
    4147- Fixed bug in mediamosa.profile where output of error messages was not  
    4248  complete. 
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa/core/user/mediamosa_user.inc

    r94 r129  
    300300    )->fetchField(); 
    301301 
    302     if (!$total) { 
    303       throw new mediamosa_exception_error_userman_invalid_user(array('@user_id' => $user_id)); 
    304     } 
     302    // Removed: new users that havent created anything will not be able to see 
     303    // its quota. 
     304    //if (!$total) { 
     305    //  throw new mediamosa_exception_error_userman_invalid_user(array('@user_id' => $user_id)); 
     306    //} 
    305307 
    306308    // Get the user. 
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa/maintenance/browse/mediamosa_maintenance_browse_restcalls.inc

    r94 r129  
    271271        t('Required'), 
    272272        isset($item[mediamosa_rest_call::VAR_DEFAULT_VALUE]) ? $item[mediamosa_rest_call::VAR_DEFAULT_VALUE] : '', 
    273         '-', 
     273        isset($item[mediamosa_rest_call::VAR_RANGE_END]) ? $item[mediamosa_rest_call::VAR_RANGE_END] : '-', 
    274274      ); 
    275275    } 
     
    290290        t('Optional'), 
    291291        isset($item[mediamosa_rest_call::VAR_DEFAULT_VALUE]) ? $item[mediamosa_rest_call::VAR_DEFAULT_VALUE] : '', 
    292         '-', 
     292        isset($item[mediamosa_rest_call::VAR_RANGE_END]) ? $item[mediamosa_rest_call::VAR_RANGE_END] : '-', 
    293293      ); 
    294294    } 
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa/mediamosa.inc

    r125 r129  
    8585 
    8686  // ------------------------------------------------------------------ Static Functions. 
    87     /** 
     87  /** 
    8888   * Retrieve the main response object. 
    8989   * Must overridden in any child class. 
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa/mediamosa.info

    r128 r129  
    33description = "Open source media management and distribution platform." 
    44package = "MediaMosa - Core" 
    5 version = "2.2.0.699:75eaea4a823a" 
     5version = "2.2.0.702:643ad72d7874" 
    66core = 7.x 
    77 
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa/mediamosa.version.inc

    r128 r129  
    4848  const MEDIAMOSA_VERSION_2_2_0 = '2.2.0'; 
    4949 
    50   const MEDIAMOSA_VERSION = '2.2.0.699:75eaea4a823a'; 
     50  const MEDIAMOSA_VERSION = '2.2.0.702:643ad72d7874'; 
    5151 
    5252  // Used for APPs. 
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa/modules/collection/mediamosa_collection.rest.inc

    r111 r129  
    480480          self::VAR_TYPE => mediamosa_type::TYPE_STRING, 
    481481          self::VAR_DESCRIPTION => 'The title of the new collection.', 
     482          self::VAR_RANGE_END => mediamosa_collection_db::TITLE_LENGTH, 
    482483        ), 
    483484        self::DESCRIPTION => array( 
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa/modules/user/mediamosa_user.module

    r98 r129  
    3636    mediamosa_rest_call::TITLE => 'Get a list of users.', 
    3737    mediamosa_rest_call::EXAMPLE_REQUEST => '/user?limit=10&offset=0 [GET] ', 
    38     mediamosa_rest_call::DESCRIPTION => 'With this call you get a list of all known users. User integrity is not forced in Mediamosa, but rather left to the application builder. There is however some basic knowledge of users. The /user... restcalls can be used to store basic user data. So if you create an asset whit a user, this will succeed regardless the user exists in the userlist. The main purpose for the user lists in MediaMosa is the storage of the quotum per user/group. 
     38    mediamosa_rest_call::DESCRIPTION => 'With this call you get a list of all known users. User integrity is not forced in Mediamosa, but rather left to the application builder. There is however some basic knowledge of users. The /user... restcalls can be used to store basic user data. So if you create an asset with a user, this will succeed regardless the user exists in the userlist. The main purpose for the user lists in MediaMosa is the storage of the quotum per user/group. 
    3939 
    4040This call returns all users which are created with /user/create and searches for all users who created objects (assets, mediafiles, collections). If the user has some quota information, this is added to the output.', 
  • mediamosa_snapshot_2-x/sites/all/modules/mediamosa_connector/mediamosa_connector.class.inc

    r122 r129  
    354354 
    355355  public function check_result($response, $ok = NULL, $error = NULL) { 
    356     $result_id = (int)$response->xml->header->request_result_id; 
     356    $result_id = $response ? (int)$response->xml->header->request_result_id : 0; 
    357357 
    358358    if ($result_id != self::ERRORCODE_OKAY && $result_id != self::ERRORCODE_EMPTY_RESULT) { 
     
    371371    return TRUE; 
    372372  } 
     373 
     374  /** 
     375   * Simple function to correctly convert simplexml to array. 
     376   * 
     377   * @param object $xml 
     378   */ 
     379  private static function _simplexml2array($xml) { 
     380    $xml_copy = $xml; 
     381    if (get_class($xml) == 'SimpleXMLElement') { 
     382      foreach($xml->attributes() as $key => $value) { 
     383        if ($value) { 
     384          $attributes[$key] = (string)$value; 
     385        } 
     386      } 
     387 
     388      $xml = get_object_vars($xml); 
     389    } 
     390 
     391    if (is_array($xml)) { 
     392      if (empty($xml)) { 
     393        return (string)$xml_copy; 
     394      } 
     395 
     396      $result = array(); 
     397      foreach($xml as $key => $value) { 
     398        $result[$key] = self::_simplexml2array($value); 
     399      } 
     400 
     401      return $result; 
     402    } 
     403 
     404    return (string)$xml; 
     405  } 
     406 
     407  /** 
     408   * Basicly the same as simplexml2array, with the exception that it will fix 
     409   * the problem with single and multi items where a single item will end up 
     410   * in a non-indexed array and multi items will. 
     411   * 
     412   * @param object $xml 
     413   */ 
     414  public static function responsexml2array($xml) { 
     415 
     416    // Convert to nice array. 
     417    $a_xml = self::_simplexml2array($xml); 
     418 
     419    if (!isset($a_xml['items']['item'])) { 
     420      return $a_xml; 
     421    } 
     422 
     423    // Fix the problem with 1 or 2+ items in array. 
     424    $a_tmp = isset($a_xml['items']['item'][0]) ? $a_xml['items']['item'] : array(0 => $a_xml['items']['item']); 
     425    unset($a_xml['items']); 
     426    $a_xml['items']['item'] = $a_tmp; 
     427 
     428    return $a_xml; 
     429  } 
     430 
     431  /** 
     432   * Correctly convert to array and return the items object from the mediamosa 
     433   * response as array. 
     434   * 
     435   * @param object $response 
     436   */ 
     437  public static function response2array($response) { 
     438    return self::responsexml2array($response->xml); 
     439  } 
    373440}