Engine:Fix in switching stuck SEND task to ERROR

There are two ways how to switch task which is get stuck in PROCESSING
state to ERROR. One works only for SEND tasks when there is not enough
tasks results after fixed time. Another is more generic and works for
any tasks which stay in PROCESSING or PLANNED for long time.

The one for fixing SEND was set to apply after a tasks which got stuck
for more then 3 hours, while the generic one apply after tasks which is
got stuck for more than 1 hour. So the one for SEND could never apply.

Moreover the one for SEND also switching GEN dependencies to NONE,
therefore it forced generating of new (up to date) data. This is crucial
because otherwise following situation may occur: One task result on a
cluster always get stuck. Propagation maintainer after fixed time switch
SEND task to error and will reschedule it in near future. Unless it also
switches GEN to NONE, engine will propagate the same old data over and
over (because one task result always get stuck, so SEND never ends in
DONE).

This commit sets code for fixing SEND tasks to apply after task which is
got stuck for 2 or more hours and the one for all tasks to apply after 3
hours. Therefore the one for SEND apply before the generic one and
correctly switch SEND to ERROR and GEN dependencies to NONE. The one for
all tasks will solve bigger problems which first one couldn't. This will
fix the problem described above.
RPC: added support for removing user_facility attributes

- Added missing removeAttributes() variant for user_facility attributes.
- Added and updated RPC's javadoc for some methods.
GUI: users can change category for unlocked publications

- Allow change of category on publication detail if
  publication is not locked.
Merge pull request #142 from zlamalp/pub

GUI: users can change category for unlocked publications
RPC: fix updateNameTitles method

Method updateNameTitles called wrong method from core (updateUser) so it
can change not only titles of a user. Also updateUser in core can be
executed only by perun admin.

Now updateNameTitles from RPC calls updateNameTitles from core.
Fix logging in method deleteResource (core blImpl)

- there si calling of method removeGroupFromResource from Impl, need to add log message here
- there is log message about deleting resource which do not need to use affected groups
Merge pull request #144 from stavamichal/core-delete-resource-log-fix

Fix logging in method deleteResource (core blImpl)
Add Resoure to LDAP schema

- main.java will be generate also resources
- LdapConnector/Impl has new methods for work with resources
- EventProcessorImpl has new strategy to work with resources messages (from log)
ExecService class now extends PerunBean class.

- Add dependency on perun-beans to pom.xml in Controller, Engine, Rpc-lib, Rpc and Tasks-lib.
- Move ExecService from tasks-lib to perun-beans
- Modify toString method in ExecService
- Add serializeToString method to ExecService
GUI: display member mail in findCandidates()

- When adding new member from candidates, display member mail
  (if not present, display user:preferredMail).
Merge pull request #146 from zlamalp/candidate

GUI: display member mail in findCandidates()
CORE, RPC: added support for changing preferred email for users

- Added requestPreferredEmailChange() which stores change request
  and sends email notification with encrypted validation link.
- Added validatePreferredEmailChange() which takes encrypted parameters
  from email notification in order to perform change itself
  (set value to attribute).
- Delete all mail change requests if deleteUser() is called.

- Users can request mail change for themselves or their service identities.
- Mail validation is accepted only with proper set of parameters and only
  if logged user is autorized for target user.
- Validation URL is reconstructed from original http request
  (passed from RPC to method itself). If value is not valid URL
  then exception is thrown a no changes are made.

Following properties must be added to perun.properties file before accepting this change:

- perun.mailchange.secretKey (key used to encrypt change request id)
- perun.mailchange.backupFrom (address used as from in mail notification)

Following changes must be performed in DB before accepting this change:

create table "mailchange" (
	id integer not null,
	value text not null,
	user_id integer not null,
	created_at timestamp default now() not null,
	created_by varchar(1024) default user not null,
	created_by_uid integer
);
create sequence "mailchange_id_seq" maxvalue 9223372036854775807;
alter table mailchange add constraint mailchange_pk primary key (id);
alter table mailchange add constraint mailchange_u_fk foreign key (user_id) references users(id);
create index idx_fk_mailchange_user_id on users(id);
grant all on mailchange to perun;
CORE, RPC, GUI: very raw version of new user detail for internal testing

GUI:

- User can switch his identities by "select identity" option in menu.
  If have only one, option is disabled. Switching still can be done
  through service identities table and associated users table.
- User can update titles in name from GUI.
- Perun admin can update whole user's name from GUI.
- User can see his certificates with expiration date.
- User can change password or go to reset gui from Authentications tab.
- User can change preferred email, language and timezone.
- On service identity detail user can change its email or add new login
  (if supported namespace) and set password. Login can be added only if
  there wasn't any before (proper checks are in core method addLogin()).

- Perun GUI can be used to display mail change verification results.
- Added new callbacks, updated User object, removed unused classes.
- Better error message formatting (proper width) for "Extended" input widgets.
  Also can display HTML and not just the text.
- Updated params reading in application form gui to determine, if its
  mail validation request.

- Added test tab for JSON parser for further testing. Parsing simple
  values like string, integer works locally but not in production runtime.

CORE, RPC:

- Multiple small fixes of typos.
- Updated content of email notice, added mail subject.
GUI: updated checks for TextBox input for login

- ExtendedTextBox can now be set to processing and hard error state.
  Whench implementing TextBoxValidator it's method MUST return
  FALSE if TextBox is in processing or hard error state in order
  to stop any action depending on checked value.
- Use new TextBox states to handle external checks on input
  (like RPC call if login is available).
- Added regex for login attribute value used on users input in
  application form and addLogin/createServiceMember tabs.
  Now input form is consistent in design when checking it's values.
- Fixed event calls in IsLoginAvailable.
- Updated source formatting.
CORE: allow mail validation only in 6 hour window

- Allow to validate new email address only inside 6 hours window
  from moment of request creation.
- Constant (in hours) can be changed in the future.
GUI: incremental update to user detail page

- Updated design and behavior of ResourcesSettings tab
  (used to change shell etc.)
- Allow to exclude user from mailing lists.
- Updated SelfTabs location (breadcrumbs).
- Allow to set default when user changes shell on resource/facility
  (it is done by deleting value of user_facility:def:shell attribute).
- Display membership status and expiration date on SelfVos tab
  (perunadmin can change both from here).
- Updated select identity tab.
- Display notice if preferred mail change is pending (using local storage)
  and display notice, about need to validate new email when user
  types in textbox.
CORE, GUI: fixes for mail validation link

CORE:

- Mail validation link now respect original rpc authz
  /perun-rpc-krb/  ->  /perun-gui-krb/
  /perun-rpc-fed/  ->  /perun-gui-fed/
  /perun-rpc-cert/ ->  /perun-gui-cert/
  any other path   ->  /perun-gui/

- Mail validation time window is taken from perun.properties
  now with fallback in source code (6 hours).
  This will make any deployment specific changes easier than
  change source code every time.

- Following entry must be added to perun.properties before
  accepting changes in this commit:

  perun.mailchange.validationWindow = [value]

  where [value] is number representing hours.

GUI:

- Fixup bugs.
RPC, GUI: support for getNewExtendMembership()

- Added support for getting new membership expiration date
  for vo extension applications before approval/rejection.
- Clear pending mailchange in GUI's local storage if
  validation successful.
- Remove some unnecessary code, small design fixes
GUI: updated application detail

- Updated detail page of user's own applications in Perun GUI.
- Better date/time on application detail in ApplicationForm GUI.
- Better message when application doesn't contain any data.
CORE, RPC, GUI: updated mail validation process

CORE, RPC:

- Added method getPendingPreferredEmailChanges() which
  returns list of email addresses awaiting validation in
  order to display notice in GUI for users.
- Updated Javadoc

GUI:

- Proper implementation of check on pending preferred
  email change requests. User can see, what email addresses
  has change pending.
- Removed usage of LocalStorage for pending mail change.
- BasicOverlayType can now return list of Strings, Booleans
  and Integers from JSON response.