Esempio n. 1
0
        //----------------------------------------------------------------------------------------------------------------------

        private static void setRouteInfo(Route result, RouteParseInfo routeInfo, String cleanUrl)
        {
            if (strUtil.IsNullOrEmpty(result.ns))
            {
                result.setNs(routeInfo.getNamespace().ToString());
            }
            if (result.ns.Equals("_"))
            {
                result.setNs("");
            }

            if (routeInfo.getAppId() > 0)
            {
                result.setItem("appid", routeInfo.getAppId());
            }

            if (routeInfo.getOwnerInfo() != null)
            {
                result.setItem("owner", routeInfo.getOwnerInfo().Owner);
                result.setItem("ownertype", routeInfo.getOwnerInfo().OwnerType);
            }

            result.setCleanUrl(cleanUrl);
            setStrongTypeValue(result);
            setDefaultAction(result);
        }
Esempio n. 2
0
        public Route getRouteWithDefaultValue()
        {
            Route route = new Route();

            route.setOwnerType(_default.getOwnerType());
            route.setOwner(_default.getOwner());
            route.setNs(_default.getNs());
            route.setController(_default.getController());
            route.setAction(_default.getAction());
            route.setQuery(_default.getQuery());
            route.setId(_default.getId());
            route.setAppId(_default.getAppId());
            route.setPage(_default.getPage());

            route.setItem("ownertype", route.ownerType);
            route.setItem("owner", route.owner);
            route.setItem("namespace", route.ns);
            route.setItem("controller", route.controller);
            route.setItem("action", route.action);
            route.setItem("query", route.query);
            route.setItem("id", route.id);
            route.setItem("appId", route.appId);
            route.setItem("page", route.page);

            return(route);
        }
Esempio n. 3
0
        public Route getRouteWithDefaultValue()
        {
            Route route = new Route();

            route.setOwnerType ( _default.getOwnerType());
            route.setOwner ( _default.getOwner());
            route.setNs( _default.getNs() );
            route.setController ( _default.getController());
            route.setAction ( _default.getAction());
            route.setQuery ( _default.getQuery());
            route.setId( _default.getId() );
            route.setAppId( _default.getAppId() );
            route.setPage( _default.getPage() );

            route.setItem( "ownertype", route.ownerType );
            route.setItem( "owner", route.owner );
            route.setItem( "namespace", route.ns );
            route.setItem( "controller", route.controller );
            route.setItem( "action", route.action );
            route.setItem( "query", route.query );
            route.setItem( "id", route.id );
            route.setItem( "appId", route.appId );
            route.setItem( "page", route.page );

            return route;
        }
Esempio n. 4
0
        private static Route processController( Route route, String cleanUrl )
        {
            if (route == null || route.controller == null) return route;

            route.setCleanUrl( cleanUrl );

            if (route.owner == null) {

                route.setOwner( "site" );
                route.setOwnerType( "site" );
            }

            foreach (String aNamespace in MvcConfig.Instance.RootNamespace) {

                if (route.controller.StartsWith( aNamespace )) {

                    String cleanNs = strUtil.TrimStart( route.controller, aNamespace ).TrimStart( '.' );

                    String[] arrItem = cleanNs.Split( '.' );
                    String controller = arrItem[arrItem.Length - 1];
                    String ns = strUtil.TrimEnd( cleanNs, controller ).TrimEnd( '.' );

                    controller = strUtil.TrimEnd( controller, "Controller" );

                    route.setController( controller );
                    route.setNs( ns );
                    route.setRootNamespace( aNamespace );

                    return route;

                }

            }

            return route;
        }
Esempio n. 5
0
        //----------------------------------------------------------------------------------------------------------------------

        private static void setRouteInfo( Route result, RouteParseInfo routeInfo, String cleanUrl ) {

            if (strUtil.IsNullOrEmpty( result.ns ))
                result.setNs( routeInfo.getNamespace().ToString() );
            if (result.ns.Equals( "_" ))
                result.setNs( "" );

            if (routeInfo.getAppId() > 0) {
                result.setItem( "appid", routeInfo.getAppId() );
            }

            if (routeInfo.getOwnerInfo() != null) {
                result.setItem( "owner", routeInfo.getOwnerInfo().Owner );
                result.setItem( "ownertype", routeInfo.getOwnerInfo().OwnerType );
            }

            result.setCleanUrl( cleanUrl );
            setStrongTypeValue( result );
            setDefaultAction( result );
        }