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-ro/wrt_db_types.h>
40 #include <dpl/wrt-dao-rw/widget_dao.h>
41 #include <dpl/wrt-dao-rw/feature_dao.h>
42 #include <ace/WRT_INTERFACE.h>
44 #include <dpl/log/log.h>
45 #include <attribute_facade.h>
46 #include <ace/Request.h>
47 #include <simple_roaming_agent.h>
49 using namespace WrtDB;
51 namespace // anonymous
53 typedef std::list<std::string> AttributeHandlerResponse;
55 typedef AttributeHandlerResponse (*AttributeHandler)(
56 const WidgetExecutionPhase &phase,
57 const WidgetHandle &widgetHandle);
58 typedef AttributeHandlerResponse (*ResourceAttributeHandler)(
59 const WidgetExecutionPhase &phase,
60 const WidgetHandle &widgetHandle,
61 const Request &request);
63 AttributeHandlerResponse AttributeClassHandler(const WidgetExecutionPhase & /*phase*/,
64 const WidgetHandle & /*widgetHandle*/)
66 AttributeHandlerResponse response;
67 response.push_back("widget");
71 AttributeHandlerResponse AttributeInstallUriHandler(
72 const WidgetExecutionPhase & /*phase*/,
73 const WidgetHandle &widgetHandle)
75 AttributeHandlerResponse response;
76 WidgetDAOReadOnly dao(widgetHandle);
78 std::string value = dao.getShareHref();
81 response.push_back(value);
87 AttributeHandlerResponse AttributeVersionHandler(const WidgetExecutionPhase & /*phase*/,
88 const WidgetHandle &widgetHandle)
90 AttributeHandlerResponse response;
91 WidgetDAOReadOnly dao(widgetHandle);
93 DPL::Optional<DPL::String> value = dao.getVersion();
96 response.push_back(DPL::ToUTF8String(*value));
102 AttributeHandlerResponse AttributeDistributorKeyCnHandler(
103 const WidgetExecutionPhase & /*phase*/,
104 const WidgetHandle &widgetHandle)
106 AttributeHandlerResponse response;
107 WidgetDAOReadOnly dao(widgetHandle);
109 response = dao.getKeyCommonNameList(WidgetCertificateData::DISTRIBUTOR,
110 WidgetCertificateData::ENDENTITY);
115 AttributeHandlerResponse AttributeDistributorKeyFingerprintHandler(
116 const WidgetExecutionPhase & /*phase*/,
117 const WidgetHandle &widgetHandle)
119 AttributeHandlerResponse response;
120 WidgetDAOReadOnly dao(widgetHandle);
122 response = dao.getKeyFingerprints(WidgetCertificateData::DISTRIBUTOR,
123 WidgetCertificateData::ENDENTITY);
128 AttributeHandlerResponse AttributeDistributorKeyRootCnHandler(
129 const WidgetExecutionPhase & /*phase*/,
130 const WidgetHandle &widgetHandle)
132 AttributeHandlerResponse response;
133 WidgetDAOReadOnly dao(widgetHandle);
135 response = dao.getKeyCommonNameList(WidgetCertificateData::DISTRIBUTOR,
136 WidgetCertificateData::ROOT);
141 AttributeHandlerResponse AttributeDistributorKeyRootFingerprintHandler(
142 const WidgetExecutionPhase & /*phase*/,
143 const WidgetHandle &widgetHandle)
145 AttributeHandlerResponse response;
146 WidgetDAOReadOnly dao(widgetHandle);
148 response = dao.getKeyFingerprints(WidgetCertificateData::DISTRIBUTOR,
149 WidgetCertificateData::ROOT);
154 AttributeHandlerResponse AttributeAuthorKeyCnHandler(
155 const WidgetExecutionPhase & /*phase*/,
156 const WidgetHandle &widgetHandle)
158 AttributeHandlerResponse response;
159 WidgetDAOReadOnly dao(widgetHandle);
161 response = dao.getKeyCommonNameList(WidgetCertificateData::AUTHOR,
162 WidgetCertificateData::ENDENTITY);
167 AttributeHandlerResponse AttributeAuthorKeyFingerprintHandler(
168 const WidgetExecutionPhase & /*phase*/,
169 const WidgetHandle &widgetHandle)
171 AttributeHandlerResponse response;
172 WidgetDAOReadOnly dao(widgetHandle);
174 response = dao.getKeyFingerprints(WidgetCertificateData::AUTHOR,
175 WidgetCertificateData::ENDENTITY);
180 AttributeHandlerResponse AttributeAuthorKeyRootCnHandler(
181 const WidgetExecutionPhase & /*phase*/,
182 const WidgetHandle &widgetHandle)
184 AttributeHandlerResponse response;
185 WidgetDAOReadOnly dao(widgetHandle);
187 response = dao.getKeyCommonNameList(WidgetCertificateData::AUTHOR,
188 WidgetCertificateData::ROOT);
193 AttributeHandlerResponse AttributeAuthorKeyRootFingerprintHandler(
194 const WidgetExecutionPhase & /*phase*/,
195 const WidgetHandle &widgetHandle)
197 AttributeHandlerResponse response;
198 WidgetDAOReadOnly dao(widgetHandle);
200 response = dao.getKeyFingerprints(WidgetCertificateData::AUTHOR,
201 WidgetCertificateData::ROOT);
206 AttributeHandlerResponse AttributeNetworkAccessUriHandler(
207 const WidgetExecutionPhase & /*phase*/,
208 const WidgetHandle & /*widgetHandle*/)
210 AttributeHandlerResponse response;
214 AttributeHandlerResponse AttributeIdHandler(const WidgetExecutionPhase & /*phase*/,
215 const WidgetHandle &widgetHandle)
217 AttributeHandlerResponse response;
218 WidgetDAOReadOnly dao(widgetHandle);
219 WidgetGUID wGUID = dao.getGUID();
222 response.push_back(DPL::ToUTF8String(*wGUID));
227 //AttributeHandlerResponse AttributeNameHandler(const WidgetExecutionPhase & /*phase*/,
228 // const WidgetHandle &widgetHandle)
230 // AttributeHandlerResponse response;
232 // WidgetLocalizedInfo info =
233 // W3CFileLocalization::getLocalizedInfo(widgetHandle);
235 // DPL::Optional<DPL::String> val = info.name;
236 // std::string value = !!val ? DPL::ToUTF8String(*val) : "";
238 // response.push_back(value);
242 //AttributeHandlerResponse AttributeWidgetAttrNameHandler(
243 // const WidgetExecutionPhase & /*phase*/,
244 // const WidgetHandle &widgetHandle)
246 // AttributeHandlerResponse response;
248 // WidgetLocalizedInfo info =
249 // W3CFileLocalization::getLocalizedInfo(widgetHandle);
251 // DPL::Optional<DPL::String> value = info.name;
254 // response.push_back(DPL::ToUTF8String(*value));
260 AttributeHandlerResponse AttributeAuthorNameHandler(
261 const WidgetExecutionPhase & /*phase*/,
262 const WidgetHandle &widgetHandle)
264 AttributeHandlerResponse response;
265 WidgetDAOReadOnly dao(widgetHandle);
267 DPL::Optional<DPL::String> value = dao.getAuthorName();
270 response.push_back(DPL::ToUTF8String(*value));
276 AttributeHandlerResponse AttributeRoamingHandler(
277 const WidgetExecutionPhase &phase,
278 const WidgetHandle & /*widgetHandle*/)
280 AttributeHandlerResponse response;
282 if (WidgetExecutionPhase_WidgetInstall == phase) {
283 // TODO undetermind value
284 response.push_back(std::string(""));
285 } else if (SimpleRoamingAgentSingleton::Instance().IsRoamingOn()) {
286 response.push_back(std::string("true"));
288 response.push_back(std::string("false"));
294 AttributeHandlerResponse AttributeBearerTypeHandler(
295 const WidgetExecutionPhase & /*phase*/,
296 const WidgetHandle & /*widgetHandle*/)
298 AttributeHandlerResponse response;
300 std::string bearerName = "undefined-bearer-name";
302 if (bearerName.empty()) {
303 LogWarning("Bearer-type is NOT SET or empty");
305 response.push_back(bearerName);
311 struct AttributeHandlerContext
314 WidgetExecutionPhase allowedPhaseMask;
315 AttributeHandler handler;
319 const WidgetExecutionPhase WidgetExecutionPhase_All =
320 static_cast<WidgetExecutionPhase>(
321 WidgetExecutionPhase_WidgetInstall |
322 WidgetExecutionPhase_WidgetInstantiate |
323 WidgetExecutionPhase_WebkitBind |
324 WidgetExecutionPhase_Invoke);
325 const WidgetExecutionPhase WidgetExecutionPhase_NoWidgetInstall =
326 static_cast<WidgetExecutionPhase>(
327 WidgetExecutionPhase_WidgetInstantiate |
328 WidgetExecutionPhase_WebkitBind |
329 WidgetExecutionPhase_Invoke);
331 #define ALL_PHASE(name, handler) \
332 { # name, WidgetExecutionPhase_All, handler },
334 #define NO_INSTALL(name, handler) \
335 { # name, WidgetExecutionPhase_NoWidgetInstall, handler },
337 AttributeHandlerContext HANDLED_ATTRIBUTES_LIST[] = {
338 ALL_PHASE(Class, &AttributeClassHandler)
339 ALL_PHASE(install-uri, &AttributeInstallUriHandler)
340 ALL_PHASE(version, &AttributeVersionHandler)
341 ALL_PHASE(distributor-key-cn, &AttributeDistributorKeyCnHandler)
342 ALL_PHASE(distributor-key-fingerprint,
343 &AttributeDistributorKeyFingerprintHandler)
344 ALL_PHASE(distributor-key-root-cn,
345 &AttributeDistributorKeyRootCnHandler)
346 ALL_PHASE(distributor-key-root-fingerprint,
347 &AttributeDistributorKeyRootFingerprintHandler)
348 ALL_PHASE(author-key-cn, &AttributeAuthorKeyCnHandler)
349 ALL_PHASE(author-key-fingerprint, &AttributeAuthorKeyFingerprintHandler)
350 ALL_PHASE(author-key-root-cn, &AttributeAuthorKeyRootCnHandler)
351 ALL_PHASE(author-key-root-fingerprint,
352 &AttributeAuthorKeyRootFingerprintHandler)
353 ALL_PHASE(network-access-uri, &AttributeNetworkAccessUriHandler)
354 ALL_PHASE(id, &AttributeIdHandler)
355 // ALL_PHASE(name, &AttributeNameHandler)
356 // ALL_PHASE(widget-attr:name, &AttributeWidgetAttrNameHandler)
357 ALL_PHASE(author-name, &AttributeAuthorNameHandler)
358 /* Enviroment attributes*/
359 NO_INSTALL(roaming, &AttributeRoamingHandler)
360 NO_INSTALL(bearer-type, &AttributeBearerTypeHandler)
366 const size_t HANDLED_ATTRIBUTES_LIST_COUNT =
367 sizeof(HANDLED_ATTRIBUTES_LIST) / sizeof(HANDLED_ATTRIBUTES_LIST[0]);
370 class lambdaCollectionPusher
373 std::list<T>& m_collection;
374 lambdaCollectionPusher(std::list<T>& collection) : m_collection(collection)
377 void operator()(const T& element) const
379 m_collection.push_back(element);
383 class lambdaWidgetPrefixEquality :
384 public std::binary_function<WidgetFeature, std::string, bool>
387 bool operator()(const WidgetFeature& wFeature,
388 const std::string& prefix) const
390 return wFeature.name.find(DPL::FromUTF8String(prefix)) !=
395 class lambdaWidgetNameEquality :
396 public std::binary_function<WidgetFeature, std::string, bool>
399 bool operator()(const WidgetFeature& wFeature,
400 const std::string& prefix) const
402 return wFeature.name == DPL::FromUTF8String(prefix);
406 FeatureHandleList getFeatureHandleList(const WidgetHandle& widgetHandle,
407 const std::string& resourceId)
409 FeatureHandleList featureHandleList;
410 WidgetDAOReadOnly widgetDAO(widgetHandle);
411 WidgetFeatureSet wFeatureSet = widgetDAO.getFeaturesList();
412 WidgetFeatureSet::iterator foundFeatures =
413 std::find_if(wFeatureSet.begin(),
415 std::bind2nd(lambdaWidgetPrefixEquality(), resourceId));
417 if (foundFeatures != wFeatureSet.end()) {
418 FeatureDAOReadOnly featureDAO(resourceId);
419 featureHandleList.push_back(featureDAO.GetFeatureHandle());
421 return featureHandleList;
424 AttributeHandlerResponse AttributeDeviceCapHandler(const WidgetExecutionPhase & /*phase*/,
425 const WidgetHandle & /*widgetHandle*/,
426 const Request &request)
428 AttributeHandlerResponse response;
430 Request::DeviceCapabilitySet capSet = request.getDeviceCapabilitySet();
435 lambdaCollectionPusher<std::string>(response));
439 // We should return list of device-caps required by resourceId.
440 // AttributeHandlerResponse response;
442 // FeatureHandleList fHandleList =
443 // getFeatureHandleList(widgetHandle, resourceId);
444 // if( !fHandleList.empty() )
446 // FeatureDAO feature( resourceId );
447 // std::set<std::string> deviceCapLast =
448 // feature.GetDeviceCapabilities();
450 // deviceCapList.begin(),
451 // deviceCapList.end(),
452 // lambdaCollectionPusher<DeviceCapList::value_type>(
458 class lambdaFeatureEquality :
459 public std::binary_function<FeatureHandle, int, bool>
462 bool operator()(const FeatureHandle& wFeature,
463 const int& resurceId) const
465 return wFeature == resurceId;
469 class lambdaPushFeatureName :
470 public std::binary_function<WidgetFeature, AttributeHandlerResponse, void>
472 void operator()(const WidgetFeature& wFeature,
473 AttributeHandlerResponse& response) const
475 response.push_back(DPL::ToUTF8String(wFeature.name));
479 AttributeHandlerResponse AttributeApiFeatureHandler(
480 const WidgetExecutionPhase & /* phase */,
481 const WidgetHandle & /* widgetHandle */,
482 const Request & /* request */)
484 LogDebug("WAC 2.0 does not support api-feature and resource-id in policy.");
485 AttributeHandlerResponse response;
487 // Wrt shouldn't ask about resource which is not listed in
488 // (widget) config.xml file
490 // AttributeHandlerResponse response;
491 // WidgetDAOReadOnly widgetDAO(widgetHandle);
492 // WidgetFeatureSet wFeatureSet = widgetDAO.GetFeaturesList();
493 // std::string featureName = resourceId;
494 // WidgetFeatureSet::iterator foundFeatures =
495 // std::find_if(wFeatureSet.begin(),
496 // wFeatureSet.end(),
497 // std::bind2nd(lambdaWidgetPrefixEquality(),
500 // while( foundFeatures != wFeatureSet.end() )
502 // response.push_back( foundFeatures->name );
503 // LogDebug("Found feature: " << foundFeatures->name );
510 typedef std::string (FeatureDAOReadOnly::*FNMETHOD)() const;
512 AttributeHandlerResponse GetFeatureAttributeGroup(const WidgetExecutionPhase & /*phase*/,
513 const WidgetHandle &widgetHandle,
514 const std::string& resourceId,
517 AttributeHandlerResponse response;
518 FeatureHandleList fHandleList =
519 getFeatureHandleList(widgetHandle, resourceId);
520 if (!fHandleList.empty()) {
521 FeatureDAOReadOnly featureDAO(fHandleList.front());
522 std::string attribute = (featureDAO.*function)();
523 response.push_back(attribute);
528 AttributeHandlerResponse AttributeFeatureInstallUriHandler(
529 const WidgetExecutionPhase & /* phase */,
530 const WidgetHandle & /* widgetHandle */,
531 const Request & /* request */)
533 LogDebug("WAC 2.0 does not support feature-install-uri is policy!");
534 AttributeHandlerResponse response;
538 AttributeHandlerResponse AttributeFeatureFeatureKeyCnHandler(
539 const WidgetExecutionPhase & /* phase */,
540 const WidgetHandle & /* widgetHandle */,
541 const Request & /* request */)
543 LogDebug("WAC 2.0 does not support feature-key-cn is policy!");
544 AttributeHandlerResponse response;
548 AttributeHandlerResponse AttributeFeatureKeyRootCnHandler(
549 const WidgetExecutionPhase & /* phase */,
550 const WidgetHandle & /* widgetHandle */,
551 const Request & /* request */)
553 LogDebug("WAC 2.0 does not support feature-key-root-cn is policy!");
554 AttributeHandlerResponse response;
558 AttributeHandlerResponse AttributeFeatureKeyRootFingerprintHandler(
559 const WidgetExecutionPhase & /* phase */,
560 const WidgetHandle & /* widgetHandle */,
561 const Request & /* request */)
563 LogDebug("WAC 2.0 does not support"
564 " feature-key-root-fingerprint is policy!");
565 AttributeHandlerResponse response;
569 struct ResourceAttributeHandlerContext
572 WidgetExecutionPhase allowedPhaseMask;
573 ResourceAttributeHandler handler;
576 #define ALL_PHASE(name, handler) \
577 { # name, WidgetExecutionPhase_All, handler },
579 ResourceAttributeHandlerContext HANDLED_RESOURCE_ATTRIBUTES_LIST[] = {
580 ALL_PHASE(device-cap, &AttributeDeviceCapHandler)
581 ALL_PHASE(api-feature, &AttributeApiFeatureHandler)
582 // [P.Fatyga] For compatiblity with older policies we tread resource-id
583 // identically as api-feature
584 ALL_PHASE(resource-id, &AttributeApiFeatureHandler)
586 ALL_PHASE(feature-install-uri, &AttributeFeatureInstallUriHandler)
587 ALL_PHASE(feature-key-cn, &AttributeFeatureFeatureKeyCnHandler)
588 ALL_PHASE(feature-key-root-cn, &AttributeFeatureKeyRootCnHandler)
589 ALL_PHASE(feature-key-root-fingerprint,
590 &AttributeFeatureKeyRootFingerprintHandler)
595 const size_t HANDLED_RESOURCE_ATTRIBUTES_LIST_COUNT =
596 sizeof(HANDLED_RESOURCE_ATTRIBUTES_LIST) /
597 sizeof(HANDLED_RESOURCE_ATTRIBUTES_LIST[0]);
598 } // namespace anonymous
601 * class WebRuntimeImpl
603 int WebRuntimeImpl::getAttributesValuesLoop(const Request &request,
604 std::list<ATTRIBUTE>* attributes,
605 WidgetExecutionPhase executionPhase)
607 UNHANDLED_EXCEPTION_HANDLER_BEGIN
609 WidgetHandle widgetHandle = request.getWidgetHandle();
611 FOREACH(itr, *attributes)
613 // Get attribute name
614 std::string attribute = *itr->first;
616 // Search for attribute handler
617 bool attributeFound = false;
619 for (size_t i = 0; i < HANDLED_ATTRIBUTES_LIST_COUNT; ++i) {
620 if (HANDLED_ATTRIBUTES_LIST[i].name == attribute) {
621 // Check if execution phase is valid
622 if ((executionPhase &
623 HANDLED_ATTRIBUTES_LIST[i].allowedPhaseMask) == 0) {
624 // Attribute found, but execution state
625 // forbids to execute handler
627 "Request for attribute: '" <<
628 attribute << "' which is supported " <<
629 "but forbidden at widget execution phase: "
633 // Execution phase allows handler
634 AttributeHandlerResponse attributeResponse =
635 (*HANDLED_ATTRIBUTES_LIST[i].handler)(
638 std::copy(attributeResponse.begin(),
639 attributeResponse.end(),
640 std::back_inserter(*itr->second));
643 attributeFound = true;
648 if (!attributeFound) {
649 LogWarning("Request for attribute: '" <<
650 attribute << "' which is not supported");
656 UNHANDLED_EXCEPTION_HANDLER_END
659 int WebRuntimeImpl::getAttributesValues(const Request &request,
660 std::list<ATTRIBUTE>* attributes)
662 UNHANDLED_EXCEPTION_HANDLER_BEGIN
664 // Get current execution state
665 WidgetExecutionPhase executionPhase =
666 request.getExecutionPhase();
668 return getAttributesValuesLoop(request, attributes, executionPhase);
670 UNHANDLED_EXCEPTION_HANDLER_END
673 std::string WebRuntimeImpl::getSessionId(const Request & /* request */)
676 LogError("Not implemented!");
680 WebRuntimeImpl::WebRuntimeImpl()
685 * class ResourceInformationImpl
688 int ResourceInformationImpl::getAttributesValuesLoop(const Request &request,
689 std::list<ATTRIBUTE>* attributes,
690 WidgetExecutionPhase executionPhase)
692 // Currently, we assume widgets have internal representation of integer IDs
693 WidgetHandle widgetHandle = request.getWidgetHandle();
694 //TODO add resource id string analyzys
695 FOREACH(itr, *attributes)
697 // Get attribute name
698 std::string attribute = *itr->first;
700 // Search for attribute handler
701 bool attributeFound = false;
703 for (size_t i = 0; i < HANDLED_RESOURCE_ATTRIBUTES_LIST_COUNT; ++i) {
704 if (HANDLED_RESOURCE_ATTRIBUTES_LIST[i].name == attribute) {
705 // Check if execution phase is valid
706 if ((executionPhase &
707 HANDLED_RESOURCE_ATTRIBUTES_LIST[i].allowedPhaseMask) ==
709 // Attribute found, but execution state
710 // forbids to execute handler
712 "Request for attribute: '" <<
714 "' which is supported but forbidden " <<
715 "at widget execution phase: " << executionPhase);
718 // Execution phase allows handler
719 AttributeHandlerResponse attributeResponse =
720 (*HANDLED_RESOURCE_ATTRIBUTES_LIST[i].handler)(
724 std::copy(attributeResponse.begin(),
725 attributeResponse.end(),
726 std::back_inserter(*itr->second));
728 std::ostringstream attributeResponseFull;
730 for (AttributeHandlerResponse::const_iterator
731 it = attributeResponse.begin();
732 it != attributeResponse.end(); ++it) {
733 attributeResponseFull <<
734 (it == attributeResponse.begin() ? "" : ", ") <<
738 LogDebug("Attribute(" << attribute << ") = " <<
739 attributeResponseFull.str());
742 attributeFound = true;
747 if (!attributeFound) {
748 LogWarning("Request for attribute: '" << attribute <<
749 "' which is not supported");
755 int ResourceInformationImpl::getAttributesValues(const Request &request,
756 std::list<ATTRIBUTE>* attributes)
758 UNHANDLED_EXCEPTION_HANDLER_BEGIN
760 // Get current execution state
761 WidgetExecutionPhase executionPhase =
762 request.getExecutionPhase();
763 return getAttributesValuesLoop(request, attributes, executionPhase);
765 UNHANDLED_EXCEPTION_HANDLER_END
768 ResourceInformationImpl::ResourceInformationImpl()
773 * class OperationSystemImpl
776 int OperationSystemImpl::getAttributesValues(const Request &request,
777 std::list<ATTRIBUTE>* attributes)
779 UNHANDLED_EXCEPTION_HANDLER_BEGIN
782 //GetExecution name without widget name
783 WidgetExecutionPhase executionPhase =
784 request.getExecutionPhase();
786 FOREACH(itr, *attributes)
788 // Get attribute name
789 std::string attribute = *itr->first;
791 // Search for attribute handler
792 bool attributeFound = false;
794 for (size_t i = 0; i < HANDLED_ATTRIBUTES_LIST_COUNT; ++i) {
795 if (HANDLED_ATTRIBUTES_LIST[i].name == attribute) {
796 // Check if execution phase is valid
797 if ((executionPhase &
798 HANDLED_ATTRIBUTES_LIST[i].allowedPhaseMask) == 0) {
799 // Attribute found, but execution state forbids
800 // to execute handler
801 LogDebug("Request for attribute: '" << attribute <<
802 "' which is supported but forbidden at " <<
803 "widget execution phase: " << executionPhase);
806 // Execution phase allows handler
807 AttributeHandlerResponse attributeResponse =
808 (*HANDLED_ATTRIBUTES_LIST[i].handler)(
811 std::copy(attributeResponse.begin(),
812 attributeResponse.end(),
813 std::back_inserter(*itr->second));
815 std::ostringstream attributeResponseFull;
817 typedef AttributeHandlerResponse::const_iterator Iter;
818 FOREACH(it, attributeResponse)
820 attributeResponseFull <<
821 (it == attributeResponse.begin()
825 LogDebug("Attribute(" << attribute <<
826 ") = " << attributeResponseFull.str());
829 attributeFound = true;
834 if (!attributeFound) {
835 LogWarning("Request for attribute: '" << attribute <<
836 "' which is not supported");
842 UNHANDLED_EXCEPTION_HANDLER_END
845 OperationSystemImpl::OperationSystemImpl()
850 * end of class OperationSystemImpl
853 int FunctionParamImpl::getAttributesValues(const Request & /*request*/,
854 std::list<ATTRIBUTE> *attributes)
856 FOREACH(iter, *attributes)
858 std::string attributeName = *(iter->first);
860 ParamMap::const_iterator i;
861 std::pair<ParamMap::const_iterator, ParamMap::const_iterator> jj =
862 paramMap.equal_range(attributeName);
864 for (i = jj.first; i != jj.second; ++i) {
865 iter->second->push_back(i->second);
866 LogDebug("Attribute: " << attributeName << " Value: " <<