upnpmediaserver/contentdirectoryservice/src/upnpelementfactory.cpp
changeset 32 3785f754ee62
parent 27 03808033c9a2
child 38 5360b7ddc251
equal deleted inserted replaced
27:03808033c9a2 32:3785f754ee62
   142 // -----------------------------------------------------------------------------
   142 // -----------------------------------------------------------------------------
   143 //
   143 //
   144 
   144 
   145 TUpnpErrorCode CUpnpElementFactory::ValidateNewObjectL( const TXmlEngElement& aNewElement, TBool aNew, TBool aLocalSharing)
   145 TUpnpErrorCode CUpnpElementFactory::ValidateNewObjectL( const TXmlEngElement& aNewElement, TBool aNew, TBool aLocalSharing)
   146 {
   146 {
       
   147     /*
   147     TInt i;    
   148     TInt i;    
   148     TPtrC8 objectType = KItem();
   149     TPtrC8 objectType = KItem();
   149 
   150 
   150     RXmlEngNodeList<TXmlEngElement> elements;
   151     RXmlEngNodeList<TXmlEngElement> elements;
   151     CleanupClosePushL(elements);
   152     CleanupClosePushL(elements);
   604     
   605     
   605     // now the object 
   606     // now the object 
   606     // * has the all required fields (if some were missing, they are added)
   607     // * has the all required fields (if some were missing, they are added)
   607     // * had a proper xml structure (_not_ using UpnpDomInterface:: functions that do not care)
   608     // * had a proper xml structure (_not_ using UpnpDomInterface:: functions that do not care)
   608     // * has for sure a mostly proper object structure 
   609     // * has for sure a mostly proper object structure 
   609 
   610 */
   610     return EUndefined;
   611     return EUndefined;
   611 }
   612 }
   612 // -----------------------------------------------------------------------------
   613 // -----------------------------------------------------------------------------
   613 // CUpnpElementFactory::ValidatePropertiesL()
   614 // CUpnpElementFactory::ValidatePropertiesL()
   614 // Function leaves on error.
   615 // Function leaves on error.
   921     {
   922     {
   922         TXmlEngElement root = aDocument.DocumentElement();
   923         TXmlEngElement root = aDocument.DocumentElement();
   923         RXmlEngNodeList<TXmlEngElement> children;
   924         RXmlEngNodeList<TXmlEngElement> children;
   924         CleanupClosePushL(children);
   925         CleanupClosePushL(children);
   925         root.GetChildElements( children );
   926         root.GetChildElements( children );
   926         children.HasNext();
   927     //    children.HasNext();
   927         CleanupStack::PopAndDestroy(&children);
   928         CleanupStack::PopAndDestroy(&children);
   928         return children.Next();
   929         return children.Next();
   929     }
   930     }
   930 }
   931 }
   931 
   932 
   941     TXmlEngElement active;
   942     TXmlEngElement active;
   942     RXmlEngDocument ret;
   943     RXmlEngDocument ret;
   943     ret.OpenL(iDOMImpl);
   944     ret.OpenL(iDOMImpl);
   944     CleanupClosePushL(ret);
   945     CleanupClosePushL(ret);
   945 
   946 
   946     if( aDocument.IsNull() || aDocument.DocumentElement().IsNull() )
   947  /*    if( aDocument.IsNull() || aDocument.DocumentElement().IsNull() )
   947     {
   948     {
   948         User::Leave( KErrNotFound );            
   949         User::Leave( KErrNotFound );            
   949     }
   950     }
   950         
   951         
   951     if ( aDocument.DocumentElement().Name().CompareF( KDidlLite() ) != 0 )
   952     if ( aDocument.DocumentElement().Name().CompareF( KDidlLite() ) != 0 )
   961         children.HasNext();
   962         children.HasNext();
   962         active = children.Next().Unlink().AsElement();
   963         active = children.Next().Unlink().AsElement();
   963         CleanupStack::PopAndDestroy(&children);
   964         CleanupStack::PopAndDestroy(&children);
   964     }
   965     }
   965     ret.SetDocumentElement(active);
   966     ret.SetDocumentElement(active);
   966     
   967    */    
   967     CleanupStack::Pop(&ret);
   968     CleanupStack::Pop(&ret);
   968     
   969     
   969     return ret;
   970     return ret;
   970 }
   971 }
   971 
   972 
  1207                 *objectFields[i] );
  1208                 *objectFields[i] );
  1208         CleanupStack::Check(tempBuffer);
  1209         CleanupStack::Check(tempBuffer);
  1209         // if such type found
  1210         // if such type found
  1210         if ( objectDescription.NotNull() ) 
  1211         if ( objectDescription.NotNull() ) 
  1211         {
  1212         {
  1212             aArray.Append( objectDescription );
  1213             aArray.AppendL( objectDescription );
  1213         }
  1214         }
  1214         /* This case is valid for any numeric value of containerID used in CreateObject() action
  1215         /* This case is valid for any numeric value of containerID used in CreateObject() action
  1215         *  We do some checking starting from 3rd string of <upnp:class> element, if the string isn't
  1216         *  We do some checking starting from 3rd string of <upnp:class> element, if the string isn't
  1216         *  recognizable, instead of leaving, we trims the value of <upnp:class> element, e.g:
  1217         *  recognizable, instead of leaving, we trims the value of <upnp:class> element, e.g:
  1217         *  'object.item.imageItem.abcd' -> is trimmed into -> 'object.item.imageItem'
  1218         *  'object.item.imageItem.abcd' -> is trimmed into -> 'object.item.imageItem'