1 /* 2 * Copyright © [2008-2009] Novell, Inc. All Rights Reserved. 3 * 4 * USE AND REDISTRIBUTION OF THIS WORK IS SUBJECT TO THE DEVELOPER LICENSE AGREEMENT 5 * OR OTHER AGREEMENT THROUGH WHICH NOVELL, INC. MAKES THE WORK AVAILABLE. THIS WORK 6 * MAY NOT BE ADAPTED WITHOUT NOVELL'S PRIOR WRITTEN CONSENT. 7 * 8 * NOVELL PROVIDES THE WORK "AS IS," WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, 9 * INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR 10 * A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. NOVELL, THE AUTHORS OF THE WORK, AND THE 11 * OWNERS OF COPYRIGHT IN THE WORK ARE NOT LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER 12 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, 13 * OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS IN THE WORK. 14 */ 15 16 /** 17 * @fileoverview 18 * This file defines the TrustType class, which represents a trust (role + realm) 19 * @name TrustType Class 20 */ 21 22 (function() { 23 function initialize() { 24 JSDataObject(TrustType, 25 Packages.esecurity.db.object.TrustTypeFactory.getInstance(), 26 { 27 "Name": { 28 required: true 29 } 30 } 31 ); 32 } 33 34 TrustType = function(props) { 35 try { 36 if (props && props.constructor != Object && props.constructor != TrustType) { 37 throw "TrustType must be initialized with an object"; 38 } 39 if (!this.toDataObject) { 40 initialize(); 41 } 42 this.toDataObject(props); 43 } 44 catch (e) { 45 throw String(e.toString()); 46 } 47 } 48 49 TrustType.prototype.postSave = function(dobj) { 50 this.TrustTypeId = dobj.getTrustTypeId(); 51 return this.TrustTypeId; 52 } 53 54 TrustType.prototype.postFind = function(dobj) { 55 this.TrustTypeId = dobj.getTrustTypeId(); 56 return this.TrustTypeId; 57 } 58 59 TrustType.find = function(params) { 60 initialize(); 61 return TrustType.find(params); 62 } 63 64 })();