[Dev] [APIM] - Required parameters for add documentation to an API with the source type File

2015-09-16 Thread Bhagya Dimenguwari
Hi,

I tried to add new document to an API with the Source Type "File". I used
the requested parameters as [1] referring firebug  information [2] and it
does not allow to add the document and got the exception [3].

I am going to test Integration test by referring test case - *APIM2-622:Add
documentation to an API [ sample & SDK | File ] through the publisher REST
api* in test link

*.*
Are there any document to refer for add a new file through the REST Api?


[1]

action=addDocumentation=admin=APIM620PublisherTest=1.0.0=APIM622PublisherTestHowTo-File-summary=samples=file=http://==Testingfilename="filters.txt;
Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
-org.wso2.carbon.caching.core.permissiontree.*
-org.wso2.carbon.caching.infinispan.*
-org.wso2.carbon.event.core.internal.delivery.jms.*
-org.wso2.carbon.event.core.qpid.*
-org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
-org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
-org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
-org.wso2.carbon.apimgt.keymgt.service.thrift.*
-org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
-org.wso2.carbon.throttle.module.utils.*
-org.wso2.carbon.throttle.module.utils.impl.*
-org.wso2.carbon.throttle.module.handler.*
-org.wso2.carbon.throttle.core.impl.domainbase.*
-org.wso2.carbon.throttle.module.*
-org.wso2.carbon.throttle.core.impl.ipbase.*
-org.wso2.uri.template.parser.*=text/plain=samples=file

[2]

-95753468186848783342988543
Content-Disposition: form-data; name="mode"
-95753468186848783342988543
Content-Disposition: form-data; name="docUrl" http://
-95753468186848783342988543
Content-Disposition: form-data; name="sourceType" file
-95753468186848783342988543
Content-Disposition: form-data; name="summary" add new doc
-95753468186848783342988543
Content-Disposition: form-data; name="docType" samples
-95753468186848783342988543
Content-Disposition: form-data; name="docName" filterdoc
-95753468186848783342988543
Content-Disposition: form-data; name="version" 1.1.2
-95753468186848783342988543
Content-Disposition: form-data; name="apiName" APIM1234
-95753468186848783342988543
Content-Disposition: form-data; name="action" addDocumentation
-95753468186848783342988543
Content-Disposition: form-data; name="provider" admin
-95753468186848783342988543
Content-Disposition: form-data; name="mimeType" text/plain
-95753468186848783342988543
Content-Disposition: form-data; name="optionsRadios" samples
-95753468186848783342988543
Content-Disposition: form-data; name="optionsRadios1" file
-95753468186848783342988543
Content-Disposition: form-data; name="docLocation"; filename="filters.txt"
Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
-org.wso2.carbon.caching.core.permissiontree.*
-org.wso2.carbon.caching.infinispan.*
-org.wso2.carbon.event.core.internal.delivery.jms.*
-org.wso2.carbon.event.core.qpid.*
-org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
-org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
-org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
-org.wso2.carbon.apimgt.keymgt.service.thrift.*
-org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
-org.wso2.carbon.throttle.module.utils.*
-org.wso2.carbon.throttle.module.utils.impl.*
-org.wso2.carbon.throttle.module.handler.*
-org.wso2.carbon.throttle.core.impl.domainbase.*
-org.wso2.carbon.throttle.module.*
-org.wso2.carbon.throttle.core.impl.ipbase.* -org.wso2.uri.template.parser.*

[3]

hPublisherRestAPITestCase.testAddDocumentToAnAPIHowToFile 

INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- [2015-09-16 11:24:34,175] ERROR - APIProviderHostObject Error while
creating an attachment for Document-
APIM622PublisherTestHowTo-File-summary-1.0.0. Empty File Attachment.

INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- org.wso2.carbon.apimgt.api.APIManagementException: Empty File Attachment.

INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- at
org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addDocumentation(APIProviderHostObject.java:2990)


INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)


INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- at

Re: [Dev] [APIM] - Required parameters for add documentation to an API with the source type File

2015-09-16 Thread Lakshman Udayakantha
Hi Saneth,

to upload the file for documentation use this command

curl -X POST -b cookies
http://localhost:9774/publisher/site/blocks/documentation/ajax/docs.jag -F
"action=addDocumentation" -F "provider=admin" -F "apiName=testAPi" -F
"version=1.0.0" -F "docName=testDoc2" -F "docType=how to" -F
"sourceType=file" -F "docUrl=" -F "summary=testing" -F
"docLocation=@test.txt"

here test.txt is the document. you can add the file path there with @.


Thanks

On Wed, Sep 16, 2015 at 1:30 PM, Saneth Dharmakeerthi 
wrote:

> HI Madusanka,
>
> We have referred that document and it contains how to add inline
> document,  its working fine, problem is how to add a .txt file or a .pdf
> using  the REST API.
>
> Thanks and Best Regards,
>
> Saneth Dharmakeerthi
> Senior Software Engineer
> WSO2, Inc.
> Mobile: +94772325511
>
> On Wed, Sep 16, 2015 at 1:04 PM, Madusanka Premaratne  > wrote:
>
>> Hi Bhagya,
>> Did you try WSO2 Publisher APIs[1]. Find Add/Update API Document in the
>> link
>>
>> [1] - https://docs.wso2.com/display/AM191/Publisher+APIs
>>
>> Thanks,
>> Madusanka
>>
>> On Wed, Sep 16, 2015 at 12:11 PM, Bhagya Dimenguwari 
>> wrote:
>>
>>> Hi,
>>>
>>> I tried to add new document to an API with the Source Type "File". I
>>> used the requested parameters as [1] referring firebug  information [2] and
>>> it does not allow to add the document and got the exception [3].
>>>
>>> I am going to test Integration test by referring test case - *APIM2-622:Add
>>> documentation to an API [ sample & SDK | File ] through the publisher REST
>>> api* in test link
>>>
>>> *.*
>>> Are there any document to refer for add a new file through the REST Api?
>>>
>>>
>>> [1]
>>>
>>>
>>> action=addDocumentation=admin=APIM620PublisherTest=1.0.0=APIM622PublisherTestHowTo-File-summary=samples=file=http://==Testingfilename="filters.txt;
>>> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
>>> -org.wso2.carbon.caching.core.permissiontree.*
>>> -org.wso2.carbon.caching.infinispan.*
>>> -org.wso2.carbon.event.core.internal.delivery.jms.*
>>> -org.wso2.carbon.event.core.qpid.*
>>> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
>>> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
>>> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
>>> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
>>> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
>>> -org.wso2.carbon.throttle.module.utils.*
>>> -org.wso2.carbon.throttle.module.utils.impl.*
>>> -org.wso2.carbon.throttle.module.handler.*
>>> -org.wso2.carbon.throttle.core.impl.domainbase.*
>>> -org.wso2.carbon.throttle.module.*
>>> -org.wso2.carbon.throttle.core.impl.ipbase.*
>>> -org.wso2.uri.template.parser.*=text/plain=samples=file
>>>
>>> [2]
>>>
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="mode"
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="docUrl" http://
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="sourceType" file
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="summary" add new doc
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="docType" samples
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="docName" filterdoc
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="version" 1.1.2
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="apiName" APIM1234
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="action" addDocumentation
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="provider" admin
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="mimeType" text/plain
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="optionsRadios" samples
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="optionsRadios1" file
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="docLocation"; filename="filters.txt"
>>> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
>>> -org.wso2.carbon.caching.core.permissiontree.*
>>> -org.wso2.carbon.caching.infinispan.*
>>> -org.wso2.carbon.event.core.internal.delivery.jms.*
>>> -org.wso2.carbon.event.core.qpid.*
>>> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
>>> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
>>> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
>>> 

Re: [Dev] [APIM] - Required parameters for add documentation to an API with the source type File

2015-09-16 Thread Saneth Dharmakeerthi
HI Madusanka,

We have referred that document and it contains how to add inline document,
 its working fine, problem is how to add a .txt file or a .pdf using  the
REST API.

Thanks and Best Regards,

Saneth Dharmakeerthi
Senior Software Engineer
WSO2, Inc.
Mobile: +94772325511

On Wed, Sep 16, 2015 at 1:04 PM, Madusanka Premaratne 
wrote:

> Hi Bhagya,
> Did you try WSO2 Publisher APIs[1]. Find Add/Update API Document in the
> link
>
> [1] - https://docs.wso2.com/display/AM191/Publisher+APIs
>
> Thanks,
> Madusanka
>
> On Wed, Sep 16, 2015 at 12:11 PM, Bhagya Dimenguwari 
> wrote:
>
>> Hi,
>>
>> I tried to add new document to an API with the Source Type "File". I used
>> the requested parameters as [1] referring firebug  information [2] and it
>> does not allow to add the document and got the exception [3].
>>
>> I am going to test Integration test by referring test case - *APIM2-622:Add
>> documentation to an API [ sample & SDK | File ] through the publisher REST
>> api* in test link
>>
>> *.*
>> Are there any document to refer for add a new file through the REST Api?
>>
>>
>> [1]
>>
>>
>> action=addDocumentation=admin=APIM620PublisherTest=1.0.0=APIM622PublisherTestHowTo-File-summary=samples=file=http://==Testingfilename="filters.txt;
>> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
>> -org.wso2.carbon.caching.core.permissiontree.*
>> -org.wso2.carbon.caching.infinispan.*
>> -org.wso2.carbon.event.core.internal.delivery.jms.*
>> -org.wso2.carbon.event.core.qpid.*
>> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
>> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
>> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
>> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
>> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
>> -org.wso2.carbon.throttle.module.utils.*
>> -org.wso2.carbon.throttle.module.utils.impl.*
>> -org.wso2.carbon.throttle.module.handler.*
>> -org.wso2.carbon.throttle.core.impl.domainbase.*
>> -org.wso2.carbon.throttle.module.*
>> -org.wso2.carbon.throttle.core.impl.ipbase.*
>> -org.wso2.uri.template.parser.*=text/plain=samples=file
>>
>> [2]
>>
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="mode"
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="docUrl" http://
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="sourceType" file
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="summary" add new doc
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="docType" samples
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="docName" filterdoc
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="version" 1.1.2
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="apiName" APIM1234
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="action" addDocumentation
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="provider" admin
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="mimeType" text/plain
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="optionsRadios" samples
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="optionsRadios1" file
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="docLocation"; filename="filters.txt"
>> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
>> -org.wso2.carbon.caching.core.permissiontree.*
>> -org.wso2.carbon.caching.infinispan.*
>> -org.wso2.carbon.event.core.internal.delivery.jms.*
>> -org.wso2.carbon.event.core.qpid.*
>> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
>> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
>> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
>> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
>> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
>> -org.wso2.carbon.throttle.module.utils.*
>> -org.wso2.carbon.throttle.module.utils.impl.*
>> -org.wso2.carbon.throttle.module.handler.*
>> -org.wso2.carbon.throttle.core.impl.domainbase.*
>> -org.wso2.carbon.throttle.module.*
>> -org.wso2.carbon.throttle.core.impl.ipbase.* -org.wso2.uri.template.parser.*
>>
>> [3]
>>
>> hPublisherRestAPITestCase.testAddDocumentToAnAPIHowToFile 
>>
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> [2015-09-16 11:24:34,175] ERROR - APIProviderHostObject 

Re: [Dev] [APIM] - Required parameters for add documentation to an API with the source type File

2015-09-16 Thread Madusanka Premaratne
Hi Bhagya,
Did you try WSO2 Publisher APIs[1]. Find Add/Update API Document in the link

[1] - https://docs.wso2.com/display/AM191/Publisher+APIs

Thanks,
Madusanka

On Wed, Sep 16, 2015 at 12:11 PM, Bhagya Dimenguwari 
wrote:

> Hi,
>
> I tried to add new document to an API with the Source Type "File". I used
> the requested parameters as [1] referring firebug  information [2] and it
> does not allow to add the document and got the exception [3].
>
> I am going to test Integration test by referring test case - *APIM2-622:Add
> documentation to an API [ sample & SDK | File ] through the publisher REST
> api* in test link
>
> *.*
> Are there any document to refer for add a new file through the REST Api?
>
>
> [1]
>
>
> action=addDocumentation=admin=APIM620PublisherTest=1.0.0=APIM622PublisherTestHowTo-File-summary=samples=file=http://==Testingfilename="filters.txt;
> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
> -org.wso2.carbon.caching.core.permissiontree.*
> -org.wso2.carbon.caching.infinispan.*
> -org.wso2.carbon.event.core.internal.delivery.jms.*
> -org.wso2.carbon.event.core.qpid.*
> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
> -org.wso2.carbon.throttle.module.utils.*
> -org.wso2.carbon.throttle.module.utils.impl.*
> -org.wso2.carbon.throttle.module.handler.*
> -org.wso2.carbon.throttle.core.impl.domainbase.*
> -org.wso2.carbon.throttle.module.*
> -org.wso2.carbon.throttle.core.impl.ipbase.*
> -org.wso2.uri.template.parser.*=text/plain=samples=file
>
> [2]
>
> -95753468186848783342988543
> Content-Disposition: form-data; name="mode"
> -95753468186848783342988543
> Content-Disposition: form-data; name="docUrl" http://
> -95753468186848783342988543
> Content-Disposition: form-data; name="sourceType" file
> -95753468186848783342988543
> Content-Disposition: form-data; name="summary" add new doc
> -95753468186848783342988543
> Content-Disposition: form-data; name="docType" samples
> -95753468186848783342988543
> Content-Disposition: form-data; name="docName" filterdoc
> -95753468186848783342988543
> Content-Disposition: form-data; name="version" 1.1.2
> -95753468186848783342988543
> Content-Disposition: form-data; name="apiName" APIM1234
> -95753468186848783342988543
> Content-Disposition: form-data; name="action" addDocumentation
> -95753468186848783342988543
> Content-Disposition: form-data; name="provider" admin
> -95753468186848783342988543
> Content-Disposition: form-data; name="mimeType" text/plain
> -95753468186848783342988543
> Content-Disposition: form-data; name="optionsRadios" samples
> -95753468186848783342988543
> Content-Disposition: form-data; name="optionsRadios1" file
> -95753468186848783342988543
> Content-Disposition: form-data; name="docLocation"; filename="filters.txt"
> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
> -org.wso2.carbon.caching.core.permissiontree.*
> -org.wso2.carbon.caching.infinispan.*
> -org.wso2.carbon.event.core.internal.delivery.jms.*
> -org.wso2.carbon.event.core.qpid.*
> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
> -org.wso2.carbon.throttle.module.utils.*
> -org.wso2.carbon.throttle.module.utils.impl.*
> -org.wso2.carbon.throttle.module.handler.*
> -org.wso2.carbon.throttle.core.impl.domainbase.*
> -org.wso2.carbon.throttle.module.*
> -org.wso2.carbon.throttle.core.impl.ipbase.* -org.wso2.uri.template.parser.*
>
> [3]
>
> hPublisherRestAPITestCase.testAddDocumentToAnAPIHowToFile 
>
> INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
> - [2015-09-16 11:24:34,175] ERROR - APIProviderHostObject Error while
> creating an attachment for Document-
> APIM622PublisherTestHowTo-File-summary-1.0.0. Empty File Attachment.
>
> INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
> - org.wso2.carbon.apimgt.api.APIManagementException: Empty File Attachment.
>
> INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
> - at
>