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();
430 LogDebug("device caps set contains");
433 LogDebug("-> " << *dc);
439 lambdaCollectionPusher<std::string>(response));
443 // We should return list of device-caps required by resourceId.
444 // AttributeHandlerResponse response;
446 // FeatureHandleList fHandleList =
447 // getFeatureHandleList(widgetHandle, resourceId);
448 // if( !fHandleList.empty() )
450 // FeatureDAO feature( resourceId );
451 // std::set<std::string> deviceCapLast =
452 // feature.GetDeviceCapabilities();
454 // deviceCapList.begin(),
455 // deviceCapList.end(),
456 // lambdaCollectionPusher<DeviceCapList::value_type>(
462 class lambdaFeatureEquality :
463 public std::binary_function<FeatureHandle, int, bool>
466 bool operator()(const FeatureHandle& wFeature,
467 const int& resurceId) const
469 return wFeature == resurceId;
473 class lambdaPushFeatureName :
474 public std::binary_function<WidgetFeature, AttributeHandlerResponse, void>
476 void operator()(const WidgetFeature& wFeature,
477 AttributeHandlerResponse& response) const
479 response.push_back(DPL::ToUTF8String(wFeature.name));
483 AttributeHandlerResponse AttributeApiFeatureHandler(
484 const WidgetExecutionPhase & /* phase */,
485 const WidgetHandle & /* widgetHandle */,
486 const Request & /* request */)
488 LogDebug("WAC 2.0 does not support api-feature and resource-id in policy.");
489 AttributeHandlerResponse response;
491 // Wrt shouldn't ask about resource which is not listed in
492 // (widget) config.xml file
494 // AttributeHandlerResponse response;
495 // WidgetDAOReadOnly widgetDAO(widgetHandle);
496 // WidgetFeatureSet wFeatureSet = widgetDAO.GetFeaturesList();
497 // std::string featureName = resourceId;
498 // WidgetFeatureSet::iterator foundFeatures =
499 // std::find_if(wFeatureSet.begin(),
500 // wFeatureSet.end(),
501 // std::bind2nd(lambdaWidgetPrefixEquality(),
504 // while( foundFeatures != wFeatureSet.end() )
506 // response.push_back( foundFeatures->name );
507 // LogDebug("Found feature: " << foundFeatures->name );
514 typedef std::string (FeatureDAOReadOnly::*FNMETHOD)() const;
516 AttributeHandlerResponse GetFeatureAttributeGroup(const WidgetExecutionPhase & /*phase*/,
517 const WidgetHandle &widgetHandle,
518 const std::string& resourceId,
521 AttributeHandlerResponse response;
522 FeatureHandleList fHandleList =
523 getFeatureHandleList(widgetHandle, resourceId);
524 if (!fHandleList.empty()) {
525 FeatureDAOReadOnly featureDAO(fHandleList.front());
526 std::string attribute = (featureDAO.*function)();
527 response.push_back(attribute);
532 AttributeHandlerResponse AttributeFeatureInstallUriHandler(
533 const WidgetExecutionPhase & /* phase */,
534 const WidgetHandle & /* widgetHandle */,
535 const Request & /* request */)
537 LogDebug("WAC 2.0 does not support feature-install-uri is policy!");
538 AttributeHandlerResponse response;
542 AttributeHandlerResponse AttributeFeatureFeatureKeyCnHandler(
543 const WidgetExecutionPhase & /* phase */,
544 const WidgetHandle & /* widgetHandle */,
545 const Request & /* request */)
547 LogDebug("WAC 2.0 does not support feature-key-cn is policy!");
548 AttributeHandlerResponse response;
552 AttributeHandlerResponse AttributeFeatureKeyRootCnHandler(
553 const WidgetExecutionPhase & /* phase */,
554 const WidgetHandle & /* widgetHandle */,
555 const Request & /* request */)
557 LogDebug("WAC 2.0 does not support feature-key-root-cn is policy!");
558 AttributeHandlerResponse response;
562 AttributeHandlerResponse AttributeFeatureKeyRootFingerprintHandler(
563 const WidgetExecutionPhase & /* phase */,
564 const WidgetHandle & /* widgetHandle */,
565 const Request & /* request */)
567 LogDebug("WAC 2.0 does not support"
568 " feature-key-root-fingerprint is policy!");
569 AttributeHandlerResponse response;
573 struct ResourceAttributeHandlerContext
576 WidgetExecutionPhase allowedPhaseMask;
577 ResourceAttributeHandler handler;
580 #define ALL_PHASE(name, handler) \
581 { # name, WidgetExecutionPhase_All, handler },
583 ResourceAttributeHandlerContext HANDLED_RESOURCE_ATTRIBUTES_LIST[] = {
584 ALL_PHASE(device-cap, &AttributeDeviceCapHandler)
585 ALL_PHASE(api-feature, &AttributeApiFeatureHandler)
586 // For compatiblity with older policies we tread resource-id
587 // identically as api-feature
588 ALL_PHASE(resource-id, &AttributeApiFeatureHandler)
590 ALL_PHASE(feature-install-uri, &AttributeFeatureInstallUriHandler)
591 ALL_PHASE(feature-key-cn, &AttributeFeatureFeatureKeyCnHandler)
592 ALL_PHASE(feature-key-root-cn, &AttributeFeatureKeyRootCnHandler)
593 ALL_PHASE(feature-key-root-fingerprint,
594 &AttributeFeatureKeyRootFingerprintHandler)
599 const size_t HANDLED_RESOURCE_ATTRIBUTES_LIST_COUNT =
600 sizeof(HANDLED_RESOURCE_ATTRIBUTES_LIST) /
601 sizeof(HANDLED_RESOURCE_ATTRIBUTES_LIST[0]);
602 } // namespace anonymous
605 * class WebRuntimeImpl
607 int WebRuntimeImpl::getAttributesValuesLoop(const Request &request,
608 std::list<ATTRIBUTE>* attributes,
609 WidgetExecutionPhase executionPhase)
611 UNHANDLED_EXCEPTION_HANDLER_BEGIN
613 WidgetHandle widgetHandle = request.getWidgetHandle();
615 FOREACH(itr, *attributes)
617 // Get attribute name
618 std::string attribute = *itr->first;
620 // Search for attribute handler
621 bool attributeFound = false;
623 for (size_t i = 0; i < HANDLED_ATTRIBUTES_LIST_COUNT; ++i) {
624 if (HANDLED_ATTRIBUTES_LIST[i].name == attribute) {
625 // Check if execution phase is valid
626 if ((executionPhase &
627 HANDLED_ATTRIBUTES_LIST[i].allowedPhaseMask) == 0) {
628 // Attribute found, but execution state
629 // forbids to execute handler
631 "Request for attribute: '" <<
632 attribute << "' which is supported " <<
633 "but forbidden at widget execution phase: "
637 // Execution phase allows handler
638 AttributeHandlerResponse attributeResponse =
639 (*HANDLED_ATTRIBUTES_LIST[i].handler)(
642 std::copy(attributeResponse.begin(),
643 attributeResponse.end(),
644 std::back_inserter(*itr->second));
647 attributeFound = true;
652 if (!attributeFound) {
653 LogWarning("Request for attribute: '" <<
654 attribute << "' which is not supported");
660 UNHANDLED_EXCEPTION_HANDLER_END
663 int WebRuntimeImpl::getAttributesValues(const Request &request,
664 std::list<ATTRIBUTE>* attributes)
666 UNHANDLED_EXCEPTION_HANDLER_BEGIN
668 // Get current execution state
669 WidgetExecutionPhase executionPhase =
670 request.getExecutionPhase();
672 return getAttributesValuesLoop(request, attributes, executionPhase);
674 UNHANDLED_EXCEPTION_HANDLER_END
677 std::string WebRuntimeImpl::getSessionId(const Request & /* request */)
680 LogError("Not implemented!");
684 WebRuntimeImpl::WebRuntimeImpl()
689 * class ResourceInformationImpl
692 int ResourceInformationImpl::getAttributesValuesLoop(const Request &request,
693 std::list<ATTRIBUTE>* attributes,
694 WidgetExecutionPhase executionPhase)
696 // Currently, we assume widgets have internal representation of integer IDs
697 WidgetHandle widgetHandle = request.getWidgetHandle();
698 //TODO add resource id string analyzys
699 FOREACH(itr, *attributes)
701 // Get attribute name
702 std::string attribute = *itr->first;
703 LogDebug("getting attribute value for: " << attribute);
704 FOREACH(aaa, *itr->second)
706 LogDebug("its value is: " << *aaa);
709 // Search for attribute handler
710 bool attributeFound = false;
712 for (size_t i = 0; i < HANDLED_RESOURCE_ATTRIBUTES_LIST_COUNT; ++i) {
713 if (HANDLED_RESOURCE_ATTRIBUTES_LIST[i].name == attribute) {
714 // Check if execution phase is valid
715 if ((executionPhase &
716 HANDLED_RESOURCE_ATTRIBUTES_LIST[i].allowedPhaseMask) ==
718 // Attribute found, but execution state
719 // forbids to execute handler
721 "Request for attribute: '" <<
723 "' which is supported but forbidden " <<
724 "at widget execution phase: " << executionPhase);
727 // Execution phase allows handler
728 AttributeHandlerResponse attributeResponse =
729 (*HANDLED_RESOURCE_ATTRIBUTES_LIST[i].handler)(
733 std::copy(attributeResponse.begin(),
734 attributeResponse.end(),
735 std::back_inserter(*itr->second));
737 std::ostringstream attributeResponseFull;
739 for (AttributeHandlerResponse::const_iterator
740 it = attributeResponse.begin();
741 it != attributeResponse.end(); ++it) {
742 attributeResponseFull <<
743 (it == attributeResponse.begin() ? "" : ", ") <<
747 LogDebug("Attribute(" << attribute << ") = " <<
748 attributeResponseFull.str());
751 attributeFound = true;
756 if (!attributeFound) {
757 LogWarning("Request for attribute: '" << attribute <<
758 "' which is not supported");
764 int ResourceInformationImpl::getAttributesValues(const Request &request,
765 std::list<ATTRIBUTE>* attributes)
767 UNHANDLED_EXCEPTION_HANDLER_BEGIN
769 // Get current execution state
770 WidgetExecutionPhase executionPhase =
771 request.getExecutionPhase();
772 return getAttributesValuesLoop(request, attributes, executionPhase);
774 UNHANDLED_EXCEPTION_HANDLER_END
777 ResourceInformationImpl::ResourceInformationImpl()
782 * class OperationSystemImpl
785 int OperationSystemImpl::getAttributesValues(const Request &request,
786 std::list<ATTRIBUTE>* attributes)
788 UNHANDLED_EXCEPTION_HANDLER_BEGIN
791 //GetExecution name without widget name
792 WidgetExecutionPhase executionPhase =
793 request.getExecutionPhase();
795 FOREACH(itr, *attributes)
797 // Get attribute name
798 std::string attribute = *itr->first;
800 // Search for attribute handler
801 bool attributeFound = false;
803 for (size_t i = 0; i < HANDLED_ATTRIBUTES_LIST_COUNT; ++i) {
804 if (HANDLED_ATTRIBUTES_LIST[i].name == attribute) {
805 // Check if execution phase is valid
806 if ((executionPhase &
807 HANDLED_ATTRIBUTES_LIST[i].allowedPhaseMask) == 0) {
808 // Attribute found, but execution state forbids
809 // to execute handler
810 LogDebug("Request for attribute: '" << attribute <<
811 "' which is supported but forbidden at " <<
812 "widget execution phase: " << executionPhase);
815 // Execution phase allows handler
816 AttributeHandlerResponse attributeResponse =
817 (*HANDLED_ATTRIBUTES_LIST[i].handler)(
820 std::copy(attributeResponse.begin(),
821 attributeResponse.end(),
822 std::back_inserter(*itr->second));
824 std::ostringstream attributeResponseFull;
826 typedef AttributeHandlerResponse::const_iterator Iter;
827 FOREACH(it, attributeResponse)
829 attributeResponseFull <<
830 (it == attributeResponse.begin()
834 LogDebug("Attribute(" << attribute <<
835 ") = " << attributeResponseFull.str());
838 attributeFound = true;
843 if (!attributeFound) {
844 LogWarning("Request for attribute: '" << attribute <<
845 "' which is not supported");
851 UNHANDLED_EXCEPTION_HANDLER_END
854 OperationSystemImpl::OperationSystemImpl()
859 * end of class OperationSystemImpl
862 int FunctionParamImpl::getAttributesValues(const Request & /*request*/,
863 std::list<ATTRIBUTE> *attributes)
865 FOREACH(iter, *attributes)
867 std::string attributeName = *(iter->first);
869 ParamMap::const_iterator i;
870 std::pair<ParamMap::const_iterator, ParamMap::const_iterator> jj =
871 paramMap.equal_range(attributeName);
873 for (i = jj.first; i != jj.second; ++i) {
874 iter->second->push_back(i->second);
875 LogDebug("Attribute: " << attributeName << " Value: " <<