Reuse Functionality between Application Modules (cont.)
Reuse Components Made by the Community
This lesson is part of the Developer Online Class for OutSystems 9 course.

Often a functionality we want to add to our application
was already implemented by someone else. In this lesson we will search for
a component
in the OutSystems developers community, and reuse it
in the eBidding application. So let me open
the eBidding application and
what we want to do here
is on this Request_Show page, you see that be have here
a delivery address and I want to show this address
in a map next to this ShowRecord
So I want to add and map to my application
and to a map to my application, I'm going to use this search
I'm goig to search for a Google Map
there's no component available here, there's
no widget that I can use, so I'll have to search
in the community for the Google map and
what we're trying to find here is a component. So well going to these option
here to Forge
and the Forge is the OutSystems repository
of open source components that you can use
in your applications, so let me just filter
the search results and this is
the component that we are searching for
the Google Static Maps API component. Let me select this
and now what we need to do
is to download this component and
publish this component in our Environment. This is the way of getting the component
from the Forge to your Environment
and have it available to use in your applications
So let's go ahead and download the component
And now let's click here
And we'll have to publish this component
in our Environment. So this is how you do it
we have to fill in here the hostname of our environment
And the user name and the password
And let's click here in the 1-Click Publish button
We're all done
The component was just published to
our Environment. Let me just close here this,
and let's go back to are application
and before using it here, let me just show you that
now we have here in our Environment
a new application which is the Google
Static Maps API and this application
has a module and in this module
there's the functionality that we want to reuse in our application
So what we need to do now, is in the eBidding application
we're going to add a reference to this module
Okay, so let me search here
for Google. There it is and
this is the WebBlock that I want to use
to implement this functionality. Click OK
And all I have to do now
is this WebBlock in my screen. So let me at
a container here next to the ShowRecord
This is where I'm going to put the WebBlock
and I'm going to drag-and-drop the WebBlock and you'll notice that now we have here
Google Static Map and let me drag and drop
the WebBlock into this container. There it is
now we need to fill in this parameter this is mandatory
it's the address and we are going to get the address
from the ShowRecord that we have on the page
so here from the Request_Show, let's get
the delivery address
from the request and that's it
There's one message here that says "It's not possible to determine the preview
we need to fill in the example property"
Let's just fill in this whe the value that we have here so
303 Parkway
Drive, NE, Atlanta
And there it is
And that's pretty much it. Let's just publish and see
our application now with then map
next to the ShowReecord. Okay let's login
Let's select this request here that we were seeing
in our application, and there we have it
the map next to the product request
let's just show you another one so that you can see that
they are different maps. So this is reflecting
the address that we have here in the ShowRecords
And that's it, just a quick overview
there are a lot of components in the OutSystems Forge that you can
download, publish, and reference in your applications
and you can add them to your applications to add this
functionality without having to implement it from scratch
And that's it