Topic
2 replies Latest Post - ‏2012-12-11T10:10:10Z by jaguar
jaguar
jaguar
4 Posts
ACCEPTED ANSWER

Pinned topic Doors DXL

‏2012-12-04T10:08:56Z |
We recently moved our SVN (source code versioning system) to a new server (location). Unfortunately we had given direct external links from our design modules in Doors to the SVN path in the source files. Now all these paths are wrong. Is there a way to search and replace all the links to the new path?
Nikhitha
Updated on 2012-12-11T10:10:10Z at 2012-12-11T10:10:10Z by jaguar
  • Tony_Goodman
    Tony_Goodman
    270 Posts
    ACCEPTED ANSWER

    Re: Doors DXL

    ‏2012-12-05T11:16:54Z  in response to jaguar

    This will do that for you.

    I just wrote this quickly so make sure you test it on a scratch module first!
     

    pragma runLim, 0
     
    DB dbMain = null
    DBE dbeOld = null
    DBE dbeNew = null
     
     
    string oldString = ""
    string newString = ""
     
    Module m = current Module
     
    Buffer b = create
     
    void doApply(DB db)
    {
        Object o = null
            ExternalLink el = null
            string elBody = ""
            
            oldString = get(dbeOld)
            newString = get(dbeNew)
            
            for o in m do
            {
                    for el in o -> "*" do
                    {
                            setempty(b)
                            
                            b += body(el)
                            
                            i = contains(b, oldString, 0)
                            
                            print i "\n"
                            
                            if (i == 0)
                            {
                                    elBody = newString b[i + length(oldString):]
                            }
                            else if (i > 0)
                            {
                                    elBody = b[0:i-1] newString b[i + length(oldString):]
                            }
                            else
                            {
                                    continue
                            }
                            
                            update(description(el), name(el), direction(el), behaviour(el), elBody, el)
     
                    }
            }
    }
     
     
    /******************************************************************************
            MAIN
    ******************************************************************************/
    dbMain = create(m, "Update External Links", styleFloating)
     
    label(dbMain, "")
     
    dbeOld = field(dbMain, "Old String", oldString, 20, false)
    dbeNew = field(dbMain, "New String", newString, 20, false)
     
    ok(dbMain, "OK", doApply)
     
    realize(dbMain)
     
    show(dbMain)
    

     


    Tony Goodman, www.smartdxl.com

     

    Updated on 2014-01-09T10:33:39Z at 2014-01-09T10:33:39Z by iron-man
  • jaguar
    jaguar
    4 Posts
    ACCEPTED ANSWER

    Re: Doors DXL

    ‏2012-12-11T10:10:10Z  in response to jaguar
    Hi Tony,

    Thank you so.... much.
    Your solution is working.really .it can value add
    Nikhitha