cancel
Showing results for 
Search instead for 
Did you mean: 

DirApi password not being read

Former Member
0 Kudos

All,

I am working on dirapi program to read channel info into an excel. the program works fine. However I see that the password field is coming empty. I know this issue was there in PI 7.0 dirapi but my understanding was that this was fixed in PI 7.1 EHP1 and that we could read the pasword field as well.

any thoughts.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

Earlier Version (7.1)

Password attributes are not returned in the Read response and must be supplied in the Change request in order for the password to be set in the channel.

New Version (7.1 EHP1 and above)

Password attributes are not returned in the Read response. But there is delta handling for password attributes in the Change request. This means the Directory API will ensure that existing passwords are kept even if the Change request does not supply any password values.

Former Member
0 Kudos

That's good news. That means if I do not provide any password in my change request the password field will be retained and if I provide one then the password would be overwritten...

Please confirm.

former_member184720
Active Contributor
0 Kudos

Yes..

Former Member
0 Kudos

Hareesh,

One more question.. (Let me know if you would like me to starta seperate thread).

I have read all channel properties in the excel. My program also reads adapter specific , module specific parameters in name value pair in excel in each cell. for example:

file.sourceFileName::CHASE.txt

file.conversionParameters::Record_Number,INTERNAL_PRODUCT_CODE

file.conversionParameters::2,8

file.adapterStatus::active

and others

Now if I want to set this channel as inactive using dirapi change method...then do i need to read and feed all the downloaded parameters back for a change..or there are some manadatory/optional fields (like password) that are retained anyway.

Thanks.

former_member184720
Active Contributor
0 Kudos

I don't think so.. you can simply update the adapter status to Inactive.. it should work..

Former Member
0 Kudos

Hareesh,

I am trying to read the following values from an excel to update the channel:

  • AdapterSpecificAttribute
  • AdapterSpecificTableAttribute
  • Module Configuration

Can all of these properties be read into:

List<GenericPropertyType> properties = new ArrayList<GenericPropertyType>();

                                                  GenericPropertyType property = new GenericPropertyType();

or do I need to use a different method to read each of these values?

Thanks.

Former Member
0 Kudos

any thoughts...

former_member184720
Active Contributor
0 Kudos

Have not really worked on it. But may be the below blog should help you.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/12/02/tool-to-update-large-number-of-co...

anandvithal
Active Participant
0 Kudos

Hi Vicky,

for AdapterSpecificAttribute:

List<GenericProperty> asa = cc.getAdapterSpecificAttribute();

for(int j=0;j<asa.size();j++)

{

String name = asa.get(j).getName().getValue();

String value = asa.get(j).getValue().getValue();

//add your logic to write name and value to excelsheet

}

for AdapterSpecificTableAttribute:

List<GenericPropertyTable> channeltablevalues = cc.getAdapterSpecificTableAttribute();

for(int j=0;j<channeltablevalues.size();j++)

{

String name = channeltablevalues.get(j).getName().getValue();

List<GenericTableRow> tablerows = channeltablevalues.get(j).getValueTableRow();

for(int k=0;k<tablerows.size();k++)

{

  List<GenericTableRowTableCell> cells = tablerows.get(k).getValueTableCell();

  for(int l=0;l<cells.size();l++)

  {

   String cellval = cells.get(l).getValue().getValue();

   //write your logic here to wrtie this cellval to excelsheet

  }

}

}

for ModuleProcess:

ModuleProcess mp = cc.getModuleProcess().getValue();

List<ProcessStep> modules = mp.getProcessStep();
for(int j=0;j<modules.size();j++)
{
String modulename = modules.get(j).getModuleName().getValue();
String modulekey = modules.get(j).getParameterGroupID().getValue();
//add your logic to wrtie module name and its key to excelsheet

List<ParameterGroup> allparameters = mp.getParameterGroup();
for(int l=0;l<allparameters.size();l++)
{
  if(modulekey.equals(allparameters.get(l).getParameterGroupID().getValue()))
  {
   List<GenericPropertyRestricted> moduleparameters = allparameters.get(l).getParameter();
   for(int k=0;k<moduleparameters.size();k++)
   {
    String moduleparametername = moduleparameters.get(k).getName().getValue();
    String moduleparametervalue = moduleparameters.get(k).getValue().getValue();
    //add your logic to write the module parameter names and values to excelsheet
   }
  break;
  }
}
}

in all above, cc is CommunicationChannel object.

Hope it helps.

Thanks,

Anand

Former Member
0 Kudos

Appreciate your time to reply.. Anand.

However I have already accomplished reading these parameters from PI to Excel. My question was more around on how to read these values from an excel and update PI. Would appreciate if you could shed some light on that part.

anandvithal
Active Participant
0 Kudos

Hi Vicky,

will your program update adapter-specific-attributes or adapter-specific-table-attributes or module details of channel?

Keep in mind that even if you want to change just one attribute of a channel you have to pass all other attributes of that channel.

Also tell me know which excel api you are using Jxl or Apache POI.

Thanks,

Anand

Former Member
0 Kudos

will your program update adapter-specific-attributes or adapter-specific-table-attributes or module details of channel?

Do I have a choice? My understanding is that if I want to change even a single field in the channel no matter what field it is....i have to provide all the other details as well. Is my understanding correct.

Also I am using Apache POI.

I am using for AdapterSpecificAttribute:

property1.setName(row.getCell(c).getStringCellValue(a));

       property1.setValue(row.getCell(c).getStringCellValue(b));

       properties1.add(property1);

for (int j = 0; j < properties1.size(); j++)

      {

       channel.getAdapterSpecificAttribute().add(properties1.get(j));

      }

Former Member
0 Kudos

Any inputs Anand?

anandvithal
Active Participant
0 Kudos

The code in your previous reply seems fine. What is the issue you are facing?

Former Member
0 Kudos

How to read the ASTA from excel and update the channel?

     List<GenericPropertyTableType> propTabs = new ArrayList<GenericPropertyTableType>();

     GenericPropertyTableType propTab = new GenericPropertyTableType();

    

     List<GenericTableRowType> propTabRows = new ArrayList<GenericTableRowType>();

     GenericTableRowType propTabRow = new GenericTableRowType();

    

     List<GenericTableRowTableCellType> propTabRowCells = new ArrayList<GenericTableRowTableCellType>();

     GenericTableRowTableCellType propTabRowCell = new GenericTableRowTableCellType();

int numproperties =0;

      while ( row.getCell(c)!= null && row.getCell(c).getStringCellValue().startsWith("ASTA:<Name>"))

      {  

      

       int pos1 = row.getCell(c).getStringCellValue().indexOf("ASTA:<Name>");

       pos1=pos1+ "ASTA:<Name>".length();

      

       int pos2 = row.getCell(c).getStringCellValue().indexOf("</Name><ParamName>");

       int pos3 = row.getCell(c).getStringCellValue().indexOf("</ParamName><ParamValue>");

       int pos4 = row.getCell(c).getStringCellValue().indexOf("</ParamValue>");

      

       System.out.println(row.getCell(c).getStringCellValue().substring(pos1, pos2));

      

       pos2 = pos2+ "</Name><ParamName>".length();

       System.out.println(row.getCell(c).getStringCellValue().substring(pos2, pos3));

      

       pos3 = pos3+ "</ParamName><ParamValue>".length();

       System.out.println(row.getCell(c).getStringCellValue().substring(pos3, pos4));

      

       propTabRowCell.setColumnName(row.getCell(c).getStringCellValue().substring(pos2, pos3));

       propTabRowCell.setValue(row.getCell(c).getStringCellValue().substring(pos3, pos4));

       propTabRowCells.add(propTabRowCell);

      

       propTabRow.getValueTableCell().set(numproperties+1, propTabRowCell);

       numproperties++;

       propTabRows.add(propTabRow);

      

       propTab.setName(row.getCell(c).getStringCellValue().substring(pos1, pos2));

       c++;

      }

Here is how values are stored in Excel which I am trying to read.

cell 1 =

ASTA:<Name>file.conversionParameters</Name><ParamName>file.addConvParamName</ParamName><ParamValue>TrackingFFRecord.fieldNames</ParamValue>

cell 2 =

ASTA:<Name>file.conversionParameters</Name><ParamName>file.addConvParamValue</ParamName><ParamValue>ProgramID,DocType,TradingPartnerID,BTTrackingNumber,</ParamValue>
anandvithal
Active Participant
0 Kudos

It looks fine. Whats the issue here?

Former Member
0 Kudos

Now I am trying to read module parameters from excel and update the channels.  My code is working fine...except for one small glitch. In my channel there are two 'ModuleKey' 'ParameterName' and 'ParameterValue' groups under 'Module Configuration' in channel. However when I execute the code below...only the last of the two groups gets created and the 1st group gets removed.

     List<ParameterGroupType> PGTypes = new ArrayList<ParameterGroupType>();

     ParameterGroupType PGType = new ParameterGroupType();    

    

     List<ProcessStepType> PSTypes = new ArrayList<ProcessStepType>();

     ProcessStepType PSType = new ProcessStepType();

    

     List<RestrictedGenericPropertyType> RGPTypes = new ArrayList<RestrictedGenericPropertyType>();

     RestrictedGenericPropertyType RGPType = new RestrictedGenericPropertyType();

     ModuleProcessType module = new ModuleProcessType();

int pgSize = 0;
while (row.getCell(c) != null && row.getCell(c).getStringCellValue().startsWith("MCPG:<PGName>"))
{
int pos1 = row.getCell(c).getStringCellValue().indexOf("MCPG:<PGName>") + "MCPG:<PGName>".length();
PGType.setParameterGroupID(row.getCell(c).getStringCellValue().substring(row.getCell(c).getStringCellValue().indexOf("</PGValue><PGID>")+"</PGValue><PGID>".length(),row.getCell(c).getStringCellValue().indexOf("</PGID>")));      
RGPType.setName(row.getCell(c).getStringCellValue().substring(pos1,row.getCell(c).getStringCellValue().indexOf("</PGName><PGValue>")));
RGPType.setValue(row.getCell(c).getStringCellValue().substring(row.getCell(c).getStringCellValue().indexOf("</PGName><PGValue>")+"</PGName><PGValue>".length(),row.getCell(c).getStringCellValue().indexOf("</PGValue><PGID>")));

RGPTypes.add(RGPType);
PGType.getParameter().add(RGPTypes.get(pgSize));
PGTypes.add(PGType);
RGPType = new RestrictedGenericPropertyType();
PGType = new ParameterGroupType();

pgSize++;
c++;
}

for (int j = 0; j < PGTypes.size(); j++) {

module.getParameterGroup().add(PGTypes.get(j));
channel.setModuleProcess(module);
}

Please advice.

Former Member
0 Kudos

Now I am trying to read module parameters from excel and update the channels.  My code is working fine...except for one small glitch. In my channel there are two 'ModuleKey' 'ParameterName' and 'ParameterValue' groups under 'Module Configuration' in channel. However when I execute the code below...only the last of the two groups gets created and the 1st group gets removed.

     List<ParameterGroupType> PGTypes = new ArrayList<ParameterGroupType>();

     ParameterGroupType PGType = new ParameterGroupType();    

    

     List<ProcessStepType> PSTypes = new ArrayList<ProcessStepType>();

     ProcessStepType PSType = new ProcessStepType();

    

     List<RestrictedGenericPropertyType> RGPTypes = new ArrayList<RestrictedGenericPropertyType>();

     RestrictedGenericPropertyType RGPType = new RestrictedGenericPropertyType();

     ModuleProcessType module = new ModuleProcessType();

int pgSize = 0;
while (row.getCell(c) != null && row.getCell(c).getStringCellValue().startsWith("MCPG:<PGName>"))
{
int pos1 = row.getCell(c).getStringCellValue().indexOf("MCPG:<PGName>") + "MCPG:<PGName>".length();
PGType.setParameterGroupID(row.getCell(c).getStringCellValue().substring(row.getCell(c).getStringCellValue().indexOf("</PGValue><PGID>")+"</PGValue><PGID>".length(),row.getCell(c).getStringCellValue().indexOf("</PGID>")));      
RGPType.setName(row.getCell(c).getStringCellValue().substring(pos1,row.getCell(c).getStringCellValue().indexOf("</PGName><PGValue>")));
RGPType.setValue(row.getCell(c).getStringCellValue().substring(row.getCell(c).getStringCellValue().indexOf("</PGName><PGValue>")+"</PGName><PGValue>".length(),row.getCell(c).getStringCellValue().indexOf("</PGValue><PGID>")));

RGPTypes.add(RGPType);
PGType.getParameter().add(RGPTypes.get(pgSize));
PGTypes.add(PGType);
RGPType = new RestrictedGenericPropertyType();
PGType = new ParameterGroupType();

pgSize++;
c++;
}

for (int j = 0; j < PGTypes.size(); j++) {

module.getParameterGroup().add(PGTypes.get(j));
channel.setModuleProcess(module);
}

Please advice.

Former Member
0 Kudos

I was able to update the Module Parameters.

Now the only thing left is Adapter Specific Table Attributes.

Anand, I would appreciate your help with this one.

Thanks

Former Member
0 Kudos

Hareesh,

Please let me know your thoughts on this issue.

Former Member
0 Kudos

Hareesh,

Any inputs on Adapter Specific Table attributes issue.

Thanks

Former Member
0 Kudos

Anand,

Is there a way I can contact you directly. I have a few questions around how to make my program robust. I know you have done this earlier and would be able to guide me in the right direction.

Appreciate your help in advance.

Thanks.

anandvithal
Active Participant
0 Kudos

send an email to me at anand.dabrabad@gmail.com

Former Member
0 Kudos

Will the PI 7.11 dirapi code work with PI7.31. I will need to use it to migrate the communication channels.

Answers (0)