Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:27:04+00:00 2026-05-30T08:27:04+00:00

I am trying to implement a basic Zope2 content type directly without using dexterity

  • 0

I am trying to implement a basic Zope2 content type directly without using dexterity or Archetypes because I need this to be extremely lean.

from OFS.SimpleItem import SimpleItem
from Products.ZCatalog.CatalogPathAwareness import CatalogAware
from persistent.list import PersistentList

class Doculite(SimpleItem, CatalogAware):
    """ implement our class """

    meta_type = 'Doculite'

    def __init__(self, id, title="No title", desc=''):
        self.id = id
        self.title = title
        self.desc = desc
        self.tags = PersistentList()
        self.default_catalog = 'portal_catalog'

    def add_tags(self, tags):
        self.tags.extend(tags)

    def Subject(self):
        return self.tags

    def indexObject(self):
        self.reindex_object()

From an external method I am doing this:

def doit(self):
    pc = self.portal_catalog
    res1 = pc.searchResults()
    o1 = self['doc1']
    o1.add_tags(['test1', 'test2'])
    o1.reindex_object()
    res2 = pc.searchResults()
    return 'Done'

I clear the catalog and run my external method. My object does not get into the catalog. But from the indexes tab, when I browse the Subject index, I can see my content item listed with the values. Both res1 and res2 and empty.

Why is my content item not showing up inside the searchResuts() of the catalog?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:27:05+00:00Added an answer on May 30, 2026 at 8:27 am

    Plone needs every content object to provide an “allowedRolesAndUsers” index to return the object in searchResults.

    There is probably a zcml snippet that will enable this for my content type. But I was able to get things working by adding another method as follows:

    def allowedRolesAndUsers(self):
        return ['Manager', 'Authenticated', 'Anonymous']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to implement basic speech recognition in AS3. I need this
This is a very basic example of what I am trying to implement in
I'm trying to implement some basic entities using Hibernate/JPA. Initially the code was deployed
I'm trying to implement this basic example found here : under the section titled
This is probably something quite basic. I am trying to implement AdWhirl into my
I am trying to implement an IDescription Interface. Basic purpose of this interface is
I am trying to implement a basic full-text search with MySQL. I wrote this
I'm trying to implement a basic object-oriented ANSI C runtime and using Objective-C as
I'm trying to implement a basic worker pool using pthreads. The scenario is that
I'm trying to implement some basic threading in my script and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.