Skip to content

Commit 73a98bf

Browse files
authored
Update README.md
1 parent ba54e05 commit 73a98bf

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Appify was developed mainly for Java Web developers. If you have skills on HTML5
3333
<inherits name="it.appify.App" />
3434
```
3535

36-
####@WebApp
36+
#### @WebApp
3737
Now your are ready to use all Appify features. First of all you have to declare your web app inteface. Appify offers some annotations to make the development of your web app fast and easy. Infact the webapp interface can be annotated with some web app capabilities and inject them in your webapp such as: Geolocation, Storage, Application Cache, Notification, Offline support, and many others.
3838

3939
``` java
@@ -56,9 +56,9 @@ In this first example we have declared a webapp with no particular features but
5656
myApp.startApp(new AppModel());
5757
```
5858

59-
##Controller annotations:
59+
## Controller annotations:
6060

61-
####@Controller
61+
#### @Controller
6262
Developing a controller with Appify is very simple. Controller is a class annotated with @Controller annotation. The controller can be bound to a View (in Appify a view is a page) by its name. So if you want to bind a MenuController to your main page you have yo annotate your MainPage class with a @Controller and pass the page name to page parameter.
6363

6464
``` java
@@ -88,7 +88,7 @@ Now suppose we have this HTML code for our menu view, controller can intercept a
8888
</div>
8989
</div>
9090
```
91-
####@ViewHandler
91+
#### @ViewHandler
9292
So if you want to intercept the click event on the button with id "checkInBtn" contained in the "mainPage" page you have to write this simple code in your controller class:
9393

9494
``` java
@@ -99,7 +99,7 @@ So if you want to intercept the click event on the button with id "checkInBtn" c
9999
```
100100
Classes annotated with @Controller annotation MUST have a constructor with a WebApp type parameter. This constructor will enables the framework to inject the WebApp skeleton. Webapp skeleton enable you to develop your controllers to trigger a page transition, obtain your current app state, get current visualized page reference, change some view behavior like CSS toggles, show modals, show tooltips and popovers, and to read and write the persistent storage. For all WebApp API skeleton you can see at the WebApp API.
101101

102-
####@ViewElement
102+
#### @ViewElement
103103
Appify can inject the desired view element in your controller. If you have the need to get a reference to an input text element you can declare it as a field of your controller class:
104104

105105
``` java
@@ -108,7 +108,7 @@ Appify can inject the desired view element in your controller. If you have the n
108108
```
109109
Note that you have to provide at least some getters and setters of your private fields. Getters and Setters will enable Appify to correctly inject your view element in your controller. Alternatively you can use the public modifier for your UI fields. Note that all ViewElement (ui fields) are simply DOM elements. GWT offers its Element class and a great mechanism that wraps an HTML DOM Element in a Java Object.
110110

111-
####@ViewModelHandler
111+
#### @ViewModelHandler
112112
If you need to intercpet the data behind the user interaction with a view you have to use the @ViewModelHandler annotation. @ViewModelHandler is a special @ViewHandler for intercept events from a @ViewElement and its related model data. This annotation is useful for List, Combo or Radio Button HTML elements. In general all user interactions with a UI field bound with a model can be intercepted trough a @ViewModelHandler. The example above shows how you can get the described behavior in a few lines of code:
113113

114114
``` java
@@ -121,10 +121,10 @@ If you need to intercpet the data behind the user interaction with a view you ha
121121
```
122122
The onItemReceived method will receive the data behind a list of items when the user will click on an item in the list. The viewId MUST correspond simply to the id of our HTML list. Note that ViewModelHandler need to know the model type in terms of fields bound to our views, in this case the HTML list and the "code" and "name" fields wrapped in the Item class. The declaration of the binding between View and Model is made trough special attributes that can be used in your HTML page. We will call this attributes directives. For all supported directives see the relative Appendix 'Appify supported Directives'.
123123

124-
##Service annotations:
124+
## Service annotations:
125125
Services are simple classes delegated to some kind of background logic execution with singleton scope. To make a class an Appify Service you need to use the related annotations set.
126126

127-
####@Service
127+
#### @Service
128128
Service annotation is the main annotation for service discovering. Appify will inject your app in a Service class and will start your service calling the method annotated with the Start annotation.
129129
So if you want to create a service you just need to do this:
130130

@@ -140,7 +140,7 @@ public class MyService {
140140
}
141141
```
142142

143-
####@Start
143+
#### @Start
144144
@Service annotation is strictly related with #Start annotation. A service class will be started by Appify if there is at least one public method annotated with the @Start annotation.
145145

146146
``` java
@@ -160,8 +160,8 @@ public class MyService {
160160
}
161161
```
162162

163-
##Appify WebApp annotations:
164-
####@Geolocation
163+
## Appify WebApp annotations:
164+
#### @Geolocation
165165
You can enable Geolocation support by adding this simple annotation. You can use annotation parameter to configure your geolocation behavior.
166166

167167
``` java
@@ -192,7 +192,7 @@ app.getGeolocationService().getCurrentPosition(
192192
});
193193
```
194194

195-
####@Battery
195+
#### @Battery
196196
Battery service enables your app to obtain the Battery service for reading battery level and get charging information from your device.
197197

198198
``` java
@@ -223,7 +223,7 @@ app.getBatteryService().getBatteryStatus(
223223
}
224224
});
225225
```
226-
####@Offline
226+
#### @Offline
227227
Offline annotation makes your app offline-first enabling your app to access the HTML5 Application Cache receive events and get connection status informations:
228228

229229
``` java
@@ -248,7 +248,7 @@ app.getApplicationCacheService().getConnetionStatus(
248248
}
249249
});
250250
```
251-
####@Storage
251+
#### @Storage
252252
If you need to persist application state in the storage you can annotate your web app with this annotation. Using Storage annotation will enable you to get a Storage Service and to obtain a great Appify behavior. Once Storage was activated your application state will be persisted every time you call the updateAppState method of your app. Without the Storage feature the updateAppState method will affect only the view but changes will not be persisted so a simple refresh of your page will reset all your application state.
253253

254254
``` java
@@ -271,7 +271,7 @@ model.setBatteryStatus(currentStatus);
271271
/*persist only in the local storage your app state*/
272272
app.getStorageService().store(AppModel.class.toString(), model);
273273
```
274-
#Javascript API
274+
# Javascript API
275275
If you prefer, you can use the Javascript Api version of Appify:
276276
``` javascript
277277
//construct your appify object
@@ -290,7 +290,7 @@ myapp.moveTo('childPage');
290290
mymodel.title='New Title';
291291
myapp.updateAppState(mymodel);
292292
```
293-
#Updates:
293+
# Updates:
294294
Actually Appify rely on these modules:
295295
- App.Js for the View and the Page transition.
296296
- VueJs for the MVVM pattern.
@@ -301,10 +301,10 @@ Actually Appify rely on these modules:
301301

302302
These modules (except of GWT) are not mandatory and you can use what you prefer, for example for the MVVM instead of VueJs you can use AngularJs. This is not a priority requirement, but it's planned in the road-map and will be provided in the next future.
303303

304-
#License
304+
# License
305305
GNU GPLv3
306306

307-
#Appendix
307+
# Appendix
308308

309-
##Appify supported Directives
309+
## Appify supported Directives
310310
TODO

0 commit comments

Comments
 (0)