CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > Data Management

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 248 votes, 5.00 average. Display Modes
  #1  
Old 10-09-2012, 10:04 AM
gmatelich's Avatar
gmatelich gmatelich is offline
Registered User
 
Join Date: Oct 2002
Location: Bellevue, WA, USA
Posts: 396
automatically skip revisions I O Q S X and Z

Has anyone solved the issue of how to automatically skip revisions I O Q S X and Z in ModelManager?

We have our custom.xml set up
Code:
  <Attribute>
    MAJOR_REV
    <DisplayName>Major Rev</DisplayName>
    <AttributeEditorClass>com.osm.datamgmt.editor.MajorRevAttributeEditor</AttributeEditorClass>
    <Visible>true</Visible>
    <IncludeInLayoutManager>true</IncludeInLayoutManager>
    <Searchable>false</Searchable>
    <InitialRev>-</InitialRev>
    <SecondRev>A</SecondRev>
    <Index>2</Index>
  </Attribute>
I mistakenly thought that alphabetic revision would follow these rules:
a) The first revision level is identified by the upper case letter "A".
b) Letters "I" "O" "Q" "S" "X" and "Z" are never used.
c) Upon exhaustion of the alphabet, revisions are identified by letters "AA", "AB", "AC", etc.
d) Revision letters shall not exceed two characters.
In some limited testing though, I found that when I revised revision R, it moved to S. How can I further define acceptable major revisions to match the above rules?

I understand that this isn't an option available through XML configuration. I've barely gotten my feet wet with regards to Java - is there a snippet of code I can add somewhere to address this?

Thanks
Greg
Reply With Quote
  #2  
Old 10-09-2012, 10:57 AM
Gary L. Gary L. is offline
Registered User
 
Join Date: Oct 2002
Location: Rockford, IL
Posts: 130
Re: automatically skip revisions I O Q S X and Z

We have this line in the <Options> section of our xml:

<InvalidMajorCharacters>I,O,Q,S,X,Z</InvalidMajorCharacters>

Hope this helps.
Reply With Quote
  #3  
Old 10-09-2012, 11:20 AM
gmatelich's Avatar
gmatelich gmatelich is offline
Registered User
 
Join Date: Oct 2002
Location: Bellevue, WA, USA
Posts: 396
Re: automatically skip revisions I O Q S X and Z

That sounds like exactly what I need, but I can't find evidence that it is a CoCreate tag, which makes me think it's a custom tag defined at your company.

I'd like to add it to my .xml file anyway to confirm, does your .xml look something like this, as far as placement of the options section?
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<WMConfig>
    <WMServerInfo>
.
.
    </WMServerInfo>
	<Options>
  	  <InvalidMajorCharacters>I,O,Q,S,X,Z</InvalidMajorCharacters>
	</Options>
    <ClassDefs>
    <Class extends="DMDrawing, DMReleaseProcess">
      <Name>DRAWING_2D</Name>
      <Attribute>
        MAJOR_REV
        <DisplayName>Major Rev</DisplayName>
        <AttributeEditorClass>com.osm.datamgmt.editor.MajorRevAttributeEditor</AttributeEditorClass>
        <Visible>true</Visible>
        <IncludeInLayoutManager>true</IncludeInLayoutManager>
        <Searchable>false</Searchable>
        <InitialRev>-</InitialRev>
        <SecondRev>A</SecondRev>
		<Index>2</Index>
      </Attribute>
    </Class>
    <Class extends="DMMasterdata, DMReleaseProcess">
      <Name>MASTERDATA</Name>
      <Attribute>
        NAME
        <Visible>true</Visible>
        <DisplayName>Part Number</DisplayName>
        <RollingNumberGeneratorName>New Number Generator</RollingNumberGeneratorName>
        <BusinessObjectClass>com.osm.datamgmt.biz.RollingNumberGenerator</BusinessObjectClass>
        <AttributeEditorClass>com.osm.datamgmt.editor.NumberGeneratorEditor</AttributeEditorClass>
        <CustomAttribute>false</CustomAttribute>
        <IncludeInLayoutManager>true</IncludeInLayoutManager>
        <EnabledDuringSave>false</EnabledDuringSave>
		<Index>1</Index>
      </Attribute>
    </Class>
    <Class extends="DMModel, DMReleaseProcess">
      <Name>MODEL_3D</Name>
      <Attribute>
        NAME
        <Visible>true</Visible>
        <DisplayName>Part Number</DisplayName>
        <RollingNumberGeneratorName>New Number Generator</RollingNumberGeneratorName>
        <BusinessObjectClass>com.osm.datamgmt.biz.RollingNumberGenerator</BusinessObjectClass>
        <AttributeEditorClass>com.osm.datamgmt.editor.NumberGeneratorEditor</AttributeEditorClass>
        <CustomAttribute>false</CustomAttribute>
        <IncludeInLayoutManager>true</IncludeInLayoutManager>
		<Index>1</Index>
      </Attribute>
      <Attribute>
        MAJOR_REV
        <DisplayName>Major Rev</DisplayName>
        <AttributeEditorClass>com.osm.datamgmt.editor.MajorRevAttributeEditor</AttributeEditorClass>
        <Visible>true</Visible>
        <IncludeInLayoutManager>true</IncludeInLayoutManager>
        <Searchable>false</Searchable>
        <InitialRev>-</InitialRev>
        <SecondRev>A</SecondRev>
		<Index>2</Index>
      </Attribute>
      <Attribute>
        MINOR_REV
        <DisplayName>Minor Rev</DisplayName>
        <AttributeEditorClass>com.osm.datamgmt.editor.MinorRevAttributeEditor</AttributeEditorClass>
        <Visible>true</Visible>
        <IncludeInLayoutManager>true</IncludeInLayoutManager>
        <Searchable>false</Searchable>
        <InitialRev>-</InitialRev>
        <SecondRev>1</SecondRev>
        <NumericOnly>true</NumericOnly>
		<Index>3</Index>
      </Attribute>
	  <ForceChangeNoteCreation>true</ForceChangeNoteCreation>
    </Class>
  </ClassDefs>
</WMConfig>
Reply With Quote
  #4  
Old 10-10-2012, 03:53 AM
Gary L. Gary L. is offline
Registered User
 
Join Date: Oct 2002
Location: Rockford, IL
Posts: 130
Re: automatically skip revisions I O Q S X and Z

It likely is a custom tag.

Your placement is similar to ours.
Reply With Quote
  #5  
Old 12-20-2012, 01:15 PM
gmatelich's Avatar
gmatelich gmatelich is offline
Registered User
 
Join Date: Oct 2002
Location: Bellevue, WA, USA
Posts: 396
Re: automatically skip revisions I O Q S X and Z

Here is the java I created to address the problem
Code:
package com.zetec.biz;

import com.osm.biz.Version;
import com.osm.biz.WMAttribute;
import com.osm.biz.WMObject;
import com.osm.exception.WMException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/** @author GregM, with setup help from MB-dataRefresh
 * http://stackoverflow.com/questions/11485497/permutations-and-combinations-of-arraylists-in-java?rq=1
 * http://stackoverflow.com/questions/2047228/auto-increment-alphabet-in-java
 */
public class ZetecVersion extends Version {

    public ZetecVersion(String version, WMAttribute att, WMObject wmObject) throws WMException {
        super(version, att, wmObject);
    }
    public ZetecVersion(Object version, WMAttribute att, WMObject wmObject) throws WMException {
        this(version.toString(), att, wmObject);
    }
    public ZetecVersion(WMAttribute att, WMObject wmObject) throws WMException {
        this(null, att, wmObject);
    }
    /**    private ArrayList<String> skipChars = <"I","O","Q","S","X","Z","AI","AO","AQ","AS","AX","AZ","BI","BO","BQ","BS","BX","BZ","CI","CO","CQ","CS","CX","CZ","DI","DO","DQ","DS","DX","DZ","EI","EO","EQ","ES","EX","EZ","FI","FO","FQ","FS","FX","FZ","GI","GO","GQ","GS","GX","GZ","HI","HO","HQ","HS","HX","HZ","JI","JO","JQ","JS","JX","JZ","KI","KO","KQ","KS","KX","KZ","LI","LO","LQ","LS","LX","LZ","MI","MO","MQ","MS","MX","MZ","NI","NO","NQ","NS","NX","NZ","PI","PO","PQ","PS","PX","PZ","RI","RO","RQ","RS","RX","RZ","TI","TO","TQ","TS","TX","TZ","UI","UO","UQ","US","UX","UZ","VI","VO","VQ","VS","VX","VZ","WI","WO","WQ","WS","WX","WZ","YI","YO","YQ","YS","YX","YZ","II","IO","IQ","IS","IX","IZ","OI","OO","OQ","OS","OX","OZ","QI","QO","QQ","QS","QX","QZ","SI","SO","SQ","SS","SX","SZ","XI","XO","XQ","XS","XX","XZ","ZI","ZO","ZQ","ZS","ZX","ZZ","IA","IB","IC","ID","IE","IF","IG","IH","IJ","IK","IL","IM","IN","IP","IR","IT","IU","IV","IW","IY","OA","OB","OC","OD","OE","OF","OG","OH","OJ","OK","OL","OM","ON","OP","OR","OT","OU","OV","OW","OY","QA","QB","QC","QD","QE","QF","QG","QH","QJ","QK","QL","QM","QN","QP","QR","QT","QU","QV","QW","QY","SA","SB","SC","SD","SE","SF","SG","SH","SJ","SK","SL","SM","SN","SP","SR","ST","SU","SV","SW","SY","XA","XB","XC","XD","XE","XF","XG","XH","XJ","XK","XL","XM","XN","XP","XR","XT","XU","XV","XW","XY","ZA","ZB","ZC","ZD","ZE","ZF","ZG","ZH","ZJ","ZK","ZL","ZM","ZN","ZP","ZR","ZT","ZU","ZV","ZW","ZY">;
     * manually built in Excel
     */
    private static ArrayList<String> zAlphabet = new ArrayList<String>();

    @Override
    public String getActualNextMajorRevision(int type) throws WMException {
        String nextRev = super.getActualNextMajorRevision(type);

        String[] zSkipChars = {"I", "O", "Q", "S", "X", "Z"}; //defines characters to be skipped, could be pulled from xml rather than hardcoded
        List<String> zAllSkip = new ArrayList<String>(Arrays.asList(zSkipChars)); //Begins defining all combinations of revs to skip, starting with zSlipChars

        for (char zLetter = 'A'; zLetter <= 'Z'; zLetter++) {  //creates array containing the alpahbet
            zAlphabet.add(String.valueOf(zLetter));
        }
        
        for (String word : zAllSkip) { /* remove skip characters from the alphabet   http://stackoverflow.com/questions/11710588/remove-arraylist-element  */
            while (zAlphabet.contains(word)) {
                zAlphabet.remove(word);
            }
        } 
        
        /* Add two character revisions to finish defining all combindations of revs to skip     */
        for (String firstL : zAlphabet) {
            for (String secondL : zSkipChars) {
                zAllSkip.add(firstL + secondL);
            }
        }
        for (String firstL : zSkipChars) {
            for (String secondL : zAlphabet) {
                zAllSkip.add(firstL + secondL);
            }
        } //    System.out.println(zAllSkip); //    System.out.println(zAllSkip.size());

        if (zAllSkip.contains(nextRev)) {
            nextRev = getActualNextMajorRevision(type);
        }
        return (nextRev);
    }
    /**
 * Returns the string containing the next major revision. All the necessary database
 * work is done to verify that this is the next major revision.
 *
 * @param type indicating whether the revision type is MAJOR or MINOR
 * @throws WMException if anything goes wrong
 * @return the actual next major revision
 *
 *
public String getActualNextMajorRevision(int type)
throws WMException {
String retVal = null;

if (type == MAJOR) {
nextMajorRev = getNextMajorRevision(type);

if (getVersionUtils().doesMajorRevisionExist((Versionable) getWMObject(), nextMajorRev)) {
final Version highest = getVersionUtils().getHighestVersion((Versionable) getWMObject()).getVersion();
nextMajorRev = highest.getNextMajorRevision(type);
}

retVal = nextMajorRev;
} else {
retVal = getMajorRev();
}

return retVal;
}
 */

}
Then I just found this in the ModelManager Customization Guide for the Business Logic extension lab:
Code:
package com.acme.dm.biz;

import com.osm.biz.*;
import com.osm.exception.*;

import com.osm.dm.biz.DMModel3D;

public class AcmeModel3D extends DMModel3D {

   public AcmeModel3D(WMSession theSession, int theHandle) throws WMException {

      super(theSession, theHandle);
   }

   @Override
   public void setName(String name) throws WMException {
      if (name.indexOf('l') > -1) {
         throw new WMException ("l not allowed in model name");
      }
      if (name.indexOf('o') > -1) {
         throw new WMException ("o not allowed in model name");
      }
      if (name.indexOf('i') > -1) {
         throw new WMException ("i not allowed in model name");
      }

      super.setName(name);
   }
}
Can anyone comment on the value of one approach or the other? Do any flaws in my Java jump out?
Reply With Quote
  #6  
Old 02-15-2015, 05:25 PM
andyadams andyadams is offline
Registered User
 
Join Date: Feb 2015
Posts: 1
Re: automatically skip revisions I O Q S X and Z

Hello,i am a java barcode developer and my work is to generate qrcode using java class.Recently have a problem of how to skip a revision in svn repository.
So say I have the three latest revisions of an aspx file: 55, 56 and 57. Revision 56 added a feature that I want to remove, but I also want to have the new features deployed in version 57. Is there any way I can merge version 55 with 57, leaving revision 56 out of the picture?
If it matters, I'm using Tortoise SVN and Visual SVN, but I normally just use Tortoise.
Thanks for any ideas.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:12 PM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
You Rated this Thread: