简体   繁体   English

PHP Drupal 6 XMLRPC调用

[英]PHP Drupal 6 XMLRPC calls

Using XMLRPC I'm attempting to see if the node table and two custom tables contain specific values. 我正在尝试使用XMLRPC查看节点表和两个自定义表是否包含特定值。 I'm not looking for a coding solution, just general code tips on function calls to use with parameters. 我不是在寻找编码解决方案,而只是在函数调用中使用参数的通用代码提示。

Three tables. 三张桌子。 dp_node dp_content_type_artists dp_content_field_vid_url dp_node dp_content_type_artists dp_content_field_vid_url

The general logic is take a title and a artist name. 一般逻辑是采用标题和艺术家名称。 See if the combination of title (song title) and artist name exists. 查看标题(歌曲标题)和歌手姓名的组合是否存在。 If it does replace the vid_url value with the new video url otherwise insert. 如果确实如此,请用新的视频网址替换vid_url值,否则插入。 Lets use Bob Dylan as the artist and Rainy Day Women as the song title. 让我们以鲍勃·迪伦(Bob Dylan)为艺术家,以雨天女性(Rainday Day Women)为歌名。

My question is this. 我的问题是这个。 Using the assumption that node.get is the right procedure to use, how would I filter to get the title from dp_node AND the artist from dp_content_type_artist. 假设使用node.get是正确的过程,我将如何过滤以从dp_node获取标题,并从dp_content_type_artist获得艺术家。

  $node = 35764;
  $drupal->call('node.get',$node, array());

The above gets a node, I just haven't be able to figure out how to filter on title and artist name. 上面有一个节点,我只是无法弄清楚如何过滤标题和艺术家姓名。

node.get isn't the correct procedure I'm afraid, it only has the ability to return a single node. node.get不是正确的过程,它只能返回单个节点。 You can see this for yourself if you look in sites/all/modules/services/node_service/node_service.module , at the node_service_service() function. 如果您在node_service_service()函数中查看sites/all/modules/services/node_service/node_service.module ,则可以自己查看。

There's a search_service module included with Services v2 (which I guess you're using as node.get has actually been removed from Services v3) that will allow you to do a text search for content but there's no explicit in-built functionality to get a list of nodes with a filter. Services v2附带了一个search_service模块(我想您实际上node.get它用作node.get从Services v3中删除了),该模块将允许您对内容进行文本搜索,但是没有显式的内置功能来获取内容。带有过滤器的节点列表。

Having said that, there is a views_service module also included which I think is the one you should be using. 话虽如此,这里还包含一个views_service模块,我认为这是您应该使用的模块。 I haven't used it before but I'd guess that you create a View in Drupal that filters your nodes based on your required parameters, and then call that view with those parameters from your XMLRPC client. 我以前没有使用过它,但是我猜您在Drupal中创建了一个视图,该视图根据所需的参数过滤节点,然后从XMLRPC客户端使用这些参数调用该视图。

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM