2 Copyright (C) 2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include <NGObjWeb/WOComponent.h>
25 @interface UIxAppNavView : WOComponent
33 #include <NGObjWeb/NGObjWeb.h>
34 #include <NGObjWeb/SoObject+SoDAV.h>
35 #include <NGObjWeb/WOContext+SoObjects.h>
38 @implementation UIxAppNavView
41 [self->element release];
42 [self->lastElement release];
46 - (void)setElement:(id)_element {
47 ASSIGN(self->element, _element);
53 - (void)setLastElement:(id)_element {
54 ASSIGN(self->lastElement, _element);
57 return self->lastElement;
60 - (NSArray *)navPathElements {
61 NSArray *traversalObjects;
62 NSMutableArray *navPathComponents;
63 unsigned int i, count;
65 traversalObjects = [[self context] objectTraversalStack];
66 count = ([traversalObjects count] - 1); /* remove SoPageInvocation */
68 navPathComponents = [[NSMutableArray alloc] initWithCapacity:count];
69 for (i = 0; i < count; i++) {
73 obj = [traversalObjects objectAtIndex:i];
75 name = [obj davDisplayName];
76 if ([name length] == 0)
77 name = NSStringFromClass([obj class]);
79 if (![name hasPrefix:@"sogod"]) {
80 NSMutableDictionary *c;
83 url = [obj baseURLInContext:[self context]];
84 if(![url hasSuffix:@"/"]) {
85 url = [url stringByAppendingString:@"/"];
87 c = [[NSMutableDictionary alloc] initWithCapacity:2];
88 [c setObject:name forKey:@"name"];
89 [c setObject:url forKey:@"url"];
90 [navPathComponents addObject:c];
95 [self setLastElement:[navPathComponents lastObject]];
96 return [navPathComponents autorelease];
99 @end /* UIxAppNavView */