@doc hierarchy="GMLDOM">
(c) SAP AG 2003-2006. All rights reserved.
Class ModelNode inherit dev:TNode;
override property size = 0;
property isModel = true;
property isAddToSourceControl = false;
property isCheckedOut = false;
property checkedOutByOtherUser = ''; //The name of the other user that checked out this model. '' is none.
property isSynced = false;
property isCheckedOutInAnotherServer = false;
property isCheckedOutFromEclipse = false;
property modelType = '';
property modelClass = null;
property packagePrefix = '';
property isBlackService = false;
property normalized = true;
property searchProvider = '';
property searchSystem = '';
//virtual runtime property isLocal = false; [NOTE: isLocal is runtime virtual property that his value set @ setIcon()] *DO NOT REMOVE THIS LINE*
constructor(modelProps)
this.supercall(modelProps.urn, modelProps.name, modelProps.hint, modelProps.size, modelProps.mode, modelProps.check, modelProps.icon, modelProps.gmlObjectType);
this.initialize(modelProps);
end
method initialize(modelProps)
if(modelProps==null) return; //should print error message
this.size = 0;
this.modelType = modelProps.gmlObjectType;
this.modelClass = CLASS(this.modelType);
// Update data members only if values exsist in property bag
if ('name' in modelProps) this.setName(modelProps.name);
if ('isAddToSourceControl' in modelProps) this.isAddToSourceControl = BOOL(modelProps.isAddToSourceControl);
if ('isCheckedOut' in modelProps) this.isCheckedOut = BOOL(modelProps.isCheckedOut);
if ('checkedOutByOtherUser' in modelProps) this.checkedOutByOtherUser = modelProps.checkedOutByOtherUser;
if ('isSynced' in modelProps) this.isSynced = BOOL(modelProps.isSynced);
if ('isCheckedOutInAnotherServer' in modelProps) this.isCheckedOutInAnotherServer = BOOL(modelProps.isCheckedOutInAnotherServer);
if ('isCheckedOutFromEclipse' in modelProps) this.isCheckedOutFromEclipse = BOOL(modelProps.isCheckedOutFromEclipse);
if ('gmlObjectType' in modelProps) this.isBlackService = (modelProps.gmlObjectType == "core.gml2:BlackService");
if ('normalized' in modelProps) this.normalized = BOOL(modelProps.normalized);
if ('searchProvider' in modelProps) this.searchProvider = modelProps.searchProvider;
if ('searchSystem' in modelProps) this.searchSystem = modelProps.searchSystem;
if (ISA(this.modelClass, 'core.gml2:GlobalEnumeration')) this.isGlobalEnum = true;
this.packagePrefix = modelProps.packagePrefix;
this.setIcon();
end
override method setIcon()
var isLocal = false;
var rNode = getRepositoryNode(this);
var state = null;
if (rNode){
isLocal = BOOL(rNode.isLocal);
}
this.isLocal = isLocal;
this.icon = this.modelType ? RULE('defineIcons', this.modelClass, this.normalized+'') :'#URL[env~skin:icons.model.gif]';
if (isLocal) {
this.icon2 = '#URL[dev~skin:blank.gif]';
} else if (this.isAddToSourceControl) {
this.icon2 = '#URL[env~skin:icons.added_to_DTR_model_state.gif]';
state = "#TEXT[XTOL_LOCAL_ADDED_TO_SC]";
} else {// is source control
if (this.isCheckedOut){
this.icon2 = '#URL[env~skin:icons.checked_out_model_state.gif]';
state = "#TEXT[XTOL_CHECKED_OUT_BY_YOU]";
} else if ("" != this.checkedOutByOtherUser) {
this.icon2 = '#URL[env~skin:icons.checked_out_by_another_user_model_state.gif]';
state = "" != this.checkedOutByOtherUser ? '#TEXT[XTOL_CHECKED_OUT_BY_USER]'.replace('{0}', this.checkedOutByOtherUser) : '#TEXT[XTOL_CHECKED_OUT_UNKNOWN_USER]';
} else if(this.isCheckedOutInAnotherServer){
this.icon2 = '#URL[env~skin:icons.checked_out_by_me_in_another_state.gif]';
state = this.isCheckedOutFromEclipse ? '#TEXT[XTOL_CHKOUT_BYYOU_ECLIPSE]' : '#TEXT[XTOL_CHKOUT_BYYOU_OTHR_SRV]';
} else if (this.isSynced){
this.icon2 = '#URL[env~skin:icons.sync_model_state.gif]';
state = "#TEXT[XTOL_SYNCED]";
} else {
this.icon2 = '#URL[env~skin:icons.unsync_model_state.gif]';
state = "#TEXT[XTOL_NOT_SYNCED]";
}
}
// Setting hint
this.hint = "#TEXT[XFLD_MMP_TYPE]: " + this.getDisplayTypeStr(this.gmlType) + (state ? ("\n#TEXT[XFLD_MMP_STATUS]: " + state) : '')
if (ISA(this.modelClass, 'gml2:BlackBox'))
this.hint += '\n#TEXT[XTOL_MMP_DATA_STRUCTURE]: ' + (this.normalized ? '#TEXT[XTOL_MMP_DATA_STRCTR_NORM]' : '#TEXT[XTOL_MMP_DATA_STRCTR_NOTNORM]');
end
override method getDescription()
var state = '';
var developmentComponent = this.parentnode;
var softwarwComponent = developmentComponent.parentnode;
var repository = softwarwComponent.parentnode;
var isBlkService = this.isBlackService;
var isGlobalEnum = this.isGlobalEnum;
if (this.isLocal) {
state = isBlkService ? '#TEXT[XMSG_SERVICE_IS_LOCAL]' : (isGlobalEnum ? '#TEXT[XMSG_ENUM_IS_LOCAL]':'#TEXT[XMSG_MODEL_IS_LOCAL]');
} else if (this.isCheckedOut) {
state = isBlkService ? '#TEXT[XMSG_SERVICE_CHECKEDOUT_BY_YOU]' : (isGlobalEnum ? '#TEXT[XMSG_ENUM_CHECKEDOUT_BY_YOU]' : '#TEXT[XMSG_MODEL_CHECKEDOUT_BY_YOU]');
} else if (this.checkedOutByOtherUser) {
state = isBlkService ? '#TEXT[XMSG_SERVICE_CHECKEDOUT_BYUSER]' : (isGlobalEnum ? '#TEXT[XMSG_ENUM_CHECKEDOUT_BYUSER]' : '#TEXT[XMSG_MODEL_CHECKEDOUT_BYUSER]');
if(''!=this.checkedOutByOtherUser){
state = state.replace('{1}', this.checkedOutByOtherUser);
} else {
state = 'TEXT[XTOL_CHECKED_OUT_UNKNOWN_USER]';
}
} else if (this.isCheckedOutInAnotherServer){
if(this.isCheckedOutFromEclipse){
state= isBlkService ? '#TEXT[XMSG_SERVICE_CHCKOUT_BYYOU_ON_ECLIPSE]' : (isGlobalEnum ? '#TEXT[XMSG_ENUM_CHCKOUT_BYYOU_ON_ECLIPSE]' : '#TEXT[XMSG_MODEL_CHCKOUT_BYYOU_ON_ECLIPSE]');
} else {
state= isBlkService ? '#TEXT[XMSG_SERVICE_CHCKOUT_OTHER_SERVER]' : (isGlobalEnum ? '#TEXT[XMSG_ENUM_CHCKOUT_OTHER_SERVER]' : '#TEXT[XMSG_MODEL_CHCKOUT_OTHER_SERVER]');
}
} else if (this.isAddToSourceControl) {
state = isBlkService ? '#TEXT[XMSG_SERVICE_ADD_TO_DTR]' : (isGlobalEnum ? '#TEXT[XMSG_ENUM_ADD_TO_DTR]' : '#TEXT[XMSG_MODEL_ADD_TO_DTR]');
} else if (this.isSynced) {
state = isBlkService ? '#TEXT[XMSG_SERVICE_IS_SYNCHED]' : (isGlobalEnum ? '#TEXT[XMSG_ENUM_IS_SYNCHED]' : '#TEXT[XMSG_MODEL_IS_SYNCHED]');
} else {
state = isBlkService ? '#TEXT[XMSG_SERVICE_IS_NOT_SYNCHED]' : (isGlobalEnum ? '#TEXT[XMSG_ENUM_IS_NOT_SYNCHED]' : '#TEXT[XMSG_MODEL_IS_NOT_SYNCHED]');
}
state = state.replace('{0}',this.name ||'');
var desc = ('#TEXT[XFLD_MMP_TYPE]: ' + this.getDisplayTypeStr(this.modelType) + '
' +
'#TEXT[XFLD_MMP_STATUS]: ' + state);
if (ISA(this.modelClass, 'gml2:BlackBox')) {
desc += '
#TEXT[XTOL_MMP_DATA_STRUCTURE]: ' + (this.normalized ? '#TEXT[XTOL_MMP_DATA_STRCTR_NORM]' : '#TEXT[XTOL_MMP_DATA_STRCTR_NOTNORM]');
var localSearchProvider = '';
var searchProvidersList = $ENV.getProvidersList();
if (!ISNULL(searchProvidersList)) {
localSearchProvider = searchProvidersList[this.searchProvider];
}
if (!ISNULL(localSearchProvider))
desc += '
#TEXT[XFLD_SEARCH_PROVIDER]: ' + localSearchProvider;
desc += '
#TEXT[XFLD_SYSTEM_DETSINATIONS]: ' + this.searchSystem;
}
return desc;
end
override method getChildren(channel, scope)
throw new Error("Method not implemented");
end
override method initOneChild(res)
throw new Error("Method not implemented");
end
override method getNodeSupportedOperations()
var developmentComponent = this.parentnode;
var softwarwComponent = developmentComponent.parentnode;
var repository = softwarwComponent.parentnode;
return {isLocal:this.isLocal,
isAddToSourceControl:this.isAddToSourceControl,
isCheckedOut:this.isCheckedOut,
checkedOutByOtherUser:this.checkedOutByOtherUser,
isSynced:this.isSynced,
isCheckedOutInAnotherServer:this.isCheckedOutInAnotherServer};
end
method is_checkedOut()
return this.isCheckedOut;
end
method canBeDeletedFromWorkSpace()
return !this.isCheckedOut && !this.isAddToSourceControl;
end
method is_Synced()
return this.isSynced;
end
override method canBeRenamed()
return (this.isLocal || this.is_checkedOut());
end