| | 99 | def _getObjectPath(self, obj, context): |
| | 100 | """ Get the path of an object. """ |
| | 101 | |
| | 102 | root_path = context.aq_explicit.virtual_url_path() |
| | 103 | obj_path = obj.aq_explicit.virtual_url_path() |
| | 104 | |
| | 105 | if obj_path.find(root_path) != 0: |
| | 106 | return '' |
| | 107 | |
| | 108 | # Remove the path of the folder object |
| | 109 | path = obj_path.replace(root_path, '') |
| | 110 | if path and path[0] == '/': |
| | 111 | path = path[1:] |
| | 112 | |
| | 113 | if not path: |
| | 114 | return '' |
| | 115 | |
| | 116 | if hasattr(obj.aq_explicit, 'Format'): |
| | 117 | if 'text/html' == obj.Format(): |
| | 118 | path += '.html' |
| | 119 | |
| | 120 | return path |
| | 121 | |
| | 122 | |