Changeset 104:284c3fdfd190 in iovar


Ignore:
Timestamp:
Feb 5, 2018, 3:17:37 AM (7 months ago)
Author:
Shawn Wilson <shawn@…>
Branch:
default
Phase:
public
Message:

saw_020518_1 - Add the new MultiShell? app. Devices can now be installed with a .device file.

Files:
9 added
5 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r103 r104  
    1 Copyright (C) 2016-2017 Virgo Venture, Inc.
     1Copyright (C) 2016-2018 Virgo Venture, Inc.
    22Copyright (C) 2011-2015 Lannocc Technologies
    33@%@~LICENSE~@%@
     4
     5saw_020518_1 - Add the new MultiShell app. Devices can now be installed with a .device file.
    46
    57saw_091117_1 - Add Utils.hexToBytes().
  • LICENSE

    r74 r104  
    11The MIT License (MIT)
    22
    3 Copyright (C) 2016-2017 Virgo Venture, Inc.
     3Copyright (C) 2016-2018 Virgo Venture, Inc.
    44Copyright (C) 2011-2016 Lannocc Technologies
     5Copyright (C) 2011 Shawn A. Wilson [shawn@lannocc.com]
    56
    67Permission is hereby granted, free of charge, to any person obtaining a copy
  • etc/sample.web.xml

    r53 r104  
    6969
    7070    <!-- [iovar] - DO NOT REMOVE THIS LINE - Symlink'd servlets get inserted here -->
     71
     72    <servlet>
     73        <servlet-name>iovar-application</servlet-name>
     74        <servlet-class>win.iovar.web.Application</servlet-class>
     75    </servlet>
     76    <servlet-mapping>
     77        <servlet-name>iovar-application</servlet-name>
     78        <url-pattern>/app/*</url-pattern>
     79    </servlet-mapping>
    7180   
    7281    <servlet>
  • src/win/iovar/ant/WebBuilder.java

    r86 r104  
    11/*
    2  * Copyright (C) 2016-2017 Virgo Venture, Inc.
     2 * Copyright (C) 2016-2018 Virgo Venture, Inc.
    33 * Copyright (C) 2012-2015 Lannocc Technologies
    44 * @%@~LICENSE~@%@
     
    3232    File links;
    3333    Integer startupBegin;
    34     Integer sqlStart;
     34    Integer sqlStart; // FIXME: rename to devStart ?
    3535    String excludeDirs;
    3636    //Reference classpathRef;
     
    9292   
    9393    /**
    94      * A unique identifier string prepended to the mysql servlet names so we can avoid conflict when
    95      * an inherited IOVAR application references the same /dev/mysql/ config file.
     94     * A unique identifier string prepended to the dev servlet names so we can avoid conflict when
     95     * an inherited IOVAR application references the same /dev/xyz/ config file.
    9696     */
    9797    public void setProjectKey (final String projectKey)
     
    172172                        //try
    173173                        {
    174                             final int mysql = clname.indexOf ("dev/mysql/");
     174                            // FIXME: too hacky
     175                            final int dev = clname.indexOf ("dev/");
    175176                           
    176                             if (mysql >= 0)
     177                            if (dev >= 0)
    177178                            {
    178179                                if (! servlets.contains (clname))
     
    185186                                    out.write ("    <servlet>");
    186187                                    out.write ("<servlet-name>" + projectKey + ":" + clname + "</servlet-name>");
    187                                     out.write ("<servlet-class>win.iovar.web.dev.MySql</servlet-class>");
     188
     189                                    final int lastidx = clname.lastIndexOf('/'); // FIXME use system file separator
     190                                    final File devfile = new File(new File(clname.substring(6, lastidx)), ".device"); // FIXME 6 == "../../"
     191                                    final String devtarget = Files.readSymbolicLink (devfile.toPath()).toString().substring (22); // "../../WEB-INF/classes/" (FIXME)
     192                                    final String devclass = devtarget.substring (0, devtarget.length () - 6).replaceAll ("/", ".")/*.replaceAll ("\\$", ".")*/;  // FIXME use system file separator character
     193                                    out.write ("<servlet-class>"+devclass+"</servlet-class>");
    188194                                    if (sqlStart!=null)
    189195                                    {
     
    199205                                        lout.write ("    <servlet>");
    200206                                        lout.write ("<servlet-name>" + projectKey + ":" + clname + "</servlet-name>");
    201                                         lout.write ("<servlet-class>win.iovar.web.dev.MySql</servlet-class>");
     207                                        lout.write ("<servlet-class>"+devclass+"</servlet-class>");
    202208                                        if (sqlStart!=null)
    203209                                        {
     
    333339            out.close ();
    334340        }
    335         catch (final IOException e)
     341        catch (final Exception e)
    336342        {
    337             throw new BuildException ("I/O building web-app definition file", e);
     343            e.printStackTrace();
     344            throw new BuildException ("got exception building web-app definition file", e);
    338345        }
    339346       
     
    427434                            {
    428435                                final boolean real = name.endsWith (".class");
    429                                 final String clname = (real ? "" : ":") + name.substring (idx+16, name.length () - (real ? 6 : 0)).replaceAll ("/", ".")/*.replaceAll ("\\$", ".")*/;
     436                                final String clname = (real ? "" : ":") + name.substring (idx+16, name.length () - (real ? 6 : 0)).replaceAll ("/", ".")/*.replaceAll ("\\$", ".")*/;  // FIXME use system file separator character
    430437
    431438                                if (links==null) links = new HashMap<File,String> ();
    432439                                links.put (file, clname);
    433440                            }
    434                             else if ((idx = name.indexOf ("dev/mysql/")) >= 0)
     441                            else if ((idx = name.indexOf ("dev/")) >= 0)
    435442                            {
    436443                                if (links==null) links = new HashMap<File,String> ();
  • src/win/iovar/web/bin/shell/Interactive.java

    r76 r104  
    3131    public static final String CONFIG_URI = "local:/etc/interactive.conf";
    3232    public static final String PARAM_SHRC = "shrc";
     33    public static final String PARAM_STYLE = "iostyle";
    3334   
    3435    enum Config
     
    194195        try
    195196        {
    196             final Map<String,String> config = Utils.configMap (Transport.handler (CONFIG_URI, context, req.getSession ()).get ());
    197             final String style = config.get (Config.STYLE.toString ());
     197            String style = req.getParameter (PARAM_STYLE);
     198            if (style == null)
     199            {
     200                final Map<String,String> config = Utils.configMap (Transport.handler (CONFIG_URI, context, req.getSession ()).get ());
     201                style = config.get (Config.STYLE.toString ());
     202            }
    198203           
    199204            if (style!=null)
Note: See TracChangeset for help on using the changeset viewer.