This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Any Command line support Upload Rules ?

Hi

I would like add my specific file extension into upload Rule in AdminConsle.

Any Command line support Upload Rules, I put my Upload Rule in LIST file.

Regards,
Rainy Chou
  • 0  
    You can use dmpmcli to do this. For an example take a look at uploadRuleDemo.js which by default will be in:
    C:\Program Files\Serena\Dimensions 14.4\CM\AdminConsole\examples\
  • 0
    Example
  • 0
    I can send you a function that you can call from a DMPMCLI script - tested and working.

    Roger L Mercier
  • 0 in reply to 
    Yes , please...

    i am still waiting for a hand.

    Rainy chou
  • 0 in reply to 
    Hi roger

    Can you send me again
  • 0 in reply to 

    Hi,

    Here is an example script below which is adding a rule into one of products for "Dimensions Clients" environment.

    There are two variables (uploadEnvName & projName) which can be obtained by enumerating db.uploadEnvironments and each env UploadProjects in a script, but might be easier just in browser; especially if you are interested in one certain Upload Rules node to add rules to (see attached GIF below showing how to copy-paste them via browser).

    The script can be executed this way, where the last parameter is the path to the script file containing the program below:

    >dmpmcli -user admin -pass admPa$$word -dbname cm_typical -host DimCM-hostname -dsn dim15 -file C:\UploadRules\AddRule.js

    P.S. Please mind, that Upload rules were enhanced in 14.1.0.4 (more info: http://help.serena.com/doc_center/cm/dmcm_newfeaturehistory.htm#upload_rules), so they are Ant rules since that time and few more differences. So, if you deal with an older Dimensions CM release, you might need to adopt the script a little.

    Regards,
    Alex

    importPackage(Packages.com.serena.dmclient.api) try { //////////// Change these two up to your Product configuration: var uploadEnvName = "Project Merge Tool;mrg"; var projName = "$GENERIC:QLARIUS;mrg-4213926"; // Replace "$24" with just "$" when you're taking this ID from Browser /////////////////////////////////////////////////////////////// var db = defaultDatabase; var env = db.uploadEnvironments.get(uploadEnvName); if (env == null) throw ("Upload Environment '" uploadEnvName "' does not exist."); var projs = env.projects; var proj = projs.get(projName); try { //Define a new inclusion rule variable var fileNamePattern = "**/*.ext3\n**/*.ext4"; var dataFormat = "HTML"; var itemType = "SRC"; var designPart = ""; var seq = 2; var exclusion = "**/Debug/*.*\n**/Release/*.*"; var incDetails = new UploadInclusionDetails(fileNamePattern, dataFormat, itemType, designPart, exclusion); incDetails.seqNo = seq; var incs = proj.inclusions; // Create a new upload inclusion rule inc = incs.add(incDetails); print("Rule is added fine: " inc); } catch(e) { print(e) } } catch (e) { print(e) } finally { }

     

    FindUploadRuleName.gif

    --
    Alex Shevchenko
    Sr Development Manager
    Although I work for OpenText, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button.