Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
javiergamarra committed May 14, 2015
2 parents 4aa8ed0 + 6322a5a commit be6b40f
Show file tree
Hide file tree
Showing 25 changed files with 460 additions and 110 deletions.
8 changes: 3 additions & 5 deletions LiferayScreens.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ Pod::Spec.new do |s|
s.version = '0.3'
s.summary = 'A family of visual components called screenlets that are connected to the Liferay Platform used as a backend'
s.homepage = 'https://www.liferay.com/liferay-screens'
s.documentation_url = 'https://github.com/liferay/liferay-screens'
s.license = {
:type => 'LGPL 2.1',
:file => 'LICENSE.md'
}
s.source = {
:git => 'https://github.com/liferay/liferay-screens.git',
:tag => 'v1.0-beta-3'
:commit => 'd94ddb98be3ef5e676396d82494449c0eb75f0b5',
:tag => '0.3'
}
s.authors = {
'Jose Manuel Navarro' => 'jose.navarro@liferay.com'
}
s.social_media_url = 'http://twitter.com/jmnavarro'

s.platform = :ios
s.ios.deployment_target = '8.0'
s.platform = :ios, '8.0'
s.requires_arc = true

s.ios.frameworks = 'CoreGraphics', 'Foundation', 'MobileCoreServices', 'QuartzCore', 'Security', 'SystemConfiguration', 'UIKit'
Expand Down
118 changes: 80 additions & 38 deletions android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,27 @@ Development of Android apps using Liferay Screens requires the following:
- Android SDK 4.0 (API Level 14) or above
- [Liferay Portal 6.2 CE or EE](http://www.liferay.com/downloads/liferay-portal/available-releases)
- [Liferay Screens' compatiblity plugin](https://github.com/liferay/liferay-screens/tree/master/portal).
- Liferay Screens' source code

## Compatibility

Liferay Screens for Android is compatible with Android 4.0 (API Level 14) and higher. The SDK uses the [AppCompat library](https://developer.android.com/tools/support-library/features.html#v7-appcompat) (v7:21.0.3) to offer a material look on older devices and the new [recycler view](https://developer.android.com/tools/support-library/features.html#v7-recyclerview) implementation.

Other internal dependencies are:
Other internal dependencies are:

- [EventBus](https://github.com/greenrobot/EventBus)
- [Picasso](http://square.github.io/picasso/)

## Preparing Your Project for Liferay Screens

Liferay Screens is released as an [AAR file](http://tools.android.com/tech-docs/new-build-system/aar-format) that is currently hosted in jCenter. The following sections describe how to set up Screens with Gradle and Maven. While instructions are also provided for manual setup, it's strongly recommended that you use Maven or Gradle to set and download your dependencies.
Liferay Screens is released as an [AAR file](http://tools.android.com/tech-docs/new-build-system/aar-format) that is currently hosted in jCenter. The following sections describe how to set up Screens with Gradle and Maven. While instructions are also provided for manual setup, it's strongly recommended that you use Maven or Gradle to set and download your dependencies.

To include your first screenlet, you only need to follow 3 steps:

* Download and include Liferay Screens in your project.
* Configure your server's IP address and Company ID.
* Add a screenlet to your view.

The following sections show you how to download and include Liferay Screens in your project.

### Gradle

Expand All @@ -58,16 +66,16 @@ Use the following steps to configure your project with Gradle:

Gradle downloads all the necessary dependencies before building your project. If you get errors such as `Duplicate files copied in APK META-INF/NOTICE` when building with Gradle, add this to your `build.gradle` file:

```groovy
android {
...
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
...
```groovy
android {
...
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
```
...
}
```

### Maven

Expand All @@ -87,30 +95,30 @@ Use the following steps to configure your project with Maven:

Note that if Maven can't locate the artifact, you need to add jCenter as a new repository in your maven settings (`.m2/settings.xml`):

```xml
<profiles>
<profile>
<repositories>
<repository>
<id>bintray-liferay-liferay-mobile</id>
<name>bintray</name>
<url>http://dl.bintray.com/liferay/liferay-mobile</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>bintray-liferay-liferay-mobile</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/liferay/liferay-mobile</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
```
```xml
<profiles>
<profile>
<repositories>
<repository>
<id>bintray-liferay-liferay-mobile</id>
<name>bintray</name>
<url>http://dl.bintray.com/liferay/liferay-mobile</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>bintray-liferay-liferay-mobile</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/liferay/liferay-mobile</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
```

### Manually

Expand All @@ -137,9 +145,43 @@ latest version of Liferay Screens for Android.
compile project (':themes')
```

You can also configure the `.aar` binary files (in `Android/dist`) as local `.aar` dependencies.
You can also configure the `.aar` binary files (in `Android/dist`) as local `.aar` dependencies. You can download all the necessary files from [jCenter](https://bintray.com/liferay/liferay-mobile/liferay-screens/view).

Great! Your project should now be ready for Liferay Screens. You can do a quick check by compiling and executing a blank activity and importing a Liferay Screens class (like `LoginScreenlet`).

Next, you'll learn how to configure the IP address and other required parameters.

## Configuring Your Project to Communicate with Your Liferay Installation

Regardless of how you install Screens in your project, you need to configure it to communicate with your Liferay installation. You could have the greatest app in existence, but if it can't communicate with your Liferay installation then it's all for naught. Fortunately, setting this up is a simple task. In your project's `res/values` directory, create a new file called `server_context.xml`.

Add the following code to the new file:

```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Change these values for your Liferay Portal installation -->

<string name="liferay_server">http://10.0.2.2:8080</string>

<integer name="liferay_company_id">10155</integer>
<integer name="liferay_group_id">10182</integer>

</resources>
```

As the comment indicates, make sure to change these values to match those in your Liferay installation. The server address `http://10.0.2.2:8080` is suitable for testing with Android Studio's emulator, because it corresponds to `localhost:8080` through the emulator.

You should note that there are additional properties you can configure in `server_context.xml`, depending on the screenlets in your project. For example, you can add the following two properties if you're using `DDLFormScreenlet` and `DDLListScreenlet` to interact with DDLs in your app. You can see an additional example `server_context.xml` file [here](https://github.com/liferay/liferay-screens/blob/master/android/samples/bankofwesteros/src/main/res/values/server_context.xml).

```xml
<!-- Change these values for your Liferay Portal installation -->

<integer name="liferay_recordset_id">20935</integer>
<string name="liferay_recordset_fields">Title</string>
```

Great! Your project should now be ready for Liferay Screens. Next, you'll learn how to use screenlets in your app.
Super! Your Android project should now be ready for Liferay Screens.

## Using Screenlets

Expand Down
5 changes: 5 additions & 0 deletions android/documentation/AssetListScreenlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ The Default views use a standard `RecyclerView` to show the scrollable list. Oth

Dynamic Data Lists (DDL) and Data Types should be configured properly in the portal. Refer to the [Defining Data Types](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/building-a-list-platform-in-liferay-and-defining-data-) and [Creating Data Lists](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/creating-data-lists) sections of the User Guide for more details.

## Compulsory Attributes

- `layoutId`
- `classNameId`

## Attributes

| Attribute | Data type | Explanation |
Expand Down
8 changes: 7 additions & 1 deletion android/documentation/DDLFormScreenlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Each field defines an editor type. You must define each editor type's layout by
- `textAreaFieldLayoutId`: The layout to use for Text Box fields.
- `textDocumentFieldLayoutId`: The layout to use for Documents & Media fields.

If you don't define the editor type's layout in the attributes of `DDLFormScreent`, the default layout `ddlfield_xxx_default` is used, where `xxx` is the name of the editor type. It's important to note that you can change the layout used with any editor type at any point.
If you don't define the editor type's layout in the attributes of `DDLFormScreenlet`, the default layout `ddlfield_xxx_default` is used, where `xxx` is the name of the editor type. It's important to note that you can change the layout used with any editor type at any point.

### Custom Editors

Expand Down Expand Up @@ -109,6 +109,12 @@ Also, if your form includes at least one Documents and Media field, you must gra

For more details, see the User Guide sections [Defining Data Types](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/building-a-list-platform-in-liferay-and-defining-data-), [Creating Data Lists](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/creating-data-lists), and [Using Workflow](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/using-workflow).

## Compulsory Attributes

- `layoutId`
- `structureId`
- `recordSetId`

## Attributes

| Attribute | Data Type | Explanation |
Expand Down
6 changes: 6 additions & 0 deletions android/documentation/DDLListScreenlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ The `DDLListScreenlet` enables the following features:

DDLs and Data Types should be properly configured in the portal before using `DDLListScreenlet`. For more details, see the Liferay User Guide sections [Defining Data Types](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/building-a-list-platform-in-liferay-and-defining-data-) and [Creating Data Lists](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/creating-data-lists).

## Compulsory Attributes

- `layoutId`
- `recordSetId`
- `labelFields`

## Attributes

| Attribute | Data type | Explanation |
Expand Down
6 changes: 6 additions & 0 deletions android/documentation/ForgotPasswordScreenlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ For more details on authentication in Liferay Portal, please refer to the [Confi

An anonymous request can be made without the user being logged in. However, authentication is needed to call the API. To allow this operation, it's recommended that the portal administrator create a specific user with minimal permissions.

## Compulsory Attributes

- `layoutId`
- `anonymousApiUserName`
- `anonymousApiPassword`

## Attributes

| Attribute | Data type | Explanation |
Expand Down
4 changes: 4 additions & 0 deletions android/documentation/LoginScreenlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Before using `LoginScreenlet`, you should make sure your portal is configured wi

For more details, see the [Configuring Portal Settings](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/configuring-portal-settings) section of the User Guide.

## Compulsory Attributes

- `layoutId`

## Attributes

| Attribute | Data type | Explanation |
Expand Down
8 changes: 7 additions & 1 deletion android/documentation/SignUpScreenlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ For more details, refer to the [Configuring Portal Settings](https://dev.liferay

## Anonymous Requests

Anonymous requests can be done without the user being logged in. However, authentication is still required to call the API. To allow this operation, it's recommended that the portal administrator create a specific user with minimal permissions.
Anonymous requests can be done without the user being logged in. However, authentication is still required to call the API. To allow this operation, it's recommended that the portal administrator create a specific user with minimal permissions. To use `SignUpScreenlet`, you need to use that user in your layout (we recommend adding the credentials to `server_context.xml`).

## Compulsory Attributes

- `layoutId`
- `anonymousApiUserName`
- `anonymousApiPassword`

## Attributes

Expand Down
4 changes: 4 additions & 0 deletions android/documentation/UserPortraitScreenlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}
```

## Compulsory Attributes

- `layoutId`

## Attributes

| Attribute | Data type | Explanation |
Expand Down
5 changes: 5 additions & 0 deletions android/documentation/WebContentDisplayScreenlet.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ The Default view uses a standard `WebView` to render the HTML.

For the `WebContentDisplayScreenlet` to function properly, there should be web content in the Liferay instance your app connects to. For more details on web content, see the [Web Content Management](https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/web-content-management) section of the Liferay User Guide.

## Compulsory Attributes

- `layoutId`
- `articleId`

## Attributes

| Attribute | Data type | Explanation |
Expand Down

0 comments on commit be6b40f

Please sign in to comment.