It's all about the answers!

Ask a question

How can I prevent named files in subdirectory from being loaded via "Load Rules" file?


Chris P (111912) | asked Aug 13 '13, 2:43 p.m.
I have a component called "CompA" with directory structure of:

/code
  fileA.txt
  fileB.txt
  fileC.txt
/config
  conf1.props
  conf2.props
Can I use a load rules file to prevent fileC.txt from being loaded by developers?  I've tried the following load rule file with no success:

<scm:sourceControlLoadRule eclipseProjectOptions="import" version="1" xmlns:scm="http://com.ibm.team.scm">
    <parentLoadRule>
        <component name="CompA"/>
        <parentFolder repositoryPath="/"/>
  <exclude>
   <filter name="fileC.txt"/>
  </exclude>
    </parentLoadRule>
</scm:sourceControlLoadRule>

One answer



permanent link
Scott Cowan (966310) | answered Aug 13 '13, 4:01 p.m.
JAZZ DEVELOPER
edited Aug 15 '13, 9:56 a.m.
Hi Chris,

It looks like you've got the right idea, taken right from Loading with Load Rules in Rational Team Concert 4.0 and later, section Example: Loading with filters.  It just looks like you're missing the XML declaration and the xmlns is an encoded link.  Try the loadrules below.

Scott

<?xml version="1.0" encoding="UTF-8"?>
<scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" version="1">
    <parentLoadRule>
        <component name="CompA"/>
        <parentFolder repositoryPath="/"/>
        <exclude>
            <filter name="fileC.txt"/>
        </exclude>
    </parentLoadRule>
</scm:sourceControlLoadRule>

Comments
Scott Cowan commented Aug 13 '13, 4:17 p.m. | edited Aug 13 '13, 4:35 p.m.
JAZZ DEVELOPER

Dang!  I can't seem to get the forum to display the xml declaration or the camel case, but you can see it in Example: Loading with filters.


1
Tim Mok commented Aug 13 '13, 4:39 p.m.
JAZZ DEVELOPER

The XML in the description looks right but I don't think the "exclude" tag will work on files. There article that Scott posted mentions the "excludeFilter" tag that looks like it will work on files. https://jazz.net/library/article/1015#excludeFilter


Chris P commented Aug 14 '13, 8:38 a.m.

Scott,


I had the same problem with the XML declaration, that's why i left it out. 


Chris P commented Aug 14 '13, 8:40 a.m.

Tim,


I've tried to get the excludeFilter to work, but every time I've gotten an error.  It may be my inability to decipher the syntax from the document....

Anyone have an example on how to use excludeFilter? 


1
Scott Cowan commented Aug 15 '13, 9:52 a.m.
JAZZ DEVELOPER

Hi Chris,

I believe this will work for you,

<?xml version="1.0" encoding="UTF-8"?>
<scm:sourceControlLoadRule xmlns:scm="http://com.ibm.team.scm" version="1">
    <excludeFilter>
        <filter name="fileC.txt"/>
    </excludeFilter>
    <parentLoadRule>
        <component name="CompA"/>
        <parentFolder repositoryPath="/"/>
    </parentLoadRule>
</scm:sourceControlLoadRule>


Scott Cowan commented Aug 15 '13, 10:47 a.m.
JAZZ DEVELOPER

FYI, I had to look at the Appendix : Load Rule schema to figure out where to put the excludeFilter element in relation to the parentLoadRule element, and the order matters.

showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.