Users module is used to manage users accounts, this was installed at the beginning. CustomLogin class is used to control the access to Post CRUD, showing PostMain class after a correct identification. A back button is also included to enable users to return to main page.
@ViewClass(label = "Login")
public class CustomLogin extends Login {
public CustomLogin() {
}
@Override
protected void onSuccess() {
// LOG
ActivityLogHelper.getInstance().log(ActivityLog.LEVEL_INFO,
ActivityLogCategories.CATEGORY_LOGIN, "Connection");
ObjectContext.getInstance().show(new PostMain());
}
@Override
protected void onError() {
// LOG
ActivityLogHelper.getInstance().log(ActivityLog.LEVEL_INFO,
ActivityLogCategories.CATEGORY_LOGIN, "Login Error");
super.onError();
}
@ViewAction(layout = "form://actions")
public void back(){
ObjectContext.getInstance().show(new UsersPostMain());
}
}
In UsersPostMain class a new buttom is created to access to this login.
@FlowAction(next=CustomLogin.class)
@ViewAction(layout = "form://fields")
public void admin() {
}
And in PostMain class two new buttons are included, one for going back and other for accessing to users accounts.
@FlowAction(next=BaseAccountMain.class)
public void Users() {
}
public void back(){
ObjectContext.getInstance().show(new UsersPostMain());
}
0 Ficheros adjuntos