/* * dREHER [email protected] * * Genera un string con todos los ID de las organizaciones hojas hijas, en caso de que la organizacion actual sea del tipo carpeta isSummary='Y' * */ public String getOrgsChildsAsString() { String orgs = null; String orgsX = ""; // LLamo a metodo getOrgsChilds, para evitar duplicidad de codigo ArrayList<MOrg> orgsA = this.getOrgsChilds(); for (MOrg org : orgsA) orgsX += (!orgsX.isEmpty() ? "," : "") + org.getAD_Org_ID(); if (orgsX != "") orgs = orgsX; return orgs; }
/** * Get Org from Cache * * @param ctx context * @param AD_Org_ID id * @return MOrg */ public static MOrg get(Properties ctx, int AD_Org_ID) { Integer key = new Integer(AD_Org_ID); MOrg retValue = (MOrg) s_cache.get(key); if (retValue != null) { return retValue; } retValue = new MOrg(ctx, AD_Org_ID, null); if (retValue.getID() != 0) { s_cache.put(key, retValue); } return retValue; } // get
public static List<Integer> getParentOrgs( Properties ctx, Integer orgID, boolean includeItIfIsFolder, String trxName) { List<Integer> parentOrgsID = new ArrayList<Integer>(); if (includeItIfIsFolder) { MOrg org = MOrg.get(ctx, orgID); if (org.isSummary()) { parentOrgsID.add(orgID); } } Integer orgParentID = 0; Integer auxOrgID = orgID; do { orgParentID = MOrg.getOrgParentID(ctx, auxOrgID, trxName); parentOrgsID.add(orgParentID); auxOrgID = orgParentID; } while (orgParentID != null && orgParentID >= 0); return parentOrgsID; }
/** * Organization Constructor * * @param org parent */ public MWarehouse(MOrg org) { this(org.getCtx(), 0, org.get_TrxName()); setClientOrg(org); setValue(org.getValue()); setName(org.getName()); if (org.getInfo() != null) { setC_Location_ID(org.getInfo().getC_Location_ID()); } } // MWarehouse