2 * Copyright 2001-2006 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * TemplateParameters.cpp
20 * Supplies xmltooling TemplateEngine with additional parameters from a PropertySet.
24 #include "util/TemplateParameters.h"
28 using namespace shibsp;
29 using namespace xmltooling;
32 void TemplateParameters::setPropertySet(const PropertySet* props)
36 // Create a timestamp.
37 time_t now = time(NULL);
40 m_map["now"] = ctime_r(&now,timebuf);
42 m_map["now"] = ctime(&now);
46 const char* TemplateParameters::getParameter(const char* name) const
48 const char* pch = TemplateEngine::TemplateParameters::getParameter(name);
51 pair<bool,const char*> p = m_props->getString(name);
52 return p.first ? p.second : NULL;