Friday, October 23, 2015

SPRING - stereotypes example

import org.springframework.beans.factory.annotation.Autowired;import org.springframework.beans.factory.annotation.Value;import org.springframework.stereotype.Service;
import java.util.*;
@Service("myConfigServiceFacade")public class MyConfigServiceFacadeImpl implements MyConfigServiceFacade {

    @Value("${com.foo.isWebSSOEnabled}")
    private String webSSOEnabled;
    @Value("${com.foo.webSSOlogoutURL}")
    private String webSSOInternetLogoutURL;
    @Value("${com.foo.webSSOlogoutURL}")
    private String webSSOIntranetLogoutURL;
    @Value("${com.foo.brandbarURL}" )
    private String brandbarURL;
    @Value("${com.foo.4eye.active}")
    private boolean is4eyeActive;
    @Autowired
    private MyPrincipalService principalService;

====================================================

import com.google.gwt.user.client.rpc.RemoteService;import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;import java.util.Map;import java.util.Set;
@RemoteServiceRelativePath("services/myConfigServiceFacade.rpc")
public interface MyConfigServiceFacade extends RemoteService {
    ApplicationInfo getApplicationInfo();
    SessionInfo config() throws Exception;
    Map<Long, Set<String>> configAllowedAccounts(Long var1, Long var2) throws Exception;}

Wednesday, October 21, 2015

ANDROID - align linearlayout each one behind other programmatically

http://stackoverflow.com/questions/12108370/how-to-setcontentview-in-a-fragment

The method setContent(relativeLayout) on Activity in case of Fragments need to be replaced with return this relatiVeLayout from onCreateView or do from onViewCreated this:

RelativeLayout rootContainer = (RelativeLayout)mainActivity.findViewById(R.id.rootContainer);
rootContainer.addView(rl);

Saturday, October 17, 2015

TOOLS - Colorzilla, nice color picker tool for browser

Colorzilla http://www.colorzilla.com/
Very nice plugin for browsers Chrome and Firefox. It allows to pick colors and see its numeric value in very handily way.

FONTS - safe web fonts for CSS

http://www.cssfontstack.com/Candara

Friday, October 16, 2015

ANGULAR - add logo image in navbar

http://bootply.com/77512

ANGULAR - 15 Best AngularJS Tutorials for Developers

https://codegeekz.com/best-angularjs-tutorials/

Popular one;
https://www.codeschool.com/courses/shaping-up-with-angular-js

ANGULAR - left menu, multiple controllers

https://www.codecademy.com/courses/javascript-advanced-en-2hJ3J/1/1#

index.html
<!doctype html>
<html>
    <head>
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.js"></script>
        <script src="app.js"></script>
        <script src="user.js"></script>
        <script src="menu.js"></script>
        <script src="content.js"></script>
        <link rel="stylesheet" href="style.css">
    </head>
    <body ng-app="exampleApp">
        <header ng-controller="userCtrl">Welcome {{user}}!</header>
        <nav ng-controller="menuCtrl">
            <h2>Menu</h2>
            <ul>
                <li ng-repeat="link in links">{{link}}</li>
            </ul>
        </nav>
        <article ng-controller="contentCtrl">
            <h1>{{title}}</h1>
            <hr />
            <p>{{paragraph}}</p>
            <small >by {{author}}</small>
        </article>
    </body>
</html>

app.js
// Defining a module
angular.module('exampleApp', []);

user.js
angular.module('exampleApp')
    .controller('userCtrl', function ($scope) {
        $scope.user = "Jan Kowalski";
    });

menu.js
angular.module('exampleApp')
    .controller('menuCtrl', function ($scope) {
        $scope.links = ['Link 1', 'Link 2'];
    });

content.js
angular.module('exampleApp')
    .controller('contentCtrl', function ($scope) {
        $scope.title = "Lorem Ipsum";
        $scope.paragraph = "Completely myocardinate process-centric "
        + "total linkage whereas installed base e-tailers. "
        + "Proactively extend collaborative intellectual capital "
        + "vis-a-vis unique expertise. Dynamically.";
        $scope.author = "Anna Nowak";
    });

style.css
body {
    width: 500px;
}

nav {
    float: left;
    width: 30%;
}

article {
    margin-left: 30%;
    width: 70%;
}

Thursday, October 15, 2015

ANGULAR - links on different components implementaiotion

Angular Dropdown menu:
https://www.codementor.io/angularjs/tutorial/create-dropdown-control
https://angular-ui.github.io/bootstrap/
https://github.com/jseppi/angular-dropdowns (https://jsfiddle.net/jseppi/cTzun/142/embedded/result/)


Angular Left menu:
http://stackoverflow.com/questions/18599753/vertical-navbar-using-bootstrap-and-angular (http://plnkr.co/edit/UBBq7V8mdyqllBHdwegY?p=preview)

Angular Subheader
http://codepen.io/svswaminathan/pen/MYBrgM