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 <SOGoUI/UIxComponent.h>
25 @interface UIxAppNavView : UIxComponent
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];
48 - (void)setElement:(id)_element {
49 ASSIGN(self->element, _element);
55 - (void)setLastElement:(id)_element {
56 ASSIGN(self->lastElement, _element);
59 return self->lastElement;
64 - (NSArray *)navPathElements {
65 NSArray *traversalObjects;
66 NSMutableArray *navPathComponents;
67 unsigned int i, count;
69 traversalObjects = [[self context] objectTraversalStack];
70 count = ([traversalObjects count] - 1); /* remove SoPageInvocation */
72 navPathComponents = [[NSMutableArray alloc] initWithCapacity:count];
73 for (i = 0; i < count; i++) {
77 obj = [traversalObjects objectAtIndex:i];
79 name = [obj davDisplayName];
80 if ([name length] == 0)
81 name = NSStringFromClass([obj class]);
82 name = [self labelForKey:name];
84 if (![name hasPrefix:@"sogod"]) {
85 NSMutableDictionary *c;
88 url = [obj baseURLInContext:[self context]];
89 if (![url hasSuffix:@"/"])
90 url = [url stringByAppendingString:@"/"];
92 c = [[NSMutableDictionary alloc] initWithCapacity:2];
93 [c setObject:name forKey:@"name"];
94 [c setObject:url forKey:@"url"];
95 [navPathComponents addObject:c];
100 [self setLastElement:[navPathComponents lastObject]];
101 return [navPathComponents autorelease];
104 @end /* UIxAppNavView */