From 712822f2a9baa48dc669df305165ae0a87fbdc57 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 25 Sep 2008 19:43:23 +0200 Subject: Fixed bug 3456 --- cpp/src/IceGrid/LocatorI.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/IceGrid/LocatorI.cpp b/cpp/src/IceGrid/LocatorI.cpp index 554a170c22d..18d9808df34 100644 --- a/cpp/src/IceGrid/LocatorI.cpp +++ b/cpp/src/IceGrid/LocatorI.cpp @@ -236,12 +236,15 @@ LocatorI::Request::activate(const string& id) // NOTE: we use a timeout large enough to ensure that the activate() call won't // timeout if the server hangs in deactivation and/or activation. // - for(LocatorAdapterInfoSeq::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p) { - if(p->id == id) + Lock sync(*this); + for(LocatorAdapterInfoSeq::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p) { - _locator->activate(*p, this); - _activating.insert(id); + if(p->id == id) + { + _locator->activate(*p, this); + _activating.insert(id); + } } } -- cgit v1.2.3 From 02bafd89a09d3de39b1c6ed301cd36bf73c8589d Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 25 Sep 2008 19:44:41 +0200 Subject: Fixed bug 3457 --- cpp/src/Ice/OutgoingAsync.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 14da19924e7..788cb2cb373 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -174,7 +174,7 @@ IceInternal::OutgoingAsyncMessageCallback::__warning(const std::exception& exc) { if(__os) // Don't print anything if release() was already called. { - __warning(__os->instance()); + __warning(__os->instance(), exc); } } @@ -187,7 +187,7 @@ IceInternal::OutgoingAsyncMessageCallback::__warning(const InstancePtr& instance const Exception* ex = dynamic_cast(&exc); if(ex) { - out << "Ice::Exception raised by AMI callback:\n" << ex; + out << "Ice::Exception raised by AMI callback:\n" << *ex; } else { @@ -434,7 +434,7 @@ IceInternal::OutgoingAsync::__finished(const Ice::LocalException& exc) } void -IceInternal::OutgoingAsync::__finished(const LocalExceptionWrapper& ex) +IceInternal::OutgoingAsync::__finished(const LocalExceptionWrapper& exc) { assert(__os && !_sent); @@ -446,7 +446,7 @@ IceInternal::OutgoingAsync::__finished(const LocalExceptionWrapper& ex) try { - handleException(ex); // This will throw if the invocation can't be retried. + handleException(exc); // This will throw if the invocation can't be retried. } catch(const Ice::LocalException& ex) { -- cgit v1.2.3 From 93a4343980b792422c09ce0a8b9a13360ffeb211 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 25 Sep 2008 19:48:12 +0200 Subject: Fixed potential IceGrid node hang on shutdown --- cpp/src/IceGrid/ServerAdapterI.cpp | 15 ++++++++++++++- cpp/src/IceGrid/ServerI.cpp | 30 ++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 5 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/IceGrid/ServerAdapterI.cpp b/cpp/src/IceGrid/ServerAdapterI.cpp index ba904bdf199..08ae0d9a441 100644 --- a/cpp/src/IceGrid/ServerAdapterI.cpp +++ b/cpp/src/IceGrid/ServerAdapterI.cpp @@ -96,6 +96,12 @@ ServerAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Cur destroy(); activationFailed("server destroyed"); } + catch(const Ice::Exception& ex) + { + ostringstream os; + os << "unexpected exception: " << ex; + activationFailed(os.str()); + } } Ice::ObjectPrx @@ -188,7 +194,14 @@ ServerAdapterI::setDirectProxy(const Ice::ObjectPrx& prx, const Ice::Current&) void ServerAdapterI::destroy() { - _node->getAdapter()->remove(_this->ice_getIdentity()); + try + { + _node->getAdapter()->remove(_this->ice_getIdentity()); + } + catch(const Ice::LocalException&) + { + // Ignore. + } } void diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index c033ff18817..9879fc99ca7 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -357,7 +357,14 @@ void TimedServerCommand::startTimer() { _timerTask = new CommandTimeoutTimerTask(this); - _timer->schedule(_timerTask, IceUtil::Time::seconds(_timeout)); + try + { + _timer->schedule(_timerTask, IceUtil::Time::seconds(_timeout)); + } + catch(const IceUtil::Exception&) + { + // Ignore, timer is destroyed because node is shutting down. + } } void @@ -2514,7 +2521,14 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason) if(_activation == Always) { _timerTask = new DelayedStart(this, _node->getTraceLevels()); - _node->getTimer()->schedule(_timerTask, IceUtil::Time::milliSeconds(500)); + try + { + _node->getTimer()->schedule(_timerTask, IceUtil::Time::milliSeconds(500)); + } + catch(const IceUtil::Exception&) + { + // Ignore, timer is destroyed because node is shutting down. + } } else if(_activation == Disabled && _disableOnFailure > 0 && _failureTime != IceUtil::Time()) { @@ -2526,8 +2540,16 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason) // callback is executed. // _timerTask = new DelayedStart(this, _node->getTraceLevels()); - _node->getTimer()->schedule(_timerTask, - IceUtil::Time::seconds(_disableOnFailure) + IceUtil::Time::milliSeconds(500)); + try + { + _node->getTimer()->schedule(_timerTask, + IceUtil::Time::seconds(_disableOnFailure) + + IceUtil::Time::milliSeconds(500)); + } + catch(const IceUtil::Exception&) + { + // Ignore, timer is destroyed because node is shutting down. + } } } -- cgit v1.2.3 From b19987ad1a324152a279cfe845bd4309e8adbad5 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Fri, 26 Sep 2008 07:00:14 +0200 Subject: Fixed locator potential hang when resolving round-robin replica group which could occur if the replica group was removed and added again --- cpp/src/IceGrid/LocatorI.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cpp/src') diff --git a/cpp/src/IceGrid/LocatorI.cpp b/cpp/src/IceGrid/LocatorI.cpp index 18d9808df34..3fbe3a146f1 100644 --- a/cpp/src/IceGrid/LocatorI.cpp +++ b/cpp/src/IceGrid/LocatorI.cpp @@ -687,7 +687,14 @@ LocatorI::removePendingResolve(const string& adapterId, int roundRobinCount) // if(roundRobinCount > 0) { - _database->getAdapter(adapterId)->increaseRoundRobinCount(roundRobinCount); + try + { + _database->getAdapter(adapterId)->increaseRoundRobinCount(roundRobinCount); + } + catch(const Ice::Exception&) + { + // Ignore. + } } map >::iterator p = _resolves.find(adapterId); -- cgit v1.2.3 From a3c9dfeead519e87ba197e5e66b1013f39fa4366 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Fri, 26 Sep 2008 14:04:54 +0200 Subject: IceGrid fixes to ensure the registry/node don't wait too long if a replica becomes unreachable --- cpp/src/IceGrid/Allocatable.cpp | 9 +- cpp/src/IceGrid/NodeCache.cpp | 5 +- cpp/src/IceGrid/NodeCache.h | 1 - cpp/src/IceGrid/NodeI.cpp | 212 ++++++++++++++++++++++++++++----- cpp/src/IceGrid/NodeI.h | 24 ++++ cpp/src/IceGrid/NodeSessionManager.cpp | 2 +- cpp/src/IceGrid/SessionManager.h | 14 ++- cpp/test/IceGrid/replication/run.py | 2 +- scripts/IceGridAdmin.py | 2 +- slice/IceGrid/Observer.ice | 6 +- 10 files changed, 236 insertions(+), 41 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/IceGrid/Allocatable.cpp b/cpp/src/IceGrid/Allocatable.cpp index e078564d5a5..666d7c84cb7 100644 --- a/cpp/src/IceGrid/Allocatable.cpp +++ b/cpp/src/IceGrid/Allocatable.cpp @@ -38,7 +38,14 @@ AllocationRequest::pending() if(_timeout > 0) { - _session->getTimer()->schedule(this, IceUtil::Time::milliSeconds(_timeout)); + try + { + _session->getTimer()->schedule(this, IceUtil::Time::milliSeconds(_timeout)); + } + catch(const IceUtil::Exception&) + { + // Ignore, timer is destroyed because of shutdown + } } _state = Pending; return true; diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index 812cb1977df..b9b8b478243 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -781,7 +781,10 @@ NodeEntry::checkSession() const while(_registering) { - wait(); + if(!timedWait(IceUtil::Time::seconds(5))) + { + break; // Consider the node down if it doesn't respond promptly. + } } if(!_session) diff --git a/cpp/src/IceGrid/NodeCache.h b/cpp/src/IceGrid/NodeCache.h index f47ede772e3..2fb6fa9ee13 100644 --- a/cpp/src/IceGrid/NodeCache.h +++ b/cpp/src/IceGrid/NodeCache.h @@ -45,7 +45,6 @@ public: void addServer(const ServerEntryPtr&); void removeServer(const ServerEntryPtr&); void setSession(const NodeSessionIPtr&); - void setSavedProxy(const NodePrx&); NodePrx getProxy() const; InternalNodeInfoPtr getInfo() const; diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index 4328a4aef85..b721c553271 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -188,6 +188,137 @@ private: string _dest; }; +class NodeUp : public NodeI::Update, public AMI_NodeObserver_nodeUp +{ +public: + + NodeUp(const NodeIPtr& node, const NodeObserverPrx& observer, NodeDynamicInfo info) : + Update(node, observer), _info(info) + { + } + + virtual void + send() + { + try + { + _observer->nodeUp_async(this, _info); + } + catch(const Ice::LocalException&) + { + finished(false); + } + } + + virtual void + ice_response() + { + finished(true); + } + + virtual void + ice_exception(const Ice::Exception&) + { + finished(false); + } + +private: + + NodeDynamicInfo _info; +}; + +class UpdateServer : public NodeI::Update, public AMI_NodeObserver_updateServer +{ +public: + + UpdateServer(const NodeIPtr& node, const NodeObserverPrx& observer, ServerDynamicInfo info) : + NodeI::Update(node, observer), _info(info) + { + } + + virtual void + send() + { + try + { + _observer->updateServer_async(this, _node->getName(), _info); + } + catch(const Ice::LocalException&) + { + finished(false); + } + } + + virtual void + ice_response() + { + finished(true); + } + + virtual void + ice_exception(const Ice::Exception&) + { + finished(false); + } + +private: + + ServerDynamicInfo _info; +}; + +class UpdateAdapter : public NodeI::Update, public AMI_NodeObserver_updateAdapter +{ +public: + + UpdateAdapter(const NodeIPtr& node, const NodeObserverPrx& observer, AdapterDynamicInfo info) : + NodeI::Update(node, observer), _info(info) + { + } + + virtual void + send() + { + try + { + _observer->updateAdapter_async(this, _node->getName(), _info); + } + catch(const Ice::LocalException&) + { + finished(false); + } + } + + virtual void + ice_response() + { + finished(true); + } + + virtual void + ice_exception(const Ice::Exception&) + { + finished(false); + } + +private: + + AdapterDynamicInfo _info; +}; + +} + +NodeI::Update::Update(const NodeIPtr& node, const NodeObserverPrx& observer) : _node(node), _observer(observer) +{ +} + +NodeI::Update::~Update() +{ +} + +void +NodeI::Update::finished(bool success) +{ + _node->dequeueUpdate(_observer, this, !success); } NodeI::NodeI(const Ice::ObjectAdapterPtr& adapter, @@ -847,6 +978,8 @@ NodeI::addObserver(const NodeSessionPrx& session, const NodeObserverPrx& observe assert(_observers.find(session) == _observers.end()); _observers.insert(make_pair(session, observer)); + _observerUpdates.erase(observer); // Remove any updates from the previous session. + ServerDynamicInfoSeq serverInfos; AdapterDynamicInfoSeq adapterInfos; for(map::const_iterator p = _serversDynamicInfo.begin(); @@ -863,19 +996,11 @@ NodeI::addObserver(const NodeSessionPrx& session, const NodeObserverPrx& observe adapterInfos.push_back(q->second); } - try - { - NodeDynamicInfo info; - info.info = _platform.getNodeInfo(); - info.servers = serverInfos; - info.adapters = adapterInfos; - observer->nodeUp(info); - } - catch(const Ice::LocalException& ex) - { - Ice::Warning out(_traceLevels->logger); - out << "unexpected observer exception:\n" << ex; - } + NodeDynamicInfo info; + info.info = _platform.getNodeInfo(); + info.servers = serverInfos; + info.adapters = adapterInfos; + queueUpdate(observer, new NodeUp(this, observer, info)); } void @@ -910,15 +1035,7 @@ NodeI::observerUpdateServer(const ServerDynamicInfo& info) { if(sent.find(p->second) == sent.end()) { - try - { - p->second->updateServer(_name, info); - sent.insert(p->second); - } - catch(const Ice::LocalException&) - { - // IGNORE - } + queueUpdate(p->second, new UpdateServer(this, p->second, info)); } } } @@ -948,18 +1065,53 @@ NodeI::observerUpdateAdapter(const AdapterDynamicInfo& info) { if(sent.find(p->second) == sent.end()) { - try - { - p->second->updateAdapter(_name, info); - } - catch(const Ice::LocalException&) - { - // IGNORE - } + queueUpdate(p->second, new UpdateAdapter(this, p->second, info)); } } } +void +NodeI::queueUpdate(const NodeObserverPrx& proxy, const UpdatePtr& update) +{ + //Lock sync(*this); Called within the synchronization + deque& queue = _observerUpdates[proxy]; + queue.push_back(update); + if(queue.size() == 1) + { + queue.front()->send(); + } +} + +void +NodeI::dequeueUpdate(const NodeObserverPrx& proxy, const UpdatePtr& update, bool all) +{ + IceUtil::Mutex::Lock sync(_observerMutex); + map >::iterator p = _observerUpdates.find(proxy); + if(p == _observerUpdates.end() || p->second.front().get() != update.get()) + { + return; + } + + deque& queue = p->second; + if(all) + { + queue.clear(); + } + else + { + queue.pop_front(); + } + + if(!queue.empty()) + { + queue.front()->send(); + } + else + { + _observerUpdates.erase(p); + } +} + void NodeI::addServer(const ServerIPtr& server, const string& application) { diff --git a/cpp/src/IceGrid/NodeI.h b/cpp/src/IceGrid/NodeI.h index 36ac0019c0e..6ecb9df70a8 100644 --- a/cpp/src/IceGrid/NodeI.h +++ b/cpp/src/IceGrid/NodeI.h @@ -35,9 +35,29 @@ typedef IceUtil::Handle ServerCommandPtr; class NodeSessionManager; +class NodeI; +typedef IceUtil::Handle NodeIPtr; + class NodeI : public Node, public IceUtil::Monitor { public: + class Update : virtual public IceUtil::Shared + { + public: + + Update(const NodeIPtr&, const NodeObserverPrx&); + virtual ~Update(); + + virtual void send() = 0; + + void finished(bool); + + protected: + + const NodeIPtr _node; + const NodeObserverPrx _observer; + }; + typedef IceUtil::Handle UpdatePtr; NodeI(const Ice::ObjectAdapterPtr&, NodeSessionManager&, const ActivatorPtr&, const IceUtil::TimerPtr&, const TraceLevelsPtr&, const NodePrx&, const std::string&, const UserAccountMapperPrx&); @@ -97,6 +117,8 @@ public: void removeObserver(const NodeSessionPrx&); void observerUpdateServer(const ServerDynamicInfo&); void observerUpdateAdapter(const AdapterDynamicInfo&); + void queueUpdate(const NodeObserverPrx&, const UpdatePtr&); + void dequeueUpdate(const NodeObserverPrx&, const UpdatePtr&, bool); void addServer(const ServerIPtr&, const std::string&); void removeServer(const ServerIPtr&, const std::string&); @@ -143,6 +165,8 @@ private: std::map _serversDynamicInfo; std::map _adaptersDynamicInfo; + std::map > _observerUpdates; + IceUtil::Mutex _serversLock; std::map > _serversByApplication; std::set _patchInProgress; diff --git a/cpp/src/IceGrid/NodeSessionManager.cpp b/cpp/src/IceGrid/NodeSessionManager.cpp index 06ae7828d3f..066b144b0a9 100644 --- a/cpp/src/IceGrid/NodeSessionManager.cpp +++ b/cpp/src/IceGrid/NodeSessionManager.cpp @@ -581,7 +581,7 @@ NodeSessionManager::createdSession(const NodeSessionPrx& session) // for(vector::const_iterator p = sessions.begin(); p != sessions.end(); ++p) { - (*p)->tryCreateSession(true); + (*p)->tryCreateSession(true, IceUtil::Time::seconds(5)); } } diff --git a/cpp/src/IceGrid/SessionManager.h b/cpp/src/IceGrid/SessionManager.h index 7760241e865..c598eadc2cd 100644 --- a/cpp/src/IceGrid/SessionManager.h +++ b/cpp/src/IceGrid/SessionManager.h @@ -189,7 +189,7 @@ public: } virtual void - tryCreateSession(bool waitForTry = true) + tryCreateSession(bool waitForTry = true, const IceUtil::Time& timeout = IceUtil::Time()) { { Lock sync(*this); @@ -215,7 +215,17 @@ public: // Wait until the action is executed and the state changes. while(_nextAction == Connect || _nextAction == KeepAlive || _state == InProgress) { - wait(); + if(timeout == IceUtil::Time()) + { + wait(); + } + else + { + if(!timedWait(timeout)) + { + break; + } + } } } } diff --git a/cpp/test/IceGrid/replication/run.py b/cpp/test/IceGrid/replication/run.py index 1311d8675ff..5a13ccef323 100755 --- a/cpp/test/IceGrid/replication/run.py +++ b/cpp/test/IceGrid/replication/run.py @@ -23,4 +23,4 @@ from scripts import * TestUtil.addLdPath(os.getcwd()) IceGridAdmin.iceGridTest("application.xml", '--IceDir="%s" --TestDir="%s"' % (TestUtil.toplevel, os.getcwd()), - ' \'properties-override=\'%s\'' % TestUtil.getCommandLine("", TestUtil.DriverConfig("server")).replace("--", "")) + '\\"properties-override=%s\\"' % TestUtil.getCommandLine("", TestUtil.DriverConfig("server")).replace("--", "")) diff --git a/scripts/IceGridAdmin.py b/scripts/IceGridAdmin.py index f69f0b082e6..fd3e7f64dc0 100644 --- a/scripts/IceGridAdmin.py +++ b/scripts/IceGridAdmin.py @@ -209,7 +209,7 @@ def iceGridTest(application, additionalOptions = "", applicationOptions = ""): if application != "": print "adding application...", - iceGridAdmin('application add ' + os.path.join(testdir, application) + ' ' + \ + iceGridAdmin('application add -n ' + os.path.join(testdir, application) + ' ' + \ '"test.dir=' + testdir + '" "ice.bindir=' + TestUtil.getCppBinDir() + '" ' + applicationOptions) print "ok" diff --git a/slice/IceGrid/Observer.ice b/slice/IceGrid/Observer.ice index b01ac283630..391b6c2223e 100644 --- a/slice/IceGrid/Observer.ice +++ b/slice/IceGrid/Observer.ice @@ -133,7 +133,7 @@ sequence NodeDynamicInfoSeq; * nodes. * **/ -interface NodeObserver +["ami"] interface NodeObserver { /** * @@ -143,7 +143,7 @@ interface NodeObserver * @param nodes The current state of the nodes. * **/ - ["ami"] void nodeInit(NodeDynamicInfoSeq nodes); + void nodeInit(NodeDynamicInfoSeq nodes); /** * @@ -187,7 +187,7 @@ interface NodeObserver * @param updatedInfo The new adapter state. * **/ - void updateAdapter(string node, AdapterDynamicInfo updatedInfo); + void updateAdapter(string node, AdapterDynamicInfo updatedInfo); }; /** -- cgit v1.2.3 From 301391653db5f626c03a47d0d58c52c0dc068f77 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Mon, 6 Oct 2008 15:42:40 +0200 Subject: Fixed bug 3269 --- cpp/src/ca/iceca | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/ca/iceca b/cpp/src/ca/iceca index a23892830ec..99173c7fdb4 100755 --- a/cpp/src/ca/iceca +++ b/cpp/src/ca/iceca @@ -315,10 +315,10 @@ if sys.argv[script] == "init": # Construct the DN for the CA certificate. DNelements = { \ 'C':['countryName', "Country name", "", 'match'], \ - 'ST':['stateOfProviceName', "State or province name", "", 'match'], \ + 'ST':['stateOrProvinceName', "State or province name", "", 'match'], \ 'L':['localityName', "Locality", "", 'match'], \ 'O':['organizationName', "Organization name", "GridCA-" + socket.gethostname(), 'match'], \ - 'OU':['organizationUnitName', "Organization unit name", "", 'optional'], \ + 'OU':['organizationalUnitName', "Organizational unit name", "", 'optional'], \ 'CN':['commonName', "Common name", "Grid CA", 'supplied'] \ } -- cgit v1.2.3 From 96b1378f83bd3763dff2c911ec767d5560303992 Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Fri, 17 Oct 2008 17:03:17 +1000 Subject: Squashed commit of the following: commit eadbde83662d4b50398b03432ce5590484a3c867 Author: michi Date: Fri Oct 17 17:01:26 2008 +1000 Fixed broken rendering of headers and footers with Safari. --- cpp/doc/htmlHeader | 15 ++------ cpp/doc/indexFooter | 64 ++++++++++++++++---------------- cpp/doc/indexHeader | 79 ++++++++++++++++++---------------------- cpp/src/slice2html/Gen.cpp | 91 ++++++++++++++++++++++++++-------------------- cpp/src/slice2html/Gen.h | 6 ++- 5 files changed, 125 insertions(+), 130 deletions(-) (limited to 'cpp/src') diff --git a/cpp/doc/htmlHeader b/cpp/doc/htmlHeader index d1bd99e135a..99e76af519d 100644 --- a/cpp/doc/htmlHeader +++ b/cpp/doc/htmlHeader @@ -1,6 +1,7 @@ + TITLE @@ -30,17 +31,13 @@ TITLE font-style: italic; } .HeaderFooter { - position: relative; width: 100%; } - .LogoTable { - position: absolute; - right: 0; - top: 0; - } .Logo { border-style: none; } + .LogoTable { + } .Button { border-style: none; } @@ -48,12 +45,6 @@ TITLE border-style: none; cursor: default; } - .SearchTable { - position: absolute; - top: 0px; - margin-left: auto; - margin-right: auto; - } diff --git a/cpp/doc/indexFooter b/cpp/doc/indexFooter index 4d95b418770..5d7e7e03943 100644 --- a/cpp/doc/indexFooter +++ b/cpp/doc/indexFooter @@ -1,40 +1,38 @@ - -
-
- - - - -
- - Home - -
-
- +
+ +
+ + + + + +
+ + + + +
Home
+
+ + + + +
-
+
- -
-
-
+
+ + +
- - - - - -
- -
- - - +
+ + +
diff --git a/cpp/doc/indexHeader b/cpp/doc/indexHeader index 286f6f31cbf..6da017fbeed 100644 --- a/cpp/doc/indexHeader +++ b/cpp/doc/indexHeader @@ -1,6 +1,7 @@ + TITLE @@ -10,7 +11,9 @@ TITLE font-family: Arial, Helvetica, sans-serif; } .Page { - width: 850px; margin-left: auto; margin-right: auto; + width: 850px; + margin-left: auto; + margin-right: auto; } .Symbol { font-family: "Courier New", Courier, mono; @@ -47,60 +50,50 @@ TITLE cursor: pointer; } .HeaderFooter { - position: relative; width: 100%; } - .ButtonTable { - } - .LogoTable { - position: absolute; - right: 0; - top: 0; + .Button { + border-style: none; } .Logo { border-style: none; } - .SearchTable { - position: absolute; - top: 0px; - margin-left: auto; - margin-right: auto; - } </style> </head> <body> - <div class="Page"> - <div class="HeaderFooter"> - <table class="ButtonTable"> - <tr> - <td> - <a href="index.html"> - <img class="HomeButton" src="images/home.gif" alt="Home" style="border-style: none"/> - </a> - </td> - </tr> - </table> - <div style="text-align: center;"> - <table class="SearchTable"> + <div class="Page"> + + <!-- SwishCommand noindex --> + <table class="HeaderFooter"> + <tr> + <td align="left"> + <table> + <tr> + <td><a href="index.html"><img class="Button" src="images/home.gif" alt="Home"></a></td> + </tr> + </table> + </td> + <td align="center"> + <table> <tr> <td> - <form method="get" action="/cgi-bin/swish.cgi" - enctype="application/x-www-form-urlencoded" class="form"> + <form method="get" action="/cgi-bin/swish.cgi" enctype="application/x-www-form-urlencoded" class="form"> <div> <input maxlength="100" value="" type="text" name="query"> - <input type="submit" value="Search" name="submit"> - </div> - </form> - </td> + <input type="submit" value="Search" name="submit"></div> + </form></td> + </tr> + </table> + </td> + <td align="right"> + <table class="LogoTable"> + <tr> + <td><a href="http://www.zeroc.com"><img class="Logo" src="images/logo.gif" alt="Logo"></a></td> </tr> </table> - </div> - <table class="LogoTable"> - <tr> - <td> - <a href="http://www.zeroc.com"><img class="Logo" src="images/logo.gif" alt="Logo"/></a> - </td> - </tr> - </table> - </div> - <hr> + </td> + </tr> + </table> + <!-- SwishCommand index --> + + <hr> diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp index 49ae1cbd617..f1e9e5b02e0 100644 --- a/cpp/src/slice2html/Gen.cpp +++ b/cpp/src/slice2html/Gen.cpp @@ -250,7 +250,6 @@ Slice::GeneratorBase::openDoc(const string& file, const string& title, const str { _out << h2; } - _indexFooter = getFooter(footer); _out.inc(); _out.inc(); } @@ -291,11 +290,11 @@ Slice::GeneratorBase::openDoc(const ContainedPtr& c) // Close an open HTML file after writing the footer. // void -Slice::GeneratorBase::closeDoc() +Slice::GeneratorBase::closeDoc(const string& footer) { _out.dec(); _out.dec(); - _out << nl << (!_indexFooter.empty() ? _indexFooter : _footer); + _out << nl << (!footer.empty() ? footer : _footer); _out << nl; } @@ -738,23 +737,24 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c) } path += imageDir + "/"; - prevImage = "<img class=\"" + prevClass + "\" src=\"" + path + prevImage + "\" alt=\"Previous\"/>"; - nextImage = "<img class=\"" + nextClass + "\" src=\"" + path + nextImage + "\" alt=\"Next\"/>"; - upImage = "<img class=\"" + upClass + "\" src=\"" + path + upImage + "\" alt=\"Up\"/>"; - homeImage = "<img class=\"Button\" src=\"" + path + homeImage + "\" alt=\"Home\"/>"; - indexImage = "<img class=\"Button\" src=\"" + path + indexImage + "\" alt=\"Index\"/>"; + prevImage = "<img class=\"" + prevClass + "\" src=\"" + path + prevImage + "\" alt=\"Previous\">"; + nextImage = "<img class=\"" + nextClass + "\" src=\"" + path + nextImage + "\" alt=\"Next\">"; + upImage = "<img class=\"" + upClass + "\" src=\"" + path + upImage + "\" alt=\"Up\">"; + homeImage = "<img class=\"Button\" src=\"" + path + homeImage + "\" alt=\"Home\">"; + indexImage = "<img class=\"Button\" src=\"" + path + indexImage + "\" alt=\"Index\">"; } _out << nl << "<!-- SwishCommand noindex -->"; - start("div", "HeaderFooter"); - - start("table", "ButtonTable"); + start("table", "HeaderFooter"); start("tr"); + start("td align=\"left\""); + start("table"); + start("tr"); start("td"); _out << "<a href=\"" << homeLink << "\">" << homeImage << "</a>"; - end(); + end(); // td if(!imageDir.empty() || !isFirst) { @@ -805,16 +805,22 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c) _out << "<a href=\"" << indexLink << "\">" << indexImage << "</a>"; end(); - end(); - end(); + end(); // tr + end(); // table + end(); // td + start("td align=\"center\""); printSearch(); + end(); + start("td align=\"right\""); printLogo(c, container, onEnumPage); + end(); - _out << nl << "<!-- SwishCommand index -->"; + end(); // tr + end(); // table - end(); + _out << nl << "<!-- SwishCommand index -->" << nl; } void @@ -822,9 +828,7 @@ Slice::GeneratorBase::printSearch() { if(!_searchAction.empty()) { - _out << nl << "<div style=\"text-align: center;\">"; - _out.inc(); - start("table", "SearchTable"); + start("table"); start("tr"); start("td"); _out << nl << "<form method=\"get\" action=\"" << _searchAction << "\"" @@ -833,14 +837,12 @@ Slice::GeneratorBase::printSearch() start("div"); _out << nl << "<input maxlength=\"100\" value=\"\" type=\"text\" name=\"query\">"; _out << nl << "<input type=\"submit\" value=\"Search\" name=\"submit\">"; - end(); _out.dec(); - _out << nl << "</form>"; - end(); - end(); end(); - _out.dec(); - _out << nl << "</div>"; + _out << nl << "</form>"; + end(); // td + end(); // tr + end(); // table } } @@ -863,7 +865,7 @@ Slice::GeneratorBase::printLogo(const ContainedPtr& c, const ContainerPtr& conta { _out << "<a href=\"" + _logoURL + "\">"; } - _out << "<img class=\"Logo\" src=\"" + path + "\" alt=\"Logo\"/>"; + _out << "<img class=\"Logo\" src=\"" + path + "\" alt=\"Logo\">"; if(!_logoURL.empty()) { _out << "</a>"; @@ -1646,9 +1648,10 @@ Slice::StartPageGenerator::generate(const ModulePtr& m) void Slice::StartPageGenerator::printHeaderFooter() { - start("div", "HeaderFooter"); - - start("table", "ButtonTable"); + start("table", "HeaderFooter"); + start("tr"); + start("td align=\"left\""); + start("table"); start("tr"); start("td"); string imageDir = getImageDir(); @@ -1659,17 +1662,21 @@ Slice::StartPageGenerator::printHeaderFooter() else { string src = imageDir + "/index.gif"; - _out << "<a href=\"_sindex.html\"><img class=\"Button\" src=\"" + src + "\" alt=\"Index Button\"/></a>"; + _out << "<a href=\"_sindex.html\"><img class=\"Button\" src=\"" + src + "\" alt=\"Index Button\"></a>"; } - end(); - end(); - end(); + end(); // td + end(); // tr + end(); // table + end(); // td + start("td align=\"center\""); printSearch(); + end(); // td if(!imageDir.empty()) { - start("table", "LogoTable"); + start("td align=\"right\""); + start("table"); start("tr"); start("td"); string logoURL = getLogoURL(); @@ -1677,17 +1684,19 @@ Slice::StartPageGenerator::printHeaderFooter() { _out << "<a href=\"" + logoURL + "\">"; } - _out << "<img class=\"Logo\" src=\"" + imageDir + "/logo.gif\" alt=\"Logo\"/>"; + _out << "<img class=\"Logo\" src=\"" + imageDir + "/logo.gif\" alt=\"Logo\">"; if(!logoURL.empty()) { _out << "</a>"; } - end(); - end(); - end(); + end(); // td + end(); // tr + end(); // table + end(); // td } - end(); + end(); // tr + end(); // table } Slice::FileVisitor::FileVisitor(Files& files) @@ -1774,6 +1783,7 @@ Slice::StartPageVisitor::visitModuleStart(const ModulePtr& m) TOCGenerator::TOCGenerator(const Files& files, const string& header, const string& footer) : GeneratorBase(_out, files) { + _footer = footer; openDoc("_sindex.html", "Slice API Index", header, footer); start("h1"); @@ -1820,7 +1830,8 @@ TOCGenerator::writeTOC() _symbols.sort(); _symbols.unique(); - closeDoc(); + string f = getFooter(_footer); + closeDoc(getFooter(_footer)); } const ContainedList& diff --git a/cpp/src/slice2html/Gen.h b/cpp/src/slice2html/Gen.h index 3709c515495..9a474e5f302 100644 --- a/cpp/src/slice2html/Gen.h +++ b/cpp/src/slice2html/Gen.h @@ -45,7 +45,7 @@ protected: void openDoc(const ::std::string&, const std::string&, const std::string& = "", const std::string& = ""); void openDoc(const ContainedPtr&); - void closeDoc(); + void closeDoc(const std::string& = ""); void start(const ::std::string&, const ::std::string& = ::std::string()); void end(); @@ -70,6 +70,8 @@ protected: static ::std::string getImageDir(); static ::std::string getLogoURL(); + static ::std::string getFooter(const ::std::string&); + ::IceUtilInternal::XMLOutput& _out; static size_t _indexCount; @@ -89,7 +91,6 @@ private: static ::std::string readFile(const ::std::string&); static void readFile(const ::std::string&, ::std::string&, ::std::string&); static void getHeaders(const ::std::string&, ::std::string&, ::std::string&); - static ::std::string getFooter(const ::std::string&); ::std::string _indexFooter; const Files _files; @@ -171,6 +172,7 @@ private: void writeEntry(const ContainedPtr&); + ::std::string _footer; ModuleList _modules; ContainedList _symbols; ::IceUtilInternal::XMLOutput _out; -- cgit v1.2.3