Kept getting an error from gcc. Until finally I figured out to do:
sudo apt-get install libldap2-dev
And then it was able to finally compile.
I like programming in Python. I like learning about it, I like using it, and so I wish to share it.
Kept getting an error from gcc. Until finally I figured out to do:
sudo apt-get install libldap2-dev
Posted by
Abdullah Zainul Abidin
at
7:36 PM
1 comments
Labels: easy_install, openldap
Currently developing a system to manage tasks using plone as it's base. Because of that I've recently learned a lot but have not had the time to properly document all that I've learned. Here's a few snippet of what I've learned.
How to add pagination
First you should define what is the data you want to paginate and also include the require macro into your template.
<div class="eventlist"
tal:define="results options/events;
Batch python:modules['Products.CMFPlone'].Batch;
b_size python:10;
b_start python:0;
b_start request/b_start | b_start;">
<div tal:condition="results"
tal:define="batch python:Batch(results, b_size, int(b_start), orphan=1);">
<div tal:repeat="event batch">
<div metal:use-macro="here/batch_macros/macros/navigation" />
def ksnview(self):
mt = getToolByName(self, 'portal_membership')
if mt.isAnonymousUser(): # the user has not logged in
return False
else:
gt = getToolByName(self, 'portal_groups')
member = mt.getAuthenticatedMember()
ksngroup = gt.getGroupById('KSN')
if ksngroup and member.id in ksngroup.getAllGroupMemberIds():
return True
return False
catalog = getToolByName(self.context, 'portal_catalog')
event_brains = catalog.searchResults(sort_on="end",getStatus={'query':['Not Started','In Progress','Delayed'],'operator':'or'},portal_type={'query':['Event','Task'],'operator':'or'},path=path, **kw)
from Products.CMFCore.utils import getToolByName
Posted by
Abdullah Zainul Abidin
at
1:20 PM
0
comments
GenericSetup is a cool feature in Plone that can be used to create profiles for products that can be imported when the product is installed. The original reference which I used can be found here. Basically you can setup one site exactly how you want it to be with all the details on the folders structures, portlets and permissions even. And then you can export the profile of that portal so that it can be imported into any other sites you might be developing.
To export it go to the ZMI, under portal_setup->export. At the very bottom there is an "Export all" button. If that is pressed then you'll be able to download a tarball which contain all the specification needed to recreate the portal you have just made. You won't need all of them but you can use whichever one you need.
Those files would go under profiles/default directory in a common archgenxml product. I've had problems customizing portlets because the exported portlets.xml gave a 'ConstratintNotSatisfied' error. Found out from here that I needed to delete some entries in the
<property name=”name” />
<property name=”root” />
Also learnt from there how to remove portlets:
<assignment remove=”true” name=”login” category=”context” key=”/”
manager=”plone.leftcolumn” type=”portlets.Login” />
<assignment remove=”true” name=”calendar” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.Calendar” />
<assignment remove=”true” name=”events” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.Events” />
<assignment remove=”true” name=”news” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.News” />
<assignment remove=”true” name=”recent-items” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.recent” />
<assignment remove=”true” name=”review-list” category=”context” key=”/”
manager=”plone.rightcolumn” type=”portlets.review” />
Posted by
Abdullah Zainul Abidin
at
2:22 PM
0
comments
Labels: genericsetup, plone cms