<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[TNF : Tatter Network Foundation forum - BlogAPI 중 mt.getPostCategories??]]></title>
		<link>http://forum.tattersite.com/ko/viewtopic.php?id=7257</link>
		<description><![CDATA[BlogAPI 중 mt.getPostCategories?? 의 최근 RSS 글들.]]></description>
		<lastBuildDate>Wed, 03 Dec 2008 17:16:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32458#p32458</link>
			<description><![CDATA[<p><a href="http://dev.textcube.org/ticket/1176">http://dev.textcube.org/ticket/1176</a><br />에서 진행하였습니다.</p><p>리턴되는 XML이 완전 오류였더군요. ^^; 감사합니다.</p>]]></description>
			<author><![CDATA[null@example.com (coolengineer)]]></author>
			<pubDate>Wed, 03 Dec 2008 17:16:29 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32458#p32458</guid>
		</item>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32434#p32434</link>
			<description><![CDATA[<p>넵. true..</p><p>php program에 익숙하지 않아 data type에 대한 개념이 없습니다. ^^</p>]]></description>
			<author><![CDATA[null@example.com (VentiAmericano)]]></author>
			<pubDate>Wed, 03 Dec 2008 01:51:30 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32434#p32434</guid>
		</item>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32432#p32432</link>
			<description><![CDATA[<p>감사합니다. 하위 개념은 없는 거 였군요...</p>]]></description>
			<author><![CDATA[null@example.com (VentiAmericano)]]></author>
			<pubDate>Wed, 03 Dec 2008 01:38:31 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32432#p32432</guid>
		</item>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32431#p32431</link>
			<description><![CDATA[<p>코드에서 isPrimary는 boolean입니다. true로 표기해 주세요.</p>]]></description>
			<author><![CDATA[null@example.com (gendoh)]]></author>
			<pubDate>Wed, 03 Dec 2008 01:37:26 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32431#p32431</guid>
		</item>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32430#p32430</link>
			<description><![CDATA[<p>mt에서 하위카테고리라는 개념은 없습니다. <br />&quot;여행&quot; 아래에 &quot;아시아&quot; 라고 있다면 &quot;여행/아시아&quot;라고 &quot;아시아&quot;항목을 출력하면 전혀 문제없습니다.</p>]]></description>
			<author><![CDATA[null@example.com (gendoh)]]></author>
			<pubDate>Wed, 03 Dec 2008 01:31:43 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32430#p32430</guid>
		</item>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32418#p32418</link>
			<description><![CDATA[<p>source 중에...&nbsp; library/model/blog.api.php를 보면 mt.getPostCategory(...)의 return으로 category id의 array만 리턴하는 것으로 되어 있습니다. (source line 894 version 1.7.6)</p><div class="codebox"><pre><code>function mt_getPostCategories()
{
        $params = func_get_args();
        $result = api_login( $params[1], $params[2] );
        if( $result )
        {
                return $result;
        }

        $post = new Post();
        $post-&gt;open( intval( $params[0] ) );

        $cat = array( $post-&gt;category );
        $post-&gt;close();


        return $cat;
}</code></pre></div><p>그런데, mt.getPostCategories()의 정의(http://www.sixapart.com/developers/xmlrpc/movable_type_api/mtgetpostcategories.html)에 따르면 return값은</p><p>{string categoryName, string categoryId, Boolean isPrimary}의 structure array로 정의 되어 있네요.</p><p>source 를</p><div class="codebox"><pre><code>function mt_getPostCategories()
{
        $params = func_get_args();
        $result = api_login( $params[1], $params[2] );
        if( $result )
        {
                return $result;
        }

        $post = new Post();
        $post-&gt;open( intval( $params[0] ) );

        $catId = array($post-&gt;category);
        $catName = api_getCategoryNameById( $post-&gt;category );

        $post-&gt;close();

        $returnCat = array(0);
        $returnCat[0] = array( &quot;categoryId&quot; = $catId, 
                                            &quot;categoryName&quot; = $catName,
                                            &quot;isPrimary&quot; = 1);


        return $returnCat;
}</code></pre></div><p>와 같이 리턴 값을 변경하니 에러 없이 잘 진행 됩니다....</p><p>계층으로 되어 있는 하위 분류의 경우는 어떻게 처리되는지 몰라서... 안되는군요.</p>]]></description>
			<author><![CDATA[null@example.com (VentiAmericano)]]></author>
			<pubDate>Tue, 02 Dec 2008 10:25:18 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32418#p32418</guid>
		</item>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32410#p32410</link>
			<description><![CDATA[<p>서비스쪽 코드는 설치형으로 넘어오는 프로세스가 없나요?</p>]]></description>
			<author><![CDATA[null@example.com (심민규)]]></author>
			<pubDate>Tue, 02 Dec 2008 06:16:07 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32410#p32410</guid>
		</item>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32403#p32403</link>
			<description><![CDATA[<p>그동네 리스판스 요구가 구려서 아마 XMLRPC 리턴쪽을 좀 많이 고친 기억이 있군요. 함수들 리턴도 전부 다시 검증하였습니다.<br />특히 stuct와 array를 PHP에서 구분하기 쉬운편은 아니라 트릭도 약간 썼구요.</p><p>~~~</p><p>서비스 이야깁니다. <img src="http://forum.tattersite.com/ko/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (gendoh)]]></author>
			<pubDate>Tue, 02 Dec 2008 03:09:02 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32403#p32403</guid>
		</item>
		<item>
			<title><![CDATA[RSS 답글: BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32397#p32397</link>
			<description><![CDATA[<p>코드를 보진 않았지만 <a href="http://www.sixapart.com/developers/xmlrpc/movable_type_api/mtgetpostcategories.html">해당 함수의 Movable Type API 명세</a>를 보니<br />텍스트큐브닷컴 쪽의 return이 맞는 것으로 보이는군요.<br />텍스트큐브(설치형) Movable Type API 구현을 살펴봐야 할 것 같습니다.</p><p>ps) 그러고보니 return value가 없는 점도 이상하네요.</p>]]></description>
			<author><![CDATA[null@example.com (심민규)]]></author>
			<pubDate>Mon, 01 Dec 2008 16:45:09 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32397#p32397</guid>
		</item>
		<item>
			<title><![CDATA[BlogAPI 중 mt.getPostCategories??]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=32384#p32384</link>
			<description><![CDATA[<p>맥에서 ecto를 블로그툴로 사용하려 하고 있습니다.</p><p>작성된 글을&nbsp; ecto로 불러오는 중 에러가 나서 콘솔출력을 보니 다음과 같더군요.</p><div class="codebox"><pre><code>&lt;methodName&gt;mt.getPostCategories&lt;/methodName&gt;
&lt;params&gt;
    &lt;param&gt;
        &lt;value&gt;&lt;string&gt;13&lt;/string&gt;&lt;/value&gt;
    &lt;/param&gt;
    &lt;param&gt;
        &lt;value&gt;&lt;string&gt;userid&lt;/string&gt;&lt;/value&gt;
    &lt;/param&gt;
    &lt;param&gt;
        &lt;value&gt;&lt;string&gt;password&lt;/string&gt;&lt;/value&gt;
    &lt;/param&gt;
&lt;/params&gt;
&lt;/methodCall&gt;</code></pre></div><p>에 대한 응답으로</p><div class="codebox"><pre><code>Response:
Status            : 200
X-Powered-By      : PHP/5.2.6
Expires           : Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control     : no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Keep-Alive        : timeout=15, max=99
Pragma            : no-cache
Server            : Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
Content-Type      : text/xml
Date              : Mon, 01 Dec 2008 04:20:20 GMT
Content-Length    : 198
Connection        : Keep-Alive

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;methodResponse&gt;
  &lt;params&gt;
    &lt;param&gt;
    &lt;value&gt;
             &lt;struct&gt;
             &lt;member&gt;
                   &lt;name&gt;0&lt;/name&gt;
                   &lt;value&gt;&lt;string&gt;&lt;/string&gt;&lt;/value&gt;
             &lt;/member&gt;
             &lt;/struct&gt;&lt;/value&gt;
    &lt;/param&gt;&lt;/params&gt;
&lt;/methodResponse&gt;</code></pre></div><p>이 부분에서 ecto가 에러를 냅니다. 그 이유가 뭔지는 모르겠지만, <strong>서버형 텍스트큐브</strong>의 경우 mt.getPostCategories의 response 는 </p><div class="quotebox"><blockquote><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />&lt;methodResponse&gt;<br />&nbsp; &lt;params&gt;<br />&nbsp; &nbsp; &nbsp;&lt;param&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value&gt; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>&lt;array&gt;</strong><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;data&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;struct&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;categoryId&lt;/name&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;&lt;string&gt;4871&lt;/string&gt;&lt;/value&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/member&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;member&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;name&gt;categoryName&lt;/name&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value&gt;&lt;string&gt;music&lt;/string&gt;&lt;/value&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/member&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;member&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;isPrimary&lt;/name&gt;&lt;value&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;boolean&gt;1&lt;/boolean&gt;&lt;/value&gt;&lt;/member&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/struct&gt;&lt;/value&gt;&lt;/data&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong>&lt;/array&gt;</strong>&lt;/value&gt;<br />&nbsp; &nbsp; &nbsp;&lt;/param&gt;&lt;/params&gt;&lt;/methodResponse&gt;</p></blockquote></div><p>와 같이 옵니다.</p><p>둘간의 차이는 서버형의 경우 response가 structure의 array 형태로 오는 것 같고, 설치형은 그냥 보내는 것 같습니다. 서버형의 경우 ecto가 에러 없이 잘 동작합니다.</p><p>이 차이 때문에 클라이언트가 에러를 내는 것일까요?</p>]]></description>
			<author><![CDATA[null@example.com (VentiAmericano)]]></author>
			<pubDate>Mon, 01 Dec 2008 05:15:10 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=32384#p32384</guid>
		</item>
	</channel>
</rss>
