2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OGo
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
24 #import <NGObjWeb/NGObjWeb.h>
25 #import <NGObjWeb/SoObject+SoDAV.h>
26 #import <NGObjWeb/WOContext+SoObjects.h>
27 #import <Foundation/Foundation.h>
30 @interface UIxAppNavView : WOComponent
39 @implementation UIxAppNavView
42 [self->element release];
43 [self->lastElement release];
47 - (void)setElement:(id)_element {
48 ASSIGN(self->element, _element);
55 - (void)setLastElement:(id)_element {
56 ASSIGN(self->lastElement, _element);
60 return self->lastElement;
63 - (NSArray *)navPathElements {
64 NSArray *traversalObjects;
65 NSMutableArray *navPathComponents;
66 NSMutableString *navURL;
67 unsigned int i, count;
69 traversalObjects = [[self context] objectTraversalStack];
70 count = ([traversalObjects count] - 1); /* remove SoPageInvocation */
71 navPathComponents = [[NSMutableArray alloc] initWithCapacity:count];
72 navURL = [[NSMutableString alloc] initWithString:@"/"];
74 for(i = 0; i < count; i++) {
78 obj = [traversalObjects objectAtIndex:i];
80 name = [obj davDisplayName];
82 name = NSStringFromClass([obj class]);
84 [navURL appendString:name];
85 [navURL appendString:@"/"];
87 if(! [name hasPrefix:@"ZideStore"]) {
88 NSMutableDictionary *c;
90 c = [[NSMutableDictionary alloc] initWithCapacity:2];
91 [c setObject:name forKey:@"name"];
93 [c setObject:url forKey:@"url"];
95 [navPathComponents addObject:c];
100 [self setLastElement:[navPathComponents lastObject]];
101 return [navPathComponents autorelease];