An error occurred fetching the project authors.
  1. 29 Oct, 2020 1 commit
    • Jérome Perrin's avatar
      ERP5Catalog/content_translation: support translated related keys · aee8bcac
      Jérome Perrin authored
      Translated properties are indexed in content translation table,
      so nothing prevent us from using them in related keys. Since in
      many places we show to user translated titles in relations, it
      makes sense to also support searching and sorting in catalog.
      
      This extends related keys syntax only for the newest syntax, so
      related keys like `source__translated__title=X` would allow searching
      for document who have a source relation to a document with title X.
      
      Since any properties can be translated, if for example a property
      `foo` would exist and be translatable, it would be possible to search
      using `source__translated__foo=X`
      
      This is only available when content_translation business template
      is installed.
      aee8bcac
  2. 21 Apr, 2020 1 commit
    • Jérome Perrin's avatar
      CatalogTool: fix upgradeSchema with python scripts · 02a45abc
      Jérome Perrin authored
      Python scripts can be used as catalog methods, including as "clear catalog"
      methods. This was causing error when upgradeSchema was called:
      
          product/ERP5Catalog/CatalogTool.py", line 1372, in upgradeSchema
            method_list_by_connection_id[method.connection_id].append(method)
          AttributeError: connection_id
      02a45abc
  3. 17 Jun, 2019 1 commit
  4. 24 Apr, 2019 1 commit
  5. 26 Oct, 2018 1 commit
  6. 25 Oct, 2018 4 commits
    • Vincent Pelletier's avatar
    • Vincent Pelletier's avatar
      ERP5Catalog: Make user/group distinction scriptable. · d0260f5e
      Vincent Pelletier authored
      This allows breaking a circular dependency of catalog on itself: to
      index a local role, catalog must tell whether it's granted to a group or
      to a user, which used to happen using a catalog lookup (via PAS API),
      preventing catalog from being rebuilt from scratch.
      
      With this change, ERP5Site_filterUserIdSet must be implemented when
      custom role columns are used (viewable_owner is not concerned by this
      change).
      If it is implemented in a way which does not rely on catalog,
      catalog become rebuildable from a lone ZODB, without double-indexation
      of users nor security_uid explosion.
      Nothing prevents relying on catalog (which mayu be desired for
      backward-compatibility purposes), but such script will not be provided
      by generic ERP5, as the impossibility of recreating catalog from ZODB
      is considered a bug, and introducing such script amounts to introducing
      this bug.
      
      Create ERP5Site_filterUserIdList in tests which add custom viewable_*
      columns.
      d0260f5e
    • Vincent Pelletier's avatar
      ERP5Catalog: Reduce reliance on user lookup. · 4c514da5
      Vincent Pelletier authored
      Use Owner role to help filling user_set: owners must be users, never
      groups.
      Only look for users among group_ids when they are candidate for indexation
      into a catalog_role column. This should very significantly reduce the
      number of user lookups, even bringing it to zero on instance with default
      catalog setting of catalog_role_set = set(["viewable_owner"]) .
      Also, only look for users if there are candidates for lookup.
      Also, rename local variable to better describe its content.
      Also, use set.__iadd__ instead of set.update (shorter).
      4c514da5
    • Vincent Pelletier's avatar
      ERP5Catalog: Assorted simplifications. · 9542da22
      Vincent Pelletier authored
      Test loop invariant outside of loop.
      Use clearer and more consistent variable names.
      Avoid iterating twice when once is enough, allowing removal of
      "local_role_dict" local and simplification of corresponding dict
      structure.
      Avoid creating new instances when the existing one can be mutated.
      Evaluate dict as boolean instead of constructing an empty dict to compare
      against.
      Avoid using %-operator just to concatenate strings (allows en-passant
      typechecking).
      Drop unused locals.
      Do not use a dict when a set would be sufficient.
      9542da22
  7. 09 Mar, 2018 1 commit
  8. 07 Mar, 2018 1 commit
  9. 20 Nov, 2017 2 commits
    • Ayush Tiwari's avatar
      erp5_catalog: Dynamic migration of ZMI catalog to ERP5-ified catalog · 7d897440
      Ayush Tiwari authored
      And, Patch changeObjectClass extension to remove useless attributes
      
      Copying __dict__ from one object to another brings us to situation where
      we don't have many objects which we don't need at all, for example, migrating
      objects with subclasses who were initially OFS objects and later an ERP5
      object can lead to adding subobjects as attributes of the new object, which
      is completely undesirable. To handle this, it is important to delete the
      sub-objects as the attributes for those migrated classes.
      
      Old Catalog Tool didn't have portal_type attribute, so while migrating
      via synchronizeDynamicModule, after _bootstrap, we expect the tool to
      have a portal_type to finalize migration.
      
      This step is now being done only at the end of _bootstrap after we
      change the classes for portal_catalog and its sub-objects.
      7d897440
    • Ayush Tiwari's avatar
      erp5_catalog: Rename reindexObject method to use them as new methods for CatalogTool. · 1200801e
      Ayush Tiwari authored
      - This step is needed due to the use of BaseTool as Base class for CatalogTool
        due to which there were conflict between reindexObject from the Base and the one
        from the BaseTool.
      1200801e
  10. 03 Oct, 2017 1 commit
  11. 15 Sep, 2017 2 commits
  12. 13 Sep, 2017 1 commit
  13. 01 Sep, 2017 3 commits
  14. 31 Aug, 2017 1 commit
    • Vincent Pelletier's avatar
      CatalogTool: Split getCategoryParameterDict in 2 · 79119142
      Vincent Pelletier authored
      One part working on {base_category_id: [document_value_set]}, and the other
      producing that structure out of a flat list of (base_category_id-prefixed)
      category relative urls.
      The former used to be included in the latter, but in some case caller
      already has the documents handy instead of only urls, in which case we can
      avoid a layer of document lookups.
      79119142
  15. 25 Aug, 2017 1 commit
  16. 27 Jul, 2017 4 commits
  17. 28 Jun, 2017 2 commits
  18. 18 May, 2017 1 commit
  19. 14 Apr, 2017 2 commits
    • Vincent Pelletier's avatar
      {ERP5,ZSQL}Catalog: Wrap all documents at once. · 8a278cbd
      Vincent Pelletier authored
      Allows reducing the number of user existence check queries from one per
      document to one per document batch, reducing database (currently, catalog)
      latency effect on indexation time.
      Also, avoid object -> id -> object dance for SQLCatalog instance while at
      it.
      Also, modernise syntax a bit, avoiding intermediate locals mostly.
      8a278cbd
    • Vincent Pelletier's avatar
      ERP5Catalog: Do not retrieve workflow catalog variables. · b62e851e
      Vincent Pelletier authored
      These are used nowhere in the code. In many workflows, these
      "catalog-available" variables are only configured so they appear as fields on
      worklist definitions. So it is understood as more of an informative setting
      having a local effect than a normative one having an effect on how
      indexation happens.
      So shave off a bit of useless time spent in indexation.
      Also, it should be mentionned that when profiling this code causes a big
      red-herring: this code is the first place where workflow history gets
      loaded (and presumably indexed document itself), which draws attention
      away from potentially more interesting areas.
      b62e851e
  20. 05 Apr, 2017 1 commit
  21. 03 Apr, 2017 1 commit
  22. 23 Dec, 2016 1 commit
  23. 20 Dec, 2016 3 commits
  24. 12 Dec, 2016 1 commit
  25. 24 May, 2016 2 commits
    • Vincent Pelletier's avatar
      CatalogTool: Assorted readability improvements. · da29e93c
      Vincent Pelletier authored
      Fix a misnamed local.
      Use iteritems.
      Move variables next to the loop they act on.
      Rewrite comments to better reflect the intention when it is not obvious in
      the implementation.
      Move a loop-invariant out of loop ((user, role) not in optimized_role_set).
      Do not use set.update on an iterable constructed just for the call, call
      set.add on each item.
      da29e93c
    • Vincent Pelletier's avatar
      CatalogTool: Avoid computing user's roles when just testing existence. · ed0c06f9
      Vincent Pelletier authored
      Global role computation is very expensive, don't do it when all we are
      interested in is user existence.
      Also, list all users having local roles in one call to reduce the effect
      of per-call overhead.
      This should improve indexation speed by a large fraction: pprofile
      statistical run on and activity node busy reindexing objects shows:
      - 57% of time spend generating (13%) and executing (44%) SQL
      - 42% of time spent preparing object for indexation:
        - 29% in _getSecurityParameterList, all in getUserById
        - 12% in getCatalogVariablesFor (workflow variables to index)
      So an improvement of close to 30% is expected.
      ed0c06f9