Re: [Dev] Dynamic zip file download from Jaggery application

2016-10-17 Thread Chathura Dilan
Hi Godwin,

Yes, Jaggery File API is only working within Jaggery app context according
to documentation. so you will have to read it from Java and pass it to
jaggery. That's how we are doing with mobile apps.

On Mon, Oct 17, 2016 at 6:57 PM, Godwin Shrimal  wrote:

> Hi Chathura,
>
>
>
> Yes there is a better approach than  save those files in the jaggery app
>> itself. This is mainly because jaggery app is getting bulky, difficult for
>> clustering, and less security.
>>
>> What we have done for mobile app is store them in a secured place such as
>> /repository/resources/mobileapps (as the default location) with an
>> arbitrary name. It can be configurable to any location in the file system
>> or the network.
>>
>> That file can be read from its physical location using Java and and get
>> an input stream via Jaggery for download or you can directly read it from
>> Jaggery.
>>
>
> As per the offline discussion had with Senthuja and Nisal, we cannot
> access location such as /repository/resources/mobileapps from Jaggery.
>
>
> Thanks
> Godwin
>
>
>
>
>>
>> On Mon, Oct 17, 2016 at 6:27 PM, Dinusha Senanayaka 
>> wrote:
>>
>>> We have done something similar in AppM for mobile apps where publisher
>>> uploads binary (.apk etc) and users comes to store install these apps to
>>> device.  Download has handled as a byte stream and storage location is
>>> stored in property of app-manger.xml (${carbon.ho
>>> me}/repository/resources/mobileapps/) and HostObject
>>> method has been provided to get the location.
>>>
>>> @Chathura should be able to explain the logic more since he implemented
>>> this.
>>>
>>> Regards,
>>> Dinusha.
>>>
>>> On Mon, Oct 17, 2016 at 6:06 PM, Godwin Shrimal  wrote:
>>>
 Hi All,

 We need to dynamically create zip file and allow download it from
 jaggery application. For resolve the concurrent access of the system, we
 are going to create a directory with the time-stamp and archive that
 directory and allow user to download it. Then we need to create a separate
 cleanup task to clean those directories and archive files.

 We can create above zip files in jaggery application level (ex.
 jaggery/dashboard/resource/) and create a cleanup task in OSGI level to
 delete the files/directories periodically. Here we need to keep a configure
 to find the jaggery application context from OSGI level.

 Do we have a better approach for this or is it fine to use a
 configuration for particular jaggery context ?

 Thanks
 Godwin

 --
 *Godwin Amila Shrimal*
 Senior Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *http://lnkd.in/KUum6D *
 twitter: https://twitter.com/godwinamila
 

>>>
>>>
>>>
>>> --
>>> Dinusha Dilrukshi
>>> Associate Technical Lead
>>> WSO2 Inc.: http://wso2.com/
>>> Mobile: +94725255071
>>> Blog: http://dinushasblog.blogspot.com/
>>>
>>
>>
>>
>> --
>> Regards,
>>
>> Chatura Dilan Perera
>> *Associate Tech Lead** - WSO2 Inc.*
>> www.dilan.me
>>
>
>
>
> --
> *Godwin Amila Shrimal*
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94772264165*
> linkedin: *http://lnkd.in/KUum6D *
> twitter: https://twitter.com/godwinamila
> 
>



-- 
Regards,

Chatura Dilan Perera
*Associate Tech Lead** - WSO2 Inc.*
www.dilan.me
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dynamic zip file download from Jaggery application

2016-10-17 Thread Godwin Shrimal
Hi Chathura,



Yes there is a better approach than  save those files in the jaggery app
> itself. This is mainly because jaggery app is getting bulky, difficult for
> clustering, and less security.
>
> What we have done for mobile app is store them in a secured place such as
> /repository/resources/mobileapps (as the default location) with an
> arbitrary name. It can be configurable to any location in the file system
> or the network.
>
> That file can be read from its physical location using Java and and get an
> input stream via Jaggery for download or you can directly read it from
> Jaggery.
>

As per the offline discussion had with Senthuja and Nisal, we cannot access
location such as /repository/resources/mobileapps from Jaggery.


Thanks
Godwin




>
> On Mon, Oct 17, 2016 at 6:27 PM, Dinusha Senanayaka 
> wrote:
>
>> We have done something similar in AppM for mobile apps where publisher
>> uploads binary (.apk etc) and users comes to store install these apps to
>> device.  Download has handled as a byte stream and storage location is
>> stored in property of app-manger.xml (${carbon.ho
>> me}/repository/resources/mobileapps/) and HostObject
>> method has been provided to get the location.
>>
>> @Chathura should be able to explain the logic more since he implemented
>> this.
>>
>> Regards,
>> Dinusha.
>>
>> On Mon, Oct 17, 2016 at 6:06 PM, Godwin Shrimal  wrote:
>>
>>> Hi All,
>>>
>>> We need to dynamically create zip file and allow download it from
>>> jaggery application. For resolve the concurrent access of the system, we
>>> are going to create a directory with the time-stamp and archive that
>>> directory and allow user to download it. Then we need to create a separate
>>> cleanup task to clean those directories and archive files.
>>>
>>> We can create above zip files in jaggery application level (ex.
>>> jaggery/dashboard/resource/) and create a cleanup task in OSGI level to
>>> delete the files/directories periodically. Here we need to keep a configure
>>> to find the jaggery application context from OSGI level.
>>>
>>> Do we have a better approach for this or is it fine to use a
>>> configuration for particular jaggery context ?
>>>
>>> Thanks
>>> Godwin
>>>
>>> --
>>> *Godwin Amila Shrimal*
>>> Senior Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: *+94772264165*
>>> linkedin: *http://lnkd.in/KUum6D *
>>> twitter: https://twitter.com/godwinamila
>>> 
>>>
>>
>>
>>
>> --
>> Dinusha Dilrukshi
>> Associate Technical Lead
>> WSO2 Inc.: http://wso2.com/
>> Mobile: +94725255071
>> Blog: http://dinushasblog.blogspot.com/
>>
>
>
>
> --
> Regards,
>
> Chatura Dilan Perera
> *Associate Tech Lead** - WSO2 Inc.*
> www.dilan.me
>



-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D *
twitter: https://twitter.com/godwinamila

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dynamic zip file download from Jaggery application

2016-10-17 Thread Chathura Dilan
Hi Godwin,

Yes there is a better approach than  save those files in the jaggery app
itself. This is mainly because jaggery app is getting bulky, difficult for
clustering, and less security.

What we have done for mobile app is store them in a secured place such as
/repository/resources/mobileapps (as the default location) with an
arbitrary name. It can be configurable to any location in the file system
or the network.

That file can be read from its physical location using Java and and get an
input stream via Jaggery for download or you can directly read it from
Jaggery.


On Mon, Oct 17, 2016 at 6:27 PM, Dinusha Senanayaka 
wrote:

> We have done something similar in AppM for mobile apps where publisher
> uploads binary (.apk etc) and users comes to store install these apps to
> device.  Download has handled as a byte stream and storage location is
> stored in property of app-manger.xml (${carbon.
> home}/repository/resources/mobileapps/) and HostObject
> method has been provided to get the location.
>
> @Chathura should be able to explain the logic more since he implemented
> this.
>
> Regards,
> Dinusha.
>
> On Mon, Oct 17, 2016 at 6:06 PM, Godwin Shrimal  wrote:
>
>> Hi All,
>>
>> We need to dynamically create zip file and allow download it from jaggery
>> application. For resolve the concurrent access of the system, we are going
>> to create a directory with the time-stamp and archive that directory and
>> allow user to download it. Then we need to create a separate cleanup task
>> to clean those directories and archive files.
>>
>> We can create above zip files in jaggery application level (ex.
>> jaggery/dashboard/resource/) and create a cleanup task in OSGI level to
>> delete the files/directories periodically. Here we need to keep a configure
>> to find the jaggery application context from OSGI level.
>>
>> Do we have a better approach for this or is it fine to use a
>> configuration for particular jaggery context ?
>>
>> Thanks
>> Godwin
>>
>> --
>> *Godwin Amila Shrimal*
>> Senior Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: *+94772264165*
>> linkedin: *http://lnkd.in/KUum6D *
>> twitter: https://twitter.com/godwinamila
>> 
>>
>
>
>
> --
> Dinusha Dilrukshi
> Associate Technical Lead
> WSO2 Inc.: http://wso2.com/
> Mobile: +94725255071
> Blog: http://dinushasblog.blogspot.com/
>



-- 
Regards,

Chatura Dilan Perera
*Associate Tech Lead** - WSO2 Inc.*
www.dilan.me
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dynamic zip file download from Jaggery application

2016-10-17 Thread Ruwan Abeykoon
Hi Godwin,
I think all the tasks about create/zip/delete the folder better be done in
modular java code. Then we can call the java code with Jaggery. Then we
would not need to detect the Context. We can use the "system.temp" folder
to store the temporary file/folders.

Cheers,
Ruwan

On Mon, Oct 17, 2016 at 6:27 PM, Dinusha Senanayaka 
wrote:

> We have done something similar in AppM for mobile apps where publisher
> uploads binary (.apk etc) and users comes to store install these apps to
> device.  Download has handled as a byte stream and storage location is
> stored in property of app-manger.xml (${carbon.
> home}/repository/resources/mobileapps/) and HostObject
> method has been provided to get the location.
>
> @Chathura should be able to explain the logic more since he implemented
> this.
>
> Regards,
> Dinusha.
>
> On Mon, Oct 17, 2016 at 6:06 PM, Godwin Shrimal  wrote:
>
>> Hi All,
>>
>> We need to dynamically create zip file and allow download it from jaggery
>> application. For resolve the concurrent access of the system, we are going
>> to create a directory with the time-stamp and archive that directory and
>> allow user to download it. Then we need to create a separate cleanup task
>> to clean those directories and archive files.
>>
>> We can create above zip files in jaggery application level (ex.
>> jaggery/dashboard/resource/) and create a cleanup task in OSGI level to
>> delete the files/directories periodically. Here we need to keep a configure
>> to find the jaggery application context from OSGI level.
>>
>> Do we have a better approach for this or is it fine to use a
>> configuration for particular jaggery context ?
>>
>> Thanks
>> Godwin
>>
>> --
>> *Godwin Amila Shrimal*
>> Senior Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: *+94772264165*
>> linkedin: *http://lnkd.in/KUum6D *
>> twitter: https://twitter.com/godwinamila
>> 
>>
>
>
>
> --
> Dinusha Dilrukshi
> Associate Technical Lead
> WSO2 Inc.: http://wso2.com/
> Mobile: +94725255071
> Blog: http://dinushasblog.blogspot.com/
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Dynamic zip file download from Jaggery application

2016-10-17 Thread Dinusha Senanayaka
We have done something similar in AppM for mobile apps where publisher
uploads binary (.apk etc) and users comes to store install these apps to
device.  Download has handled as a byte stream and storage location is
stored in property of app-manger.xml
(${carbon.home}/repository/resources/mobileapps/)
and HostObject method has been provided to get the location.

@Chathura should be able to explain the logic more since he implemented
this.

Regards,
Dinusha.

On Mon, Oct 17, 2016 at 6:06 PM, Godwin Shrimal  wrote:

> Hi All,
>
> We need to dynamically create zip file and allow download it from jaggery
> application. For resolve the concurrent access of the system, we are going
> to create a directory with the time-stamp and archive that directory and
> allow user to download it. Then we need to create a separate cleanup task
> to clean those directories and archive files.
>
> We can create above zip files in jaggery application level (ex.
> jaggery/dashboard/resource/) and create a cleanup task in OSGI level to
> delete the files/directories periodically. Here we need to keep a configure
> to find the jaggery application context from OSGI level.
>
> Do we have a better approach for this or is it fine to use a configuration
> for particular jaggery context ?
>
> Thanks
> Godwin
>
> --
> *Godwin Amila Shrimal*
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94772264165*
> linkedin: *http://lnkd.in/KUum6D *
> twitter: https://twitter.com/godwinamila
> 
>



-- 
Dinusha Dilrukshi
Associate Technical Lead
WSO2 Inc.: http://wso2.com/
Mobile: +94725255071
Blog: http://dinushasblog.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Dynamic zip file download from Jaggery application

2016-10-17 Thread Godwin Shrimal
Hi All,

We need to dynamically create zip file and allow download it from jaggery
application. For resolve the concurrent access of the system, we are going
to create a directory with the time-stamp and archive that directory and
allow user to download it. Then we need to create a separate cleanup task
to clean those directories and archive files.

We can create above zip files in jaggery application level (ex.
jaggery/dashboard/resource/) and create a cleanup task in OSGI level to
delete the files/directories periodically. Here we need to keep a configure
to find the jaggery application context from OSGI level.

Do we have a better approach for this or is it fine to use a configuration
for particular jaggery context ?

Thanks
Godwin

-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D *
twitter: https://twitter.com/godwinamila

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev