Java Code Examples for org.olap4j.metadata.Member#getUniqueName()
The following examples show how to use
org.olap4j.metadata.Member#getUniqueName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NodeFilter.java From Knowage-Server with GNU Affero General Public License v3.0 | 6 votes |
public NodeFilter(Member m) throws OlapException { super(); this.id = m.getUniqueName(); this.uniqueName = m.getUniqueName(); this.name = m.getCaption(); this.visible = false; this.collapsed = false; this.children = new HashSet<NodeFilter>(); this.leaf = m.getChildMemberCount() == 0; if (m != null) { List<Member> list = (List<Member>) m.getChildMembers(); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { NodeFilter nf = new NodeFilter(list.get(i)); children.add(nf); } } } }
Example 2
Source File: MemberJsonSerializer.java From Knowage-Server with GNU Affero General Public License v3.0 | 6 votes |
@Override public void serialize(Member value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.writeStartObject(); // value.getUniqueName().equals("[Customers].[Canada]"){ // value.getProperties() // } jgen.writeStringField(NAME, value.getName()); jgen.writeStringField(UNIQUE_NAME, value.getUniqueName()); jgen.writeStringField(ID, value.getUniqueName()); jgen.writeStringField(TEXT, value.getName()); // jgen.writeBooleanField(VISIBLE, value.isVisible()); try { jgen.writeBooleanField(LEAF, value.getChildMemberCount() == 0); } catch (OlapException e) { throw new IOException("Error getting the childs count for the member " + value.getUniqueName()); } jgen.writeEndObject(); }
Example 3
Source File: MondrianSchemaRetriver.java From Knowage-Server with GNU Affero General Public License v3.0 | 6 votes |
/** * Gets the name of the column of the measure * * @param member * @return * @throws SpagoBIEngineException */ public String getMeasureColumn(Member member) throws SpagoBIEngineException { String measure = member.getName(); try { if ((member.getDimension().getDimensionType().equals(Type.MEASURE))) { for (int i = 0; i < editCube.measures.length; i++) { if (editCube.measures[i].name.equals(measure)) { return editCube.measures[i].column; } } } } catch (OlapException e) { logger.error("Error loading the measure linked to the member " + member.getUniqueName(), e); throw new SpagoBIEngineException("Error loading the measure linked to the member " + member.getUniqueName(), e); } return null; }
Example 4
Source File: Olap4jFactory.java From jasperreports with GNU Lesser General Public License v3.0 | 6 votes |
public Olap4jMember createMember(Member member) { Olap4jMember mondrianMember; if (member == null) { mondrianMember = null; } else { String key = member.getUniqueName(); mondrianMember = members.get(key); if (mondrianMember == null) { mondrianMember = new Olap4jMember(member, this); members.put(key, mondrianMember); } } return mondrianMember; }
Example 5
Source File: SbiMember.java From Knowage-Server with GNU Affero General Public License v3.0 | 5 votes |
public SbiMember(Member member, boolean visible, String description) { this.uniqueName = member.getUniqueName(); this.id = member.getUniqueName(); this.name = member.getCaption(); this.text = calculateText(member.getName(), member.getCaption()); try { this.leaf = member.getChildMemberCount() == 0; } catch (OlapException e) { throw new SpagoBIEngineRuntimeException("Error getting the childs count for the member " + member.getUniqueName(), e); } this.visible = visible; this.qtip = description; }
Example 6
Source File: AbstractUpdatingAlgotithmsDataManager.java From Knowage-Server with GNU Affero General Public License v3.0 | 5 votes |
public String executeUpdate(Member[] members, double prop, Connection connection, Integer version) throws Exception { // list of the coordinates for the members List<IMemberCoordinates> memberCordinates = new ArrayList<IMemberCoordinates>(); // init the query with the update set statement StringBuffer query = new StringBuffer(); // gets the measures and the coordinates of the dimension members for (int i = 0; i < members.length; i++) { Member aMember = members[i]; try { if (!(aMember.getDimension().getDimensionType().equals(Type.MEASURE))) { memberCordinates.add(retriver.getMemberCordinates(aMember)); } else { buildUpdate(query, aMember, prop); } } catch (OlapException e) { logger.error("Error loading the type of the dimension of the member " + aMember.getUniqueName(), e); throw new SpagoBIEngineException("Error loading the type of the dimension of the member " + aMember.getUniqueName(), e); } } String whereClause = buildFromAndWhereClauseForCell(members, version, useInClause); query.append(whereClause); String queryString = query.toString(); SqlUpdateStatement updateStatement = new SqlUpdateStatement(queryString); updateStatement.executeStatement(connection); return queryString.toString(); }
Example 7
Source File: AbstractSqlSchemaManager.java From Knowage-Server with GNU Affero General Public License v3.0 | 5 votes |
public String buildFromAndWhereClauseForCell(Member[] members, Integer version, boolean useInClause) throws Exception { // list of the coordinates for the members List<IMemberCoordinates> memberCordinates = new ArrayList<IMemberCoordinates>(); // init the query with the update set statement StringBuffer query = new StringBuffer(); // gets the measures and the coordinates of the dimension members for (int i = 0; i < members.length; i++) { Member aMember = members[i]; try { if (!(aMember.getDimension().getDimensionType().equals(Type.MEASURE))) { memberCordinates.add(retriver.getMemberCordinates(aMember)); } } catch (OlapException e) { logger.error("Error loading the type of the dimension of the member " + aMember.getUniqueName(), e); throw new SpagoBIEngineException("Error loading the type of the dimension of the member " + aMember.getUniqueName(), e); } } String queryString; if (useInClause) { queryString = buildWhereSingleSubquery(memberCordinates, query, version); } else { queryString = buildWhereOneSubqueryForDimension(memberCordinates, query, version); } return queryString; }
Example 8
Source File: OlapUtils.java From Knowage-Server with GNU Affero General Public License v3.0 | 4 votes |
/** * @param member * @param cube */ RaggedMemberWrapper(Member member, Cube cube) { this.baseMember = member; this.level = member.getLevel(); this.ancestors = new LinkedList<Member>(); List<IdentifierSegment> segments = Collections.unmodifiableList(IdentifierParser.parseIdentifier(member.getUniqueName())); List<IdentifierSegment> resolvableSegments = new LinkedList<IdentifierSegment>(); int i = 0; int count = segments.size(); List<Level> levels = member.getHierarchy().getLevels(); for (IdentifierSegment segment : segments) { resolvableSegments.add(segment); Level currentLevel = levels.get(i); Member ancestor; try { ancestor = cube.lookupMember(resolvableSegments); if (ancestor == null && i == 0) { ancestor = member.getHierarchy().getDefaultMember(); } } catch (OlapException e) { throw new PivotException(e); } if (i == 0 && ancestor == null) { throw new PivotException("Can't determine top level parent for the ragged member : " + member.getUniqueName()); } i++; if (i >= count) { this.uniqueName = getUniqueName(resolvableSegments); } else if (ancestor == null) { String currentName = getUniqueName(segments.subList(0, i)); ancestor = new RaggedMemberWrapper(currentName, currentLevel, new LinkedList<Member>(ancestors), baseMember, topMember); ancestors.add(0, ancestor); resolvableSegments.remove(segment); } else { ancestors.add(0, ancestor); this.topMember = ancestor; } } if (topMember == null) { throw new IllegalArgumentException("Unable to find a non-ragged ancestor of the specified member : " + member); } }
Example 9
Source File: NodeFilter.java From Knowage-Server with GNU Affero General Public License v3.0 | 4 votes |
public NodeFilter(Member m, int depth, Set<Member> leaves, Set<Member> visibleMembers, boolean showSiblings) throws OlapException { super(); if (visibleMembers != null && visibleMembers.contains(m)) { this.visible = true; visibleMembers.remove(m); } else { this.visible = false; } this.id = m.getUniqueName(); this.uniqueName = m.getUniqueName(); this.name = m.getCaption(); this.collapsed = false; this.children = new TreeSet<NodeFilter>(); this.leaf = m.getChildMemberCount() == 0; int curDepth = m.getDepth(); if (curDepth <= depth && !leaves.isEmpty()) { for (Member member : m.getChildMembers()) { if (isPotentialChild(leaves, member)) { this.collapsed = true; if (showSiblings && leaves.contains(member)) { for (Member member2 : m.getChildMembers()) { children.add(new NodeFilter(member2, depth, leaves, visibleMembers, showSiblings)); } break; } else { children.add(new NodeFilter(member, depth, leaves, visibleMembers, showSiblings)); } leaves.remove(member); } } } }
Example 10
Source File: CalculatedMemberManager.java From Knowage-Server with GNU Affero General Public License v3.0 | 4 votes |
private static List<IdentifierSegment> getParentSegments(Member parentMember, String calculateFieldName) { List<IdentifierSegment> parentSegments = new ArrayList<IdentifierSegment>(); String parentMemberUniqueName = parentMember.getUniqueName(); StringTokenizer tokenizer = new StringTokenizer(parentMemberUniqueName, "[]."); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); parentSegments.add(new NameSegment(token)); } parentSegments.add(new NameSegment(calculateFieldName)); return parentSegments; }