//********************************************************* // Function: ActionEvent() // Scope: internal // Overview: Called by the setup controller to invoke a specific // action for the script to respond to. // Refer to the documentation for a list of actions and // their associated parameters. // Params: ActionID - ID of the action to perform // strData1 - Action parameter 1 // strData2 - Action parameter 2 // Returns: One of the following: // KFX_REL_SUCCESS, KFX_REL_ERROR, KFX_REL_STOPPED // Called By: Called once by the Release Setup Controller to perform //********************************************************** public KfxReturnValue ActionEvent(AscentRelease.KfxActionValue oActionID, string strData1, string strData2) { try { switch (oActionID) { case KfxActionValue.KFX_REL_BATCHCLASS_RENAME: { break; } case KfxActionValue.KFX_REL_BATCHFIELD_DELETE: { break; } case KfxActionValue.KFX_REL_BATCHFIELD_INSERT: { break; } case KfxActionValue.KFX_REL_BATCHFIELD_RENAME: { break; } case KfxActionValue.KFX_REL_DOCCLASS_RENAME: { break; } case KfxActionValue.KFX_REL_END: { //Last action event fired. Handle showing UI if necessary. if (showUI) RunUI(); break; } case KfxActionValue.KFX_REL_IMPORT: { RunUI(); break; } case KfxActionValue.KFX_REL_INDEXFIELD_DELETE: { showUI = ReleaseUtils.OnIndexFieldDelete(strData1, releaseSetUpData); break; } case KfxActionValue.KFX_REL_INDEXFIELD_INSERT: { showUI = true; break; } case KfxActionValue.KFX_REL_INDEXFIELD_RENAME: { ReleaseUtils.OnIndexFieldRename(strData1, strData2, releaseSetUpData); break; } case KfxActionValue.KFX_REL_PUBLISH_CHECK: { break; } case KfxActionValue.KFX_REL_RELEASESETUP_DELETE: { break; } case KfxActionValue.KFX_REL_START: { break; } case KfxActionValue.KFX_REL_UNDEFINED_ACTION: { break; } case KfxActionValue.KFX_REL_UPGRADE: { return AscentRelease.KfxReturnValue.KFX_REL_UNSUPPORTED; } default: { break; } } return AscentRelease.KfxReturnValue.KFX_REL_SUCCESS; } catch(Exception e) { return AscentRelease.KfxReturnValue.KFX_REL_ERROR; } }
/* SQL_UNKNOWN_TYPE 0 (Unknown data type) SQL_CHAR 1 A fixed-length character string SQL_NUMERIC 2 A floating-point value (double precision) SQL_DECIMAL 3 A floating-point value (greater than double precision) SQL_INTEGER 4 A long integer. SQL_SMALLINT 5 A short integer. SQL_FLOAT 6 A floating-point value (double precision) SQL_REAL 7 A floating-point value (single precision) SQL_DOUBLE 8 A floating-point value (double precision) SQL_DATETIME 9 A date. SQL_VARCHAR 12 Variable-length character string. */ internal static bool equalsType(AscentRelease.KfxIndexFieldType kfxtype, String alfrescoType) { switch (kfxtype) { case AscentRelease.KfxIndexFieldType.SQL_UNKNOWN_TYPE: break; case AscentRelease.KfxIndexFieldType.SQL_CHAR: if (alfrescoType.EndsWith("text")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_NUMERIC: if (alfrescoType.EndsWith("float")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_DECIMAL: if (alfrescoType.EndsWith("float")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_INTEGER: if (alfrescoType.EndsWith("int")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_SMALLINT: if (alfrescoType.EndsWith("float")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_FLOAT: if (alfrescoType.EndsWith("float")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_REAL: if (alfrescoType.EndsWith("float")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_DOUBLE: if (alfrescoType.EndsWith("double")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_DATETIME: if (alfrescoType.EndsWith("date") || alfrescoType.EndsWith("datetime")) { return true; } break; case AscentRelease.KfxIndexFieldType.SQL_VARCHAR: if (alfrescoType.EndsWith("text")) { return true; } break; } return false; }
internal static String getLinkValue(AscentRelease.Values arValues, String linkName) { try { foreach (AscentRelease.Value value in arValues) { if (value.Destination.Equals(linkName)) { return value.Value; } } // no need to check for null as the get_item throws exception if not found return null; } catch (Exception e) { // if the link does not exist just return null return null; } }
internal static String getLinkDestination(AscentRelease.Links arLinks, String linkName) { try { foreach ( AscentRelease.Link link in arLinks ) { if (link.Source.Equals(linkName)) { return link.Destination; } } // no need to check for null as the get_item throws exception if not found return null; } catch (Exception e) { // if the link does not exist just return null return null; } }
internal static AscentRelease.Link getLink(AscentRelease.Links arLinks, String linkName) { try { object oLinkToGet = (object)linkName; return arLinks.get_Item(ref oLinkToGet); } catch (Exception e) { // if the link does not exist just return null return null; } }
//********************************************************* // Function: getCustomProperty() // Scope: internal // Overview: This is a static function that returns the // value for a specific custom property whose // name is passed in to search for. // Params: properties- The custom properties to write to. // name- Name of the CustomProperty to retreive. // Returns: string- The CustomProperty value. internal static String getCustomProperty(AscentRelease.CustomProperties properties, String name) { try { object oPropToGet = (object)name; AscentRelease.CustomProperty oProperty = properties.get_Item(ref oPropToGet); // no need to check for null as the get_item throws exception if not found return oProperty.Value; } catch (Exception e) { // if the link does not exist just return null return null; } }