[Zope-PTK] Lots of questions from a newbie
Mike Pelletier
mike@digicool.com
Mon, 20 Mar 2000 10:55:56 -0500 (EST)
On Fri, 17 Mar 2000, Webmaster wrote:
> 1. I'm attempting to use zopePTK for our intranet. Do I need a separate
> portal for each of our 5 main sections or do I just use one portal for the
> site and have different folders for each section? Our sections include
> personnel, security, site operations, press, etc.
>
> 2. If I do have separate portals for each section how does membership work?
> If a content provider works in two of the sections will they have to join
> each portal section?
If you use seperate portal objects, your membership to each will be
distinct and seperate as well. Yes, they would have to join each
portal.
There is probably no reason you need to have distinct portals. Five
folders within a single portal would probably be sufficient, with the
correct magic spells. Depending on your requirements (security and
division of content), it may not necessarily be easier than seperate
portals.
> 3. We do some business to business work and make some of our intranet
> available to associates. Is it possible to build a conditional statement
> that will hide the "login" and "join" toolbar so ONLY people from within our
> internal IP range will see the tool bar? If it is, is there documentation
> that might help me figure it out?
Zope places CGI variables you can use in the toolbox_actions method of
your portal object to make those links conditional on the remote
address. See:
http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.5.4.html#29461
For example, the basic PTK PortalObject only offers those links if the
user has not logged in:
if username=='Anonymous User':
actions = [
{'name': 'Log in',
'url': self.absolute_url() + '/login_form',
'permissions': [],
'category': 'user'},
{'name': 'Join',
'url': self.absolute_url() + '/join_form',
'permissions': [],
'category': 'user'},
]
else:
...
You could extend it in your subclass to also check the remote IP:
if username=='Anonymous User' and \
REQUEST['REMOTE_ADDR'] in self.allowed_ips:
actions = [
...
]
elif username=='Anonymous User':
# Not logged in, someone outside our network
...
else:
# A logged in member
...
> 4. OK, I have a member named bob and he creates a news article, he publishes
> it and I approve it, now it is publicly available. What I don't get is how
> do I add the news article to the correct sections of the site. Bob's news
> article is listed on the "recent_news" page, but when I click on it the path
> shows up as "/myPortal/Members/bob/newsbrief" I want the path to be
> /myPortal/recent_news/newsbrief. Another example...bob creates an internal
> job opps document, publishes it and again it is approved. I think I
> understand how to generate a listing of documents from my personnel job opps
> page, but again the path reflects bob's members directory, and I want the
> path to reflect the personnel job opps directory. HOW?
This will take some work on your part. The DemoPortal sets itself up
so that Members own one folder, their home holder, and owners can add PTK
objects. To allow people to add items elsewhere, you will need to do two
things: Allow user to add content by setting permissions, and provide an
interface.
If you don't know how Zope permissions work, read this section of the
Content Manager's Guide:
http://www.zope.org/Documentation/Guides/ZCMG-HTML/ZCMG.5.html
Once user's have permission to add items, they will need a way to do
so other than entering URLs by hand. You can roll your own interface by
hand, or you can just provide a link to http://my_site/.../portal_contents
to provide them with the same interface that they get from 'My Stuff'.
Note that the page that presents the list of wizards isn't interested
in whether or not you have permission to add an item. It just presents
all wizards. You may want or need to improve this.
> 5. Can the iTrack product be used in conjunction with the PTK? I would like
> to add some project work flow and collaboration to one of my portal
> sections.
I'm sorry, I know nothing about iTrack... Perhaps the iTrack author
knows something about the PTK.
That being said, there's no reason PTK members shouldn't be able to
use an iTrack. It's contents simply won't be searchable by the PTK, etc.
Mike.
--
Mike Pelletier email: mike@digicool.com
Mild mannered software developer icq: 7127228
by day, super villain by night. phone: 519-884-2434