# EssOtlVerifyOutlineEx

Description

EssOtlVerifyOutlineEx() verifies that the specified outline is correct and builds an array of the errors found in that outline. The function returns both global outline errors and errors for each incorrect member.

Syntax

    ESS_FUNC_M EssOtlVerifyOutlineEx (hOutline, pulErrors, pulCount, pMbrErrors);

ESS_HOUTLINE_T | hOutline
ESS_PULONG_T | pulErrors
ESS_PULONG_T | pulCount
ESS_PPOUTERROR_T | pMbrErrors

Parameters

hOutline | Outline context handle.
pulErrors | Pointer to bitmask destination for global outline errors. If the outline had formula errors the only field with a value is ESS_OUTERROREX_OUTLINEHASFORMULAERROR
pulCount | Count of members with errors. This defines the number of elements of the pMbrErrors array. The errors will be bitmasks if the outline had errors. If the outline had only formula errors the pMbrError fields comprise error numbers (ulErrors) and line numbers (ulErrors2). In that case pulErrors is set to ESS_OUTERROREX_OUTLINEHASFORMULAERROR.
pMbrErrors | Pointer to an array with *pulCount members. Each element of the array contains the errors for a single member.

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_ERR_OPENMODE
OTLAPI_BAD_HOUTLINE OTLAPI_NULL_ARG

Notes

- This function calls EssOtlVerifyOutline. If that call is successful, this function then calls EssOtlVerifyFormula for each member that has a formula and includes any formula errors in the output error array. If the call to EssOtlVerifyOutline() in not successful, this function operates exactly like EssOtlVerifyOutline().
- This function checks for:
  - Duplicate user attributes in shared members.
  - Duplicate level or generation names or aliases.
  - Restrictions on adding and associating attributes.
- Use EssFree() to free the pMbrErrors array.

Example

    ESS_STS_T TestVerifyOtlEx(ADT_CMDCTX_T *cmdctxp)
    {
       ESS_STS_T         sts = ESS_STS_NOERR;
       ESS_STS_T         sts2 = ESS_STS_NOERR;
       ESS_SHORT_T       hOutline;
       ESS_ULONG_T       ulErrors;
       ESS_ULONG_T       ulCount;
       ESS_POUTERROR_T   pMbrErrors;
       ESS_ULONG_T       ind;
       ESS_PMBRINFO_T    ppMbrInfo;

       if (cmdctxp->cmdbuf.argn < 2)
       {
          hOutlineChoice = ishOutlineMenu(cmdctxp);
       }
       else
       {
          hOutlineChoice = atoi(*(cmdctxp->cmdbuf.args + 1));
       }

       sts = EssOtlVerifyOutlineEx(cmdctxp->hOutline[hOutlineChoice], &ulErrors,
                                   &ulCount, &pMbrErrors);

       if (sts == ESS_STS_NOERR)
       {
          fprintf(cmdctxp->output, "\n------Global Errors------\n");

          if (ulErrors & ESS_OUTERROR_CURTOOMANYDIMS)
          {
             fprintf(cmdctxp->output, "Too many dimensions in currency outline\n");
          }
          else if(ulErrors & ESS_OUTERROR2_ATTRCALCABSENT)
          {
             fprintf(cmdctxp->output, "Attribute calculations dimension is absent\n");
          }
          else if(ulErrors & ESS_OUTERROREX_OUTLINEHASFORMULAERROR)
          {
             fprintf(cmdctxp->output, "Outline has formula error\n");
          }
          else if (ulErrors == 0)
          {
             fprintf(cmdctxp->output, "No errors\n");
          }
          else
          {
             fprintf(cmdctxp->output, "Unknown error\n");
          }

          fprintf(cmdctxp->output, "\n------Member Errors------\n");

    		if(ulErrors != ESS_OUTERROREX_OUTLINEHASFORMULAERROR)
    		{
    			  for (ind = 0; ind < ulCount; ind++)
    			  {
    				 sts2 = EssOtlGetMemberInfo(cmdctxp->hOutline[hOutlineChoice],
    										   pMbrErrors[ind].hMember, &ppMbrInfo);

    				 if (sts2 == ESS_STS_NOERR)
    				 {
    					fprintf(cmdctxp->output, "Member: %s\n", ppMbrInfo->szMember);
    					EssFree(cmdctxp->hInst, ppMbrInfo);
    				 }
    				 else
    				 {
    					fprintf(cmdctxp->output, "Member: Unknown member\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_ILLEGALNAME)
    				 {
    					fprintf(cmdctxp->output, "   ESS_OUTERROREX_OUTLINEHASFORMULAERROR\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_DUPLICATENAME)
    				 {
    					fprintf(cmdctxp->output, "   ESS_OUTERROR_DUPLICATENAME\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_ILLEGALCURRENCY)
    				 {
    					fprintf(cmdctxp->output, "   ESS_OUTERROR_ILLEGALCURRENCY\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_ILLEGALDEFALIAS)
    				 {
    					fprintf(cmdctxp->output, "   ESS_OUTERROR_ILLEGALDEFALIAS\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_ILLEGALCOMBOALIAS)
    				 {
    					fprintf(cmdctxp->output, "   ESS_OUTERROR_ILLEGALCOMBOALIAS\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_ILLEGALALIASSTRING)
    				 {
    					fprintf(cmdctxp->output, "   ESS_OUTERROR_ILLEGALALIASSTRING\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_ILLEGALTAG)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_ILLEGALTAG\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_NOTIMEDIM)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_NOTIMEDIM\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_DUPLICATEALIAS)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_DUPLICATEALIAS\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_MEMBERCALC)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_MEMBERCALC\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_SHARENOTLEVEL0)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_SHARENOTLEVEL0\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_NOSHAREPROTO)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_NOSHAREPROTO\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_TIMESPARSE)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_TIMESPARSE\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_LEAFLABEL)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_LEAFLABEL\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_ALIASSHARED)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_ALIASSHARED\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_BADTIMEBAL)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_BADTIMEBAL\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_BADSKIP)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_BADSKIP\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_BADSHARE)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_BADSHARE\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_BADSTORAGE)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_BADSTORAGE\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_BADCATEGORY)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_BADCATEGORY\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_BADSTORAGECATEGORY)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_BADSTORAGECATEGORY\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_SHAREDMEMBERFORMULA)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_SHAREDMEMBERFORMULA\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_SHAREUDA)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_SHAREUDA\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_DUPGENLEVNAME)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_DUPGENLEVNAME\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_VIRTLEV0NOFORMULA)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_VIRTLEV0NOFORMULA\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_VIRTBADPARENT)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_VIRTBADPARENT\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_VIRTBADCHILD)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_VIRTBADCHILD\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors & ESS_OUTERROR_VIRTWHOLEDIMVIRTUAL)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR_VIRTWHOLEDIMVIRTUAL\n");
    				 }

    				 if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_NOTLEVEL0)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_NOTLEVEL0\n");
    				 }
    				 if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_LEVELMISMATCH)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_LEVELMISMATCH\n");
    				 }
    				 if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ILLEGALORDER)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ILLEGALORDER\n");
    				 }
    				 if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ILLEGALDATATYPE)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ILLEGALORDER\n");
    				 }
    				 if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_DATATYPEMISMATCH)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_DATATYPEMISMATCH\n");
    				 }
    				 if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ILLEGALATTRIBUTEPARENT)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ILLEGALATTRIBUTEPARENT\n");
    				 }
    				 if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ATTRDIMNOTASSOCIATED)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ATTRDIMNOTASSOCIATED\n");
    				 }
    				 if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ILLEGALUDA)
    				 {
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ILLEGALUDA\n");
    				 }
    				if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_CHILDCOUNT)
    				{
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_CHILDCOUNT\n");
    				}
    				if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ILLEGALATTRCALC)
    				{
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ILLEGALATTRCALC\n");
    				}
    				if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_DUPLICATEATTRCALC)
    				{
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_DUPLICATEATTRCALC\n");
    				}
    				if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ILLEGALATTRSET)
    				{
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ILLEGALATTRSET\n");
    				}
    				if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ILLEGALATTRCALCSET)
    				{
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ILLEGALATTRCALCSET\n");
    				}
    				if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_NOTATTRIBUTE)
    				{
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_NOTATTRIBUTE\n");
    				}
    				if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ATTRCALCABSENT)
    				{
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ATTRCALCABSENT\n");
    				}
    				if (pMbrErrors[ind].ulErrors2 & ESS_OUTERROR2_ILLEGALATTRVALUE)
    				{
    					fprintf(cmdctxp->output,"   ESS_OUTERROR2_ILLEGALATTRVALUE\n");
    				}
    			}
    		}

          if(ulErrors != ESS_OUTERROREX_OUTLINEHASFORMULAERROR)
          {
    	        for (ind = 0; ind < ulCount; ind++)
    	        {
    		       sts2 = EssOtlGetMemberInfo(cmdctxp->hOutline[hOutlineChoice],
    								         pMbrErrors[ind].hMember, &ppMbrInfo);

    		       if (sts2 == ESS_STS_NOERR)
    		       {
    			      fprintf(cmdctxp->output, "Member: %s\n", ppMbrInfo->szMember);
    			      EssFree(cmdctxp->hInst, ppMbrInfo);
    		       }
    		       else
    		       {
    			      fprintf(cmdctxp->output, "Member: Unknown member\n");
    		       }

    		       fprintf(cmdctxp->output, "Error %d at line %d\n", pMbrErrors[ind].ulErrors, pMbrErrors[ind].ulErrors2);
    	        }
          }

          if (ulCount == 0)
          {
             fprintf(cmdctxp->output, "No errors\n");
          }

          EssFree(cmdctxp->hInst, pMbrErrors);
       }

       fprintf(cmdctxp->output, "\nsts: %ld\n\n", sts);

       return(sts);
    }

See Also

- EssOtlNewOutline()
- EssOtlOpenOutline()
- EssOtlWriteOutline()
- EssOtlVerifyOutline
- EssOtlVerifyFormula