Ifd:Overview of the difference between API 3.0 and API 2.0

(1) Introduced two persistent hash tables (note query schema is able to work only against model when the listed attribute hash tables are defined)
 * xtdRoot.UniqueID - with subtypes, unique
 * xtdName.Name - with subtypes, not unique

(2) Search by guid and names is done by the hash tables (3) Introduced hash table that keeps languages, organizations and some other frequently used stuff (speeding up conversion from instance to view_entity representation) (4) Introduced limitation (see constant SEARCH_LIMIT) for returning back search result (in opposite case all time is spent to perform conversion from entity to view_entity representation, due to heavy return structures) (5) All query functions were re-written from scratch - there were too much mistakes in original code + very ineffective way of coding. (6) To simplify tests there were introduced new query functions like (7) It was introduced several internal functions/procedures to get better performance (8) Debug and code optimization (9) Better formatting, tab removing and move constants to CONSTANT section (10) It was removed local variables initializing from the edited functionality (to prevent not handlered errors) (11) It was taken into account context for every relationships (e.g. in getParentConcepts and getChildrenConcepts) (12) Re-counted error messages (to avoid the same code and/or message for different errors) (13) Text is processed by XPXFormatter (14) Re-ordered functionality: VIEW_ENTITY, QUERY_FUNCTION, FUNCTION/PROCEDURE (15) All edited addXXX functionality were made in the same uniform schema: (16) Change in addUser functionality. (17) It was introduced sequence exception tracking and added more error codes. (18) Removed whole dead and commented code. (19) Newly created relationships and other not named concepts added with default name (see constant DEFAULT_CONCEPT_NAME) that assigned to defaiult language (see constants DEFAULT_LANGUAGE_NAME, DEFAULT_LANGUAGE_CODE) to satisfy constrans xtdRoot.Names (20) Relationship xtdRelAssignsPropertyWithValues (in addChildren, addParents, getChildrenConcepts, getParentConcepts) re-interpreted in the following way: (21) Change in signature of removeConstrainedValues now the function returns LIST OF IfdMeasureInRelationship instead single IfdMeasure (22) Fixed bug #1 in http://dev.ifd-library.org/trac/report/6 - it were added query functions:
 * get_all_children(concept_guid: STRING) - LIST OF IfdConceptInRelationship;
 * get_all_parent(concept_guid: STRING) - LIST OF IfdConceptInRelationship;
 * search_concepts(name_pattern: STRING) - LIST OF IfdConcept;
 * get_concept(guid: STRING) - trg::IfdConcept; being exposed in wsdl the functions could be used by web-services users
 * now it is possible to register existing edm user providing his/her login in IfdUser.guid, if the edm user does not exist he/she will be added with specified password, if IfdUser.guid uset or empty function works as before: generates new login and tries to add new edm user
 * RelatingObject is parent for both RelatedProperty and RelatedValues
 * RelatedProperty is parent for RelatedValues
 * RelatedValues is child for both RelatedProperty and RelatingObject
 * RelatedProperty is child for RelatingObject
 * addDescription,
 * updateComment,
 * uppdateDefinition

(23) Checked bugs #7 and #36 in http://dev.ifd-library.org/trac/report/6 - It was found that current release of the schema free of the bugs yet (24) Fixed bug #13 in http://dev.ifd-library.org/trac/report/6 - it were added query function export_EDM_users that export all found EDM users into xtdUser, see comments (25) Checked bug #18 in http://dev.ifd-library.org/trac/report/6 - It was checked the following symbols to be represented in comments and descriptions: ,./?'"[{}]`~!@#$%^&*_-+=|\ - no one coused fail (26) Fixed #34 in http://dev.ifd-library.org/trac/report/6 - It was changed behaviou of the several functions to fulfill the demand. addXXXXX, getXXXXX, removeXXXXX check if user is context owner/user only if the context is restricted (27) Remove relationships (removeChildFromConcept, removeParentFromConcept) were updated - depending of owning context(s) and childeren number it could be (28) Add relationships (addChildren and addParents) were updated - depending of owning context(s) and childeren number it could be (29) Create, add and update functionality is changed with mandatory change in (30) Query functions that adds and updates Illustarions were implemented (31) Query functions that provide user with whole concepts/relationships were added/changed after specified date/time "get_delta_of_concepts" (32) Adding timestamp xtdRoot.VersionDate in every add/edit functionality (33) New query get_delta_of_concepts and supporting view_entities are implemented (34) New query get_changes and supporting view_entities are implemented (35) All functionality is changed to mark relationship as INVALID rather to delete them in remove functions (36) addMeasure and change in IfdMeasure filling (37) addChildren, addParents, getParents, getChildren are changed in interpreting OF IfdRelationshipTypeEnum_ASSIGNS_PROPERTY_WITH_VALUES (38) getConstrainedValues is slightly changed in interpreting measure_guid. It started to be optional. The main target of the function to return values of IfdRelationshipTypeEnum_ASSIGNS_PROPERTY_WITH_VALUES that links property and concept. (39) More tolerant way to work to xtdRoot.VersionDate is provided
 * (A) just deleted (one owning context, one specified child)
 * (B) just removed from the specified context (more then owning context and one child)
 * (C) splitted (more then one owning context and children)
 * (D) no changes (no specified children in the specified context)
 * (A) creates a new relationship (in specified context the relationship do not exist yet)
 * (B) just add a specified child to existing relationship (some childer exists yet and one owning context)
 * (C) split existing relationsip (more then one owning context in existing yet)
 * (D) do nothing (the specified relationship exists yet)
 * VersionDate - to specified date time stamp in format hh:mm:ss is added
 * The time stamp is checked in update time.
 * now it is not possible to create the relationship in addChildren and addParents, only using addConstrainedValues
 * getParentConcepts returns only RelatingObject for RelatedProperty specified as concept_guid
 * getChildrenConcepts returns only RelatedProperty for RelatingObject specified as concept_guid
 * NOTE - old depricated behaviour could be run assigning TRUE for SHOW_CONSTRAINED_VALUES in constants section
 * In case of unset measure_guid returned IfdMeasure is just a folder for the returned values.
 * In case of legal measure_guid returned values are constrained with the specified measure

(40) Added a query reset_timestamps to set VersionDate with specified timestamp (41) Fixed problem with usage of temporary hash table to keep frequently asked language and ogranization, instead xpxMapString simple global aggregates were addeed (42) Added aux_language_name_patch to cure invalid xtdLanguageRepresentation (unset Language) (43) Added aux_roots_patch to cure invalid xtdRoot-s (44) It is modified liitle bit work to current_user/current_org and made more robust check .Status and .VersionDate (having in mind it possible for them to be unset) (45) It is added search_within_one_language that is clone of searchForConcepts with small difference, The function applies search criteria only to names in the first from specified languages (making concepts' presentations in all of them) (46) check_access is added to inforse correct access to database (46) Small changes in addUser and updateUser (47) start_transaction is modified (xpxStartModelWriteTransaction instead xpxStartTransaction on the first level) (48) Fix a bug within updateUser (add user to organization without members) (49) It was added possibility to getUsers, getRoles and updateUser logining by 'superuser', even without access rights to manage users (50) It was fixed logical error in updateUser, when it was not possible to update guid (login) (51) In addContextOwners checking if contextOwners is unset (52) Reset_timestamps is added with functionality to repair bad formatted VersionDate (53) Removed check domain organization for the current user in read only functionality (54) Iin case undefined persistent hash tables search by uniqueid is done by normal FROM/WHEN (55) New query function assign_domain that assigns organization to a specified user (e.g. to path bad users with unset domain organization) (56) More check input parameters to provide better diagnostics (57) aux_roots_patch added with checking xtdContext.IsRestricted and contextOwners (58) All functions that implicitly or explicitly update xtdContext checks if the current user is context owner (59) All functions that change domain of some context (add/remove relationships) checks if the current user is target context owner (60) All functions that represent relationships checks if for the current user their context are available (not restricted) (61) * IfdContext.is_read_only = FALSE only if the current user is context owner IfdContext.is_restricted = xtdContext.IsRestricted xtdContext.IsRestricted = TRUE and current user is not context user/owner (62) For all writing functions was added xpxAbortTransaction at the very first action to close external transaction if any (63) Badly specifyed IfdOrganization (with unset name, guid and uri) are replaced with current organization (logged user organization) in all functions where an organization shall be specified: (64) All input parameters are checked now if they are unset in the very first lines of every query function (65) Change in transaction hadnling. Now the schema can run in conditions of opened external transaction as well as without it. (66) Better check for input parameters in addConcepts and updateConcepts version_id shall be empty or an integer only (exception ERROR_INTEGER in another case) (67) Fix move_relationships functionality (68) It was solved to remove base attribute from structures of input and output to do that all view_entity definition were moved to dedicated EXPRESS schema (IFD_Auxiliary, file: IFD_v3_aux.exp), converted into ENTITY definitions and base attribute replaced with true inheritance, so the following structures: IfdMeasure, IfdValue, IfdConceptInRelationship, IfdMeasureInRelationship and IfdRelationship have become subtype of IfdConcept. (69) Found and fixed bug in addChildren: usage of loop index out of the loop in definition of relation type. (70) Found and fixed bug in function count_users: attempt to use extent instance as aggregate. (71) Found and fixed bug in query function correctSpellingForName and Description: in some cases it was a call to removed instance (72) Found and fixed bug in addChildren: adding relationship ACTS_UPON could be an exception to call undefined instance (73) Added more code to check if processed concept is not owned context (74) Deep supporting functionality renaming and re-ordering in the schema, removed couple of dummy query functions (75) Added support for IfdRelationshipTypeEnum_ASSOCIATES into getChildConcepts, getParentConcepts (76) Merge in common functionality with v.2.55 + edited error texts (77) searchForDuplicatesExt is added (78) get_name/search_names are improved (79) Function collect_all_orphan_users is added, see comments (80) Change in superuser access. Now the user can have no assigned organization to call R/W functionality. It the very first actual call to functionality modifuing IFD population the user will be assigned to organization specified with NAME_DEFAULT_ORGANIZATION and URL_DEFAULT_ORGANIZATION. (81) Added constant STEP_BY_STEP_MODE which makes addConcepts, addDescriptions, addNames and updateConcepts ignoring nested level attributes according to tickets #55, #56 and #58 in Trac. (82) Added function registerUsersInDB that register in mother DB all IFD users provided in input list or just instantiated in population as xtdUser (83) get_public_context_guid is added, so when user call to addChildren, addParents, addConstrainedValuesToMeasure or addConstrainedValues input context guid could be empty (84) Fix: adding superuser to default organization were done in transaction (see p.80) (85) Fix: removePreference - internal logic was changed to prevent representation lost (86) Add: getAPIVersion function to return API version (87) Extension: Functions that can filter relationships by context guids:
 * if the current user is context owner in another case IfdContext.is_restricted = TRUE if
 * IfdName/Description/Illustration.preferred_by
 * IfdConcept.owner
 * only default name (DEFAULT_CONCEPT_NAME) is added in addConcept
 * default preference is added to all input names (current organization of the logged in user)
 * the specified relationship will be added to context named DEFAULT_CONTEXT_NAME ("Open context")
 * getChildrenConcepts,
 * getConstrainedMeasures,
 * getConstrainedValues,
 * getMeasure,
 * getMeasuresForProperty,
 * getParentConcepts

are changed in default case (empty input context_guids) - they will return relationships belonging to all contexts. But in return IfdConceptInRelationship.context_guids will be populated only with guids of accessible for logged in user contexts. (88) Extension: Functions that can add/change relationships are changed. If 'Open context' is used and logged in user is not context owner he is implicitly added to the owner list of the context. (89) Extension: addUser - all newly created users are added to 'Open context'. (90) Fix: addNamesToContext - invalid parameter names. (91) Extension: queries addUser, import_EDM_users, registerUsersInDB and funtions related to user handling (get_current_user, get_user_by_email) were aded/changed to accept EDM login extension with special symbols, like '@' and similar so email could be used for dbUserName (user guid) without any changes.
 * addChildren
 * addConstrainedValues
 * addParents
 * removeChildFromConcept
 * removeConstrainedValues
 * removeParentFromConcept
 * NOTE: the changes make query schema produce errors in older versions of EDMS