2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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 * This file contains classes that implement WRT_INTERFACE.h interfaces,
19 * so that ACE could access WRT specific and other information during
20 * the decision making.
22 * @file attribute_.cpp
23 * @author Jaroslaw Osmanski (j.osmanski@samsung.com)
24 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
25 * @author Ming Jin(ming79.jin@samsung.com)
27 * @brief Implementation file for attributes obtaining.
30 #include <dpl/exception.h>
39 #include <dpl/wrt-dao-rw/widget_dao.h>
40 #include <dpl/wrt-dao-rw/feature_dao.h>
41 #include <dpl/ace/WRT_INTERFACE.h>
43 #include <dpl/log/log.h>
44 #include <attribute_facade.h>
45 #include <dpl/ace/Request.h>
46 #include <simple_roaming_agent.h>
48 using namespace WrtDB;
50 namespace // anonymous
52 typedef std::list<std::string> AttributeHandlerResponse;
54 typedef AttributeHandlerResponse (*AttributeHandler)(
55 const WidgetExecutionPhase &phase,
56 const WidgetHandle &widgetHandle);
57 typedef AttributeHandlerResponse (*ResourceAttributeHandler)(
58 const WidgetExecutionPhase &phase,
59 const WidgetHandle &widgetHandle,
60 const Request &request);
62 AttributeHandlerResponse AttributeClassHandler(const WidgetExecutionPhase & /*phase*/,
63 const WidgetHandle & /*widgetHandle*/)
65 AttributeHandlerResponse response;
66 response.push_back("widget");
70 AttributeHandlerResponse AttributeInstallUriHandler(
71 const WidgetExecutionPhase & /*phase*/,
72 const WidgetHandle &widgetHandle)
74 AttributeHandlerResponse response;
75 WidgetDAOReadOnly dao(widgetHandle);
77 std::string value = dao.getShareHref();
80 response.push_back(value);
86 AttributeHandlerResponse AttributeVersionHandler(const WidgetExecutionPhase & /*phase*/,
87 const WidgetHandle &widgetHandle)
89 AttributeHandlerResponse response;
90 WidgetDAOReadOnly dao(widgetHandle);
92 DPL::Optional<DPL::String> value = dao.getVersion();
95 response.push_back(DPL::ToUTF8String(*value));
101 AttributeHandlerResponse AttributeDistributorKeyCnHandler(
102 const WidgetExecutionPhase & /*phase*/,
103 const WidgetHandle &widgetHandle)
105 AttributeHandlerResponse response;
106 WidgetDAOReadOnly dao(widgetHandle);
108 response = dao.getKeyCommonNameList(WidgetCertificateData::DISTRIBUTOR,
109 WidgetCertificateData::ENDENTITY);
114 AttributeHandlerResponse AttributeDistributorKeyFingerprintHandler(
115 const WidgetExecutionPhase & /*phase*/,
116 const WidgetHandle &widgetHandle)
118 AttributeHandlerResponse response;
119 WidgetDAOReadOnly dao(widgetHandle);
121 response = dao.getKeyFingerprints(WidgetCertificateData::DISTRIBUTOR,
122 WidgetCertificateData::ENDENTITY);
127 AttributeHandlerResponse AttributeDistributorKeyRootCnHandler(
128 const WidgetExecutionPhase & /*phase*/,
129 const WidgetHandle &widgetHandle)
131 AttributeHandlerResponse response;
132 WidgetDAOReadOnly dao(widgetHandle);
134 response = dao.getKeyCommonNameList(WidgetCertificateData::DISTRIBUTOR,
135 WidgetCertificateData::ROOT);
140 AttributeHandlerResponse AttributeDistributorKeyRootFingerprintHandler(
141 const WidgetExecutionPhase & /*phase*/,
142 const WidgetHandle &widgetHandle)
144 AttributeHandlerResponse response;
145 WidgetDAOReadOnly dao(widgetHandle);
147 response = dao.getKeyFingerprints(WidgetCertificateData::DISTRIBUTOR,
148 WidgetCertificateData::ROOT);
153 AttributeHandlerResponse AttributeAuthorKeyCnHandler(
154 const WidgetExecutionPhase & /*phase*/,
155 const WidgetHandle &widgetHandle)
157 AttributeHandlerResponse response;
158 WidgetDAOReadOnly dao(widgetHandle);
160 response = dao.getKeyCommonNameList(WidgetCertificateData::AUTHOR,
161 WidgetCertificateData::ENDENTITY);
166 AttributeHandlerResponse AttributeAuthorKeyFingerprintHandler(
167 const WidgetExecutionPhase & /*phase*/,
168 const WidgetHandle &widgetHandle)
170 AttributeHandlerResponse response;
171 WidgetDAOReadOnly dao(widgetHandle);
173 response = dao.getKeyFingerprints(WidgetCertificateData::AUTHOR,
174 WidgetCertificateData::ENDENTITY);
179 AttributeHandlerResponse AttributeAuthorKeyRootCnHandler(
180 const WidgetExecutionPhase & /*phase*/,
181 const WidgetHandle &widgetHandle)
183 AttributeHandlerResponse response;
184 WidgetDAOReadOnly dao(widgetHandle);
186 response = dao.getKeyCommonNameList(WidgetCertificateData::AUTHOR,
187 WidgetCertificateData::ROOT);
192 AttributeHandlerResponse AttributeAuthorKeyRootFingerprintHandler(
193 const WidgetExecutionPhase & /*phase*/,
194 const WidgetHandle &widgetHandle)
196 AttributeHandlerResponse response;
197 WidgetDAOReadOnly dao(widgetHandle);
199 response = dao.getKeyFingerprints(WidgetCertificateData::AUTHOR,
200 WidgetCertificateData::ROOT);
205 AttributeHandlerResponse AttributeNetworkAccessUriHandler(
206 const WidgetExecutionPhase & /*phase*/,
207 const WidgetHandle & /*widgetHandle*/)
209 AttributeHandlerResponse response;
213 AttributeHandlerResponse AttributeIdHandler(const WidgetExecutionPhase & /*phase*/,
214 const WidgetHandle &widgetHandle)
216 AttributeHandlerResponse response;
217 WidgetDAOReadOnly dao(widgetHandle);
218 WidgetGUID wGUID = dao.getGUID();
221 response.push_back(DPL::ToUTF8String(*wGUID));
226 //AttributeHandlerResponse AttributeNameHandler(const WidgetExecutionPhase & /*phase*/,
227 // const WidgetHandle &widgetHandle)
229 // AttributeHandlerResponse response;
231 // WidgetLocalizedInfo info =
232 // W3CFileLocalization::getLocalizedInfo(widgetHandle);
234 // DPL::Optional<DPL::String> val = info.name;
235 // std::string value = !!val ? DPL::ToUTF8String(*val) : "";
237 // response.push_back(value);
241 //AttributeHandlerResponse AttributeWidgetAttrNameHandler(
242 // const WidgetExecutionPhase & /*phase*/,
243 // const WidgetHandle &widgetHandle)
245 // AttributeHandlerResponse response;
247 // WidgetLocalizedInfo info =
248 // W3CFileLocalization::getLocalizedInfo(widgetHandle);
250 // DPL::Optional<DPL::String> value = info.name;
253 // response.push_back(DPL::ToUTF8String(*value));
259 AttributeHandlerResponse AttributeAuthorNameHandler(
260 const WidgetExecutionPhase & /*phase*/,
261 const WidgetHandle &widgetHandle)
263 AttributeHandlerResponse response;
264 WidgetDAOReadOnly dao(widgetHandle);
266 DPL::Optional<DPL::String> value = dao.getAuthorName();
269 response.push_back(DPL::ToUTF8String(*value));
275 AttributeHandlerResponse AttributeRoamingHandler(
276 const WidgetExecutionPhase &phase,
277 const WidgetHandle & /*widgetHandle*/)
279 AttributeHandlerResponse response;
281 if (WidgetExecutionPhase_WidgetInstall == phase) {
282 // TODO undetermind value
283 response.push_back(std::string(""));
284 } else if (SimpleRoamingAgentSingleton::Instance().IsRoamingOn()) {
285 response.push_back(std::string("true"));
287 response.push_back(std::string("false"));
293 AttributeHandlerResponse AttributeBearerTypeHandler(
294 const WidgetExecutionPhase & /*phase*/,
295 const WidgetHandle & /*widgetHandle*/)
297 AttributeHandlerResponse response;
299 std::string bearerName = "undefined-bearer-name";
301 if (bearerName.empty()) {
302 LogWarning("Bearer-type is NOT SET or empty");
304 response.push_back(bearerName);
310 struct AttributeHandlerContext
313 WidgetExecutionPhase allowedPhaseMask;
314 AttributeHandler handler;
318 const WidgetExecutionPhase WidgetExecutionPhase_All =
319 static_cast<WidgetExecutionPhase>(
320 WidgetExecutionPhase_WidgetInstall |
321 WidgetExecutionPhase_WidgetInstantiate |
322 WidgetExecutionPhase_WebkitBind |
323 WidgetExecutionPhase_Invoke);
324 const WidgetExecutionPhase WidgetExecutionPhase_NoWidgetInstall =
325 static_cast<WidgetExecutionPhase>(
326 WidgetExecutionPhase_WidgetInstantiate |
327 WidgetExecutionPhase_WebkitBind |
328 WidgetExecutionPhase_Invoke);
330 #define ALL_PHASE(name, handler) \
331 { # name, WidgetExecutionPhase_All, handler },
333 #define NO_INSTALL(name, handler) \
334 { # name, WidgetExecutionPhase_NoWidgetInstall, handler },
336 AttributeHandlerContext HANDLED_ATTRIBUTES_LIST[] = {
337 ALL_PHASE(Class, &AttributeClassHandler)
338 ALL_PHASE(install-uri, &AttributeInstallUriHandler)
339 ALL_PHASE(version, &AttributeVersionHandler)
340 ALL_PHASE(distributor-key-cn, &AttributeDistributorKeyCnHandler)
341 ALL_PHASE(distributor-key-fingerprint,
342 &AttributeDistributorKeyFingerprintHandler)
343 ALL_PHASE(distributor-key-root-cn,
344 &AttributeDistributorKeyRootCnHandler)
345 ALL_PHASE(distributor-key-root-fingerprint,
346 &AttributeDistributorKeyRootFingerprintHandler)
347 ALL_PHASE(author-key-cn, &AttributeAuthorKeyCnHandler)
348 ALL_PHASE(author-key-fingerprint, &AttributeAuthorKeyFingerprintHandler)
349 ALL_PHASE(author-key-root-cn, &AttributeAuthorKeyRootCnHandler)
350 ALL_PHASE(author-key-root-fingerprint,
351 &AttributeAuthorKeyRootFingerprintHandler)
352 ALL_PHASE(network-access-uri, &AttributeNetworkAccessUriHandler)
353 ALL_PHASE(id, &AttributeIdHandler)
354 // ALL_PHASE(name, &AttributeNameHandler)
355 // ALL_PHASE(widget-attr:name, &AttributeWidgetAttrNameHandler)
356 ALL_PHASE(author-name, &AttributeAuthorNameHandler)
357 /* Enviroment attributes*/
358 NO_INSTALL(roaming, &AttributeRoamingHandler)
359 NO_INSTALL(bearer-type, &AttributeBearerTypeHandler)
365 const size_t HANDLED_ATTRIBUTES_LIST_COUNT =
366 sizeof(HANDLED_ATTRIBUTES_LIST) / sizeof(HANDLED_ATTRIBUTES_LIST[0]);
369 class lambdaCollectionPusher
372 std::list<T>& m_collection;
373 lambdaCollectionPusher(std::list<T>& collection) : m_collection(collection)
376 void operator()(const T& element) const
378 m_collection.push_back(element);
382 class lambdaWidgetPrefixEquality :
383 public std::binary_function<WidgetFeature, std::string, bool>
386 bool operator()(const WidgetFeature& wFeature,
387 const std::string& prefix) const
389 return wFeature.name.find(DPL::FromUTF8String(prefix)) !=
394 class lambdaWidgetNameEquality :
395 public std::binary_function<WidgetFeature, std::string, bool>
398 bool operator()(const WidgetFeature& wFeature,
399 const std::string& prefix) const
401 return wFeature.name == DPL::FromUTF8String(prefix);
405 FeatureHandleList getFeatureHandleList(const WidgetHandle& widgetHandle,
406 const std::string& resourceId)
408 FeatureHandleList featureHandleList;
409 WidgetDAOReadOnly widgetDAO(widgetHandle);
410 WidgetFeatureSet wFeatureSet = widgetDAO.getFeaturesList();
411 WidgetFeatureSet::iterator foundFeatures =
412 std::find_if(wFeatureSet.begin(),
414 std::bind2nd(lambdaWidgetPrefixEquality(), resourceId));
416 if (foundFeatures != wFeatureSet.end()) {
417 FeatureDAOReadOnly featureDAO(resourceId);
418 featureHandleList.push_back(featureDAO.GetFeatureHandle());
420 return featureHandleList;
423 AttributeHandlerResponse AttributeDeviceCapHandler(const WidgetExecutionPhase & /*phase*/,
424 const WidgetHandle & /*widgetHandle*/,
425 const Request &request)
427 AttributeHandlerResponse response;
429 Request::DeviceCapabilitySet capSet = request.getDeviceCapabilitySet();
434 lambdaCollectionPusher<std::string>(response));
438 // We should return list of device-caps required by resourceId.
439 // AttributeHandlerResponse response;
441 // FeatureHandleList fHandleList =
442 // getFeatureHandleList(widgetHandle, resourceId);
443 // if( !fHandleList.empty() )
445 // FeatureDAO feature( resourceId );
446 // std::set<std::string> deviceCapLast =
447 // feature.GetDeviceCapabilities();
449 // deviceCapList.begin(),
450 // deviceCapList.end(),
451 // lambdaCollectionPusher<DeviceCapList::value_type>(
457 class lambdaFeatureEquality :
458 public std::binary_function<FeatureHandle, int, bool>
461 bool operator()(const FeatureHandle& wFeature,
462 const int& resurceId) const
464 return wFeature == resurceId;
468 class lambdaPushFeatureName :
469 public std::binary_function<WidgetFeature, AttributeHandlerResponse, void>
471 void operator()(const WidgetFeature& wFeature,
472 AttributeHandlerResponse& response) const
474 response.push_back(DPL::ToUTF8String(wFeature.name));
478 AttributeHandlerResponse AttributeApiFeatureHandler(
479 const WidgetExecutionPhase & /* phase */,
480 const WidgetHandle & /* widgetHandle */,
481 const Request & /* request */)
483 LogDebug("WAC 2.0 does not support api-feature and resource-id in policy.");
484 AttributeHandlerResponse response;
486 // Wrt shouldn't ask about resource which is not listed in
487 // (widget) config.xml file
489 // AttributeHandlerResponse response;
490 // WidgetDAOReadOnly widgetDAO(widgetHandle);
491 // WidgetFeatureSet wFeatureSet = widgetDAO.GetFeaturesList();
492 // std::string featureName = resourceId;
493 // WidgetFeatureSet::iterator foundFeatures =
494 // std::find_if(wFeatureSet.begin(),
495 // wFeatureSet.end(),
496 // std::bind2nd(lambdaWidgetPrefixEquality(),
499 // while( foundFeatures != wFeatureSet.end() )
501 // response.push_back( foundFeatures->name );
502 // LogDebug("Found feature: " << foundFeatures->name );
509 typedef std::string (FeatureDAOReadOnly::*FNMETHOD)() const;
511 AttributeHandlerResponse GetFeatureAttributeGroup(const WidgetExecutionPhase & /*phase*/,
512 const WidgetHandle &widgetHandle,
513 const std::string& resourceId,
516 AttributeHandlerResponse response;
517 FeatureHandleList fHandleList =
518 getFeatureHandleList(widgetHandle, resourceId);
519 if (!fHandleList.empty()) {
520 FeatureDAOReadOnly featureDAO(fHandleList.front());
521 std::string attribute = (featureDAO.*function)();
522 response.push_back(attribute);
527 AttributeHandlerResponse AttributeFeatureInstallUriHandler(
528 const WidgetExecutionPhase & /* phase */,
529 const WidgetHandle & /* widgetHandle */,
530 const Request & /* request */)
532 LogDebug("WAC 2.0 does not support feature-install-uri is policy!");
533 AttributeHandlerResponse response;
537 AttributeHandlerResponse AttributeFeatureFeatureKeyCnHandler(
538 const WidgetExecutionPhase & /* phase */,
539 const WidgetHandle & /* widgetHandle */,
540 const Request & /* request */)
542 LogDebug("WAC 2.0 does not support feature-key-cn is policy!");
543 AttributeHandlerResponse response;
547 AttributeHandlerResponse AttributeFeatureKeyRootCnHandler(
548 const WidgetExecutionPhase & /* phase */,
549 const WidgetHandle & /* widgetHandle */,
550 const Request & /* request */)
552 LogDebug("WAC 2.0 does not support feature-key-root-cn is policy!");
553 AttributeHandlerResponse response;
557 AttributeHandlerResponse AttributeFeatureKeyRootFingerprintHandler(
558 const WidgetExecutionPhase & /* phase */,
559 const WidgetHandle & /* widgetHandle */,
560 const Request & /* request */)
562 LogDebug("WAC 2.0 does not support"
563 " feature-key-root-fingerprint is policy!");
564 AttributeHandlerResponse response;
568 struct ResourceAttributeHandlerContext
571 WidgetExecutionPhase allowedPhaseMask;
572 ResourceAttributeHandler handler;
575 #define ALL_PHASE(name, handler) \
576 { # name, WidgetExecutionPhase_All, handler },
578 ResourceAttributeHandlerContext HANDLED_RESOURCE_ATTRIBUTES_LIST[] = {
579 ALL_PHASE(device-cap, &AttributeDeviceCapHandler)
580 ALL_PHASE(api-feature, &AttributeApiFeatureHandler)
581 // [P.Fatyga] For compatiblity with older policies we tread resource-id
582 // identically as api-feature
583 ALL_PHASE(resource-id, &AttributeApiFeatureHandler)
585 ALL_PHASE(feature-install-uri, &AttributeFeatureInstallUriHandler)
586 ALL_PHASE(feature-key-cn, &AttributeFeatureFeatureKeyCnHandler)
587 ALL_PHASE(feature-key-root-cn, &AttributeFeatureKeyRootCnHandler)
588 ALL_PHASE(feature-key-root-fingerprint,
589 &AttributeFeatureKeyRootFingerprintHandler)
594 const size_t HANDLED_RESOURCE_ATTRIBUTES_LIST_COUNT =
595 sizeof(HANDLED_RESOURCE_ATTRIBUTES_LIST) /
596 sizeof(HANDLED_RESOURCE_ATTRIBUTES_LIST[0]);
597 } // namespace anonymous
600 * class WebRuntimeImpl
602 int WebRuntimeImpl::getAttributesValuesLoop(const Request &request,
603 std::list<ATTRIBUTE>* attributes,
604 WidgetExecutionPhase executionPhase)
606 UNHANDLED_EXCEPTION_HANDLER_BEGIN
608 WidgetHandle widgetHandle = request.getWidgetHandle();
610 FOREACH(itr, *attributes)
612 // Get attribute name
613 std::string attribute = *itr->first;
615 // Search for attribute handler
616 bool attributeFound = false;
618 for (size_t i = 0; i < HANDLED_ATTRIBUTES_LIST_COUNT; ++i) {
619 if (HANDLED_ATTRIBUTES_LIST[i].name == attribute) {
620 // Check if execution phase is valid
621 if ((executionPhase &
622 HANDLED_ATTRIBUTES_LIST[i].allowedPhaseMask) == 0) {
623 // Attribute found, but execution state
624 // forbids to execute handler
626 "Request for attribute: '" <<
627 attribute << "' which is supported " <<
628 "but forbidden at widget execution phase: "
632 // Execution phase allows handler
633 AttributeHandlerResponse attributeResponse =
634 (*HANDLED_ATTRIBUTES_LIST[i].handler)(
637 std::copy(attributeResponse.begin(),
638 attributeResponse.end(),
639 std::back_inserter(*itr->second));
642 attributeFound = true;
647 if (!attributeFound) {
648 LogWarning("Request for attribute: '" <<
649 attribute << "' which is not supported");
655 UNHANDLED_EXCEPTION_HANDLER_END
658 int WebRuntimeImpl::getAttributesValues(const Request &request,
659 std::list<ATTRIBUTE>* attributes)
661 UNHANDLED_EXCEPTION_HANDLER_BEGIN
663 // Get current execution state
664 WidgetExecutionPhase executionPhase =
665 request.getExecutionPhase();
667 return getAttributesValuesLoop(request, attributes, executionPhase);
669 UNHANDLED_EXCEPTION_HANDLER_END
672 std::string WebRuntimeImpl::getSessionId(const Request & /* request */)
675 LogError("Not implemented!");
679 WebRuntimeImpl::WebRuntimeImpl()
684 * class ResourceInformationImpl
687 int ResourceInformationImpl::getAttributesValuesLoop(const Request &request,
688 std::list<ATTRIBUTE>* attributes,
689 WidgetExecutionPhase executionPhase)
691 // Currently, we assume widgets have internal representation of integer IDs
692 WidgetHandle widgetHandle = request.getWidgetHandle();
693 //TODO add resource id string analyzys
694 FOREACH(itr, *attributes)
696 // Get attribute name
697 std::string attribute = *itr->first;
699 // Search for attribute handler
700 bool attributeFound = false;
702 for (size_t i = 0; i < HANDLED_RESOURCE_ATTRIBUTES_LIST_COUNT; ++i) {
703 if (HANDLED_RESOURCE_ATTRIBUTES_LIST[i].name == attribute) {
704 // Check if execution phase is valid
705 if ((executionPhase &
706 HANDLED_RESOURCE_ATTRIBUTES_LIST[i].allowedPhaseMask) ==
708 // Attribute found, but execution state
709 // forbids to execute handler
711 "Request for attribute: '" <<
713 "' which is supported but forbidden " <<
714 "at widget execution phase: " << executionPhase);
717 // Execution phase allows handler
718 AttributeHandlerResponse attributeResponse =
719 (*HANDLED_RESOURCE_ATTRIBUTES_LIST[i].handler)(
723 std::copy(attributeResponse.begin(),
724 attributeResponse.end(),
725 std::back_inserter(*itr->second));
727 std::ostringstream attributeResponseFull;
729 for (AttributeHandlerResponse::const_iterator
730 it = attributeResponse.begin();
731 it != attributeResponse.end(); ++it) {
732 attributeResponseFull <<
733 (it == attributeResponse.begin() ? "" : ", ") <<
737 LogDebug("Attribute(" << attribute << ") = " <<
738 attributeResponseFull.str());
741 attributeFound = true;
746 if (!attributeFound) {
747 LogWarning("Request for attribute: '" << attribute <<
748 "' which is not supported");
754 int ResourceInformationImpl::getAttributesValues(const Request &request,
755 std::list<ATTRIBUTE>* attributes)
757 UNHANDLED_EXCEPTION_HANDLER_BEGIN
759 // Get current execution state
760 WidgetExecutionPhase executionPhase =
761 request.getExecutionPhase();
762 return getAttributesValuesLoop(request, attributes, executionPhase);
764 UNHANDLED_EXCEPTION_HANDLER_END
767 ResourceInformationImpl::ResourceInformationImpl()
772 * class OperationSystemImpl
775 int OperationSystemImpl::getAttributesValues(const Request &request,
776 std::list<ATTRIBUTE>* attributes)
778 UNHANDLED_EXCEPTION_HANDLER_BEGIN
781 //GetExecution name without widget name
782 WidgetExecutionPhase executionPhase =
783 request.getExecutionPhase();
785 FOREACH(itr, *attributes)
787 // Get attribute name
788 std::string attribute = *itr->first;
790 // Search for attribute handler
791 bool attributeFound = false;
793 for (size_t i = 0; i < HANDLED_ATTRIBUTES_LIST_COUNT; ++i) {
794 if (HANDLED_ATTRIBUTES_LIST[i].name == attribute) {
795 // Check if execution phase is valid
796 if ((executionPhase &
797 HANDLED_ATTRIBUTES_LIST[i].allowedPhaseMask) == 0) {
798 // Attribute found, but execution state forbids
799 // to execute handler
800 LogDebug("Request for attribute: '" << attribute <<
801 "' which is supported but forbidden at " <<
802 "widget execution phase: " << executionPhase);
805 // Execution phase allows handler
806 AttributeHandlerResponse attributeResponse =
807 (*HANDLED_ATTRIBUTES_LIST[i].handler)(
810 std::copy(attributeResponse.begin(),
811 attributeResponse.end(),
812 std::back_inserter(*itr->second));
814 std::ostringstream attributeResponseFull;
816 typedef AttributeHandlerResponse::const_iterator Iter;
817 FOREACH(it, attributeResponse)
819 attributeResponseFull <<
820 (it == attributeResponse.begin()
824 LogDebug("Attribute(" << attribute <<
825 ") = " << attributeResponseFull.str());
828 attributeFound = true;
833 if (!attributeFound) {
834 LogWarning("Request for attribute: '" << attribute <<
835 "' which is not supported");
841 UNHANDLED_EXCEPTION_HANDLER_END
844 OperationSystemImpl::OperationSystemImpl()
849 * end of class OperationSystemImpl
852 int FunctionParamImpl::getAttributesValues(const Request & /*request*/,
853 std::list<ATTRIBUTE> *attributes)
855 FOREACH(iter, *attributes)
857 std::string attributeName = *(iter->first);
859 ParamMap::const_iterator i;
860 std::pair<ParamMap::const_iterator, ParamMap::const_iterator> jj =
861 paramMap.equal_range(attributeName);
863 for (i = jj.first; i != jj.second; ++i) {
864 iter->second->push_back(i->second);
865 LogDebug("Attribute: " << attributeName << " Value: " <<