Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > Cognos
Cognos Forum d'entraide Cognos : Impromptu, Powerplay, transformer,...
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 22/04/2011, 10h59   #1
Invité de passage
 
Homme
Développeur Java
Inscription : avril 2011
Messages : 17
Détails du profil
Informations personnelles :
Sexe : Homme

Informations professionnelles :
Activité : Développeur Java
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : avril 2011
Messages : 17
Points : 2
Points : 2
Par défaut [COGNOS SDK] Lecture d'un dossier contenant des rapports

Bonjour à tous,
Je suis débutant en COGNOS SDK, et j'aimerai une petite aide

Voila l’exercice consiste à accèder aux rapports d'un "package" mais sans succès suite à un message d'erreur dont je ne comprend pas :
Citation:
"CM-REQ-4342 An error occurred with the client."
La connexion au serveur est OK, mais l'accès aux données non.

en appellant cette fonction -->
Code :
BaseClass bc[] = cmService.query(new   SearchPathMultipleObject(packagePath), props, sort, new QueryOptions());
il me retourne une exception.

voici le message d'erreur complet et le code java ci dessous

Merci pour votre aide

Citation:
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
22-avr.-2011 10:24:32 SetObjectSecurity.SetObjectSecurity connectToReportServer
INFO: Connection au Report Server...
22-avr.-2011 10:24:34 SetObjectSecurity.SetObjectSecurity connectToReportServer
INFO: Connection au Report Server Completed
22-avr.-2011 10:24:35 SetObjectSecurity.SetObjectSecurity main
INFO: Logon successful as test1
CM-REQ-4342 An error occurred with the client.


There are currently no published packages to display..
22-avr.-2011 10:49:08 SetObjectSecurity.SetObjectSecurity main
INFO: There are currently no published packages to display.
22-avr.-2011 10:49:08 SetObjectSecurity.SetObjectSecurity main
INFO: End Program



Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
public String viewPackages()
{
  String output = new String();
  IF (cmService != NULL) {
    BaseClass bc[] = this.getPackages();
    IF (bc != NULL){
       FOR (int i = 0; i < bc.length; i++){
        output = output.concat("" + bc[i].getDefaultName().getValue());
        output = output.concat("" + bc[i].getSearchPath().getValue());
       }
    }
    else
    {
     output = output.concat("There are currently no published packages to        display..");
    }
    }
        RETURN output;
    }
//----------------------------------------------------
public BaseClass[] getPackages(){
  String packagePath = "/content//package";
  PropEnum props[] = new PropEnum[] { PropEnum.searchPath,     PropEnum.defaultName };
  IF (cmService != NULL){
    Sort sort[] = { new Sort()};
    sort[0].setOrder(OrderEnum.ascending);
    sort[0].setPropName(PropEnum.defaultName);
    try    {
        BaseClass bc[] = cmService.query(new   SearchPathMultipleObject(packagePath), props, sort, new QueryOptions());
 
    IF (bc != NULL)
    {
       IF (bc.length > 0)
        RETURN bc;
    }
    else
    {
    System.out.println( "\n\nError occurred in function viewPackages.");
    }
     }
     catch (Exception e)
    {
        System.out.println(e.getMessage());
     }
   }
 else
 {
    System.out.println( "\n\nInvalid parameter passed to function viewPackages.");
 }
    RETURN NULL;
    }

Merci
2Fick est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/04/2011, 13h08   #2
Membre du Club
 
Homme Olivier
Inscription : avril 2008
Messages : 44
Détails du profil
Informations personnelles :
Nom : Homme Olivier
Localisation : France

Informations forums :
Inscription : avril 2008
Messages : 44
Points : 53
Points : 53
Bonjour,

Peux tu rajouter au niveau de ton Catch le code
Code :
e.printStackTrace(System.out);
afin d'avoir le message d'erreur remonté par Cognos?

Ensuite en lisant rapidement ton code, j'ai plus l'impression que tu cherches à récupérer la liste complète des packages disponibles sur le portail.

Pour info, tu es sur quelle version de Cognos?

Bon courage,
Nallack
Nallack est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/04/2011, 13h49   #3
Membre Expert
 
Avatar de Sunchaser
 
Homme Vincent
OPNI
Inscription : décembre 2004
Messages : 1 668
Détails du profil
Informations personnelles :
Nom : Homme Vincent
Âge : 41
Localisation : France, Manche (Basse Normandie)

Informations professionnelles :
Activité : OPNI
Secteur : Industrie Pharmaceutique

Informations forums :
Inscription : décembre 2004
Messages : 1 668
Points : 2 036
Points : 2 036
Bonjour,

Je pense un peu la même chose que Nallack.

Je n'ai pas revu la totalité du code, mais une chose qui me viens a l'esprit concerne le "seach Path". En effet, il semble que tu lances une recherche sur tout le Content Store / tout ce qui est packages.
Il faudrait essayer de tester au niveau de la variable "packagePath", et passer des valeurs du type "/content/folder[@name='NomduFolder']" ou bien "/content/package[@name='NomduPackage']".
En donnant les bonnes valeurs a la place de 'NomduFolder' ou 'NomduPackage', "évidemment"....

@+
__________________
Citation:
Aux persévérants aucune route n'est interdite
Question: un ver a pied, c'est un millepatte unijambiste ?

Mon dernier trip musical

Citation:
Quiconque construit un jardin devient un allié de la lumière, aucun jardin n'étant jamais surgi des ténèbres
A priori un proverbe Perse ...
Sunchaser est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/04/2011, 14h15   #4
Membre du Club
 
Homme Olivier
Inscription : avril 2008
Messages : 44
Détails du profil
Informations personnelles :
Nom : Homme Olivier
Localisation : France

Informations forums :
Inscription : avril 2008
Messages : 44
Points : 53
Points : 53
En fait, le searchPath est ce qui me gêne le moins, si l'on souhaite récupérer l'ensemble des packages du portail.

Par contre, si l'on cherche à récupérer l'ensemble des rapports qui utilisent un package, c'est pas dans ce sens-là que je l'aurais fait.

Via une commande XmlPath, je ne crois pas qu'il soit possible de récupérer ce qui est souhaité. Mais en passant par la liste des rapports et en filtrant ceux dont le package nous intéresse, on doit pouvoir y arriver rapidement.

Le code posté ressemble plus à l'exemple ViewCMPackages fournit avec le SDK de Cognos.


Bon courage,
Nallack
Nallack est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/04/2011, 15h39   #5
Invité de passage
 
Homme
Développeur Java
Inscription : avril 2011
Messages : 17
Détails du profil
Informations personnelles :
Sexe : Homme

Informations professionnelles :
Activité : Développeur Java
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : avril 2011
Messages : 17
Points : 2
Points : 2
Merci
voici déjà ce que me retourne cognos

Citation:
AxisFault
faultCode: Client
faultSubcode:
faultString: CM-REQ-4342 An error occurred with the client.
faultActor:
faultNode:
faultDetail:
{http://developer.cognos.com/schemas/bibus/3/}exception:
<severity>error</severity>
<errorCode>cmHeaderFault</errorCode>
<ns1:message>
<messageString>CM-REQ-4159 Content Manager returned an error in the response header.</messageString>
</ns1:message>


CM-REQ-4342 An error occurred with the client.
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:675)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:128)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at com.cognos.developer.schemas.bibus._3.ContentManagerServiceStub.query(ContentManagerServiceStub.java:4902)
at eu.busi.cognos.exemple.usersInfo.getUserClassInfo(usersInfo.java:28)
at eu.busi.cognos.exemple.connectionCognos.main(connectionCognos.java:102)
2Fick est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/04/2011, 16h17   #6
Invité de passage
 
Homme
Développeur Java
Inscription : avril 2011
Messages : 17
Détails du profil
Informations personnelles :
Sexe : Homme

Informations professionnelles :
Activité : Développeur Java
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : avril 2011
Messages : 17
Points : 2
Points : 2
Oui effectivement Nallack j'essaie d'utilisé les EXEMPLES SDK de COGNOS

entre temps
j'ai fait d'autre test dont voici le code et toujours la même erreur

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package eu.busi.cognos.exemple;
 
...
 
public class usersInfo {
    public BaseClass[] getUserClassInfo(connectionCognos connection,      String namespaceSearchPath){
 
    String namespaceSearchPath = "CAMID(\":\")/dataSource[@name='CubeObjEG']";
 
        PropEnum props[] = new PropEnum[] { PropEnum.searchPath,PropEnum.defaultName, PropEnum.name };
 
        BaseClass[] userClasses = NULL;
 
        IF(connection.getCmService() != NULL){
            Sort sort[] = {new Sort()};
            sort[0].setOrder(OrderEnum.ascending);
            sort[0].setPropName(PropEnum.defaultName);
            try {
                System.out.println(namespaceSearchPath);
                    userClasses = connection.getCmService().query(new SearchPathMultipleObject(namespaceSearchPath + "//role"), 
                                                                  props, sort, 
                                                                  new QueryOptions());
            } catch (RemoteException e) {
                e.printStackTrace();
            }
 
            IF(NULL != userClasses){
                System.out.println("Nombre de users retrouvé = " + userClasses.length);
                FOR (int i = 0; i < userClasses.length; i++) {
                     System.out.println("\n\ndefaultName est: " +
                     userClasses[i].getDefaultName().getValue());
                     System.out.println("searchPath est: " +
                     userClasses[i].getSearchPath().getValue());
 
                    MultilingualToken multilingualName[] = userClasses[i].getName().getValue();
                    FOR (int j = 0; j < multilingualName.length; j++) {
                         System.out.println("name in the " +
                         multilingualName[j].getLocale() + " locale is: " +
                         multilingualName[j].getValue());
                    }
                }// end FOR
            }
        }
        else{
            System.out.println("Erreur de connection dans userInfo");
        }    
        RETURN userClasses;
    }
}
2Fick est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/04/2011, 16h36   #7
Membre du Club
 
Homme Olivier
Inscription : avril 2008
Messages : 44
Détails du profil
Informations personnelles :
Nom : Homme Olivier
Localisation : France

Informations forums :
Inscription : avril 2008
Messages : 44
Points : 53
Points : 53
Je pense que le soucis provient de ta classe connection.

Regarde dans le doc dg_sdk.pdf vers la page 177.

Citation:
Retrieving and Clearing biBusHeader Objects
In an application using the Axis 1.1 toolkit, the following code retrieves the biBusHeader object
from a response:
Code :
BiBusHeader bibus = (BiBusHeader) ((Stub)cmService).getHeaderObject("","biBusHeader");
or
Code :
SOAPHeaderElement bibus = getServiceContext().getImplicitHeader("http://developer.cognos.com/schemas/bibus/3/";,"biBusHeader"));
The following code retrieves the biBusHeader object from a response in an application using the
Axis 1.4 toolkit:
Code :
1
2
3
4
SOAPHeaderElement temp=((Stub)cmService).getResponseHeader("http://developer.cognos.com/schemas/bibus/3/";,"biBusHeader");
BiBusHeader bibus =
(BiBusHeader)temp.getValueAsType(new QName("http://developer.cognos.com/schemas/bibus/3/";,"biBusHeader"));
((Stub)cmService).setHeader("http://developer.cognos.com/schemas/bibus/3/";,"biBusHeader", bibus);
In an application using the Axis 1.1 toolkit, the following code clears the header:
Code :
((Stub)cmService).getServiceContext().clearHeaders();
The following code clears the header in an application using the Axis 1.4 toolkit:
Code :
((Stub)cmService).clearHeaders();
Si tu es en C10, ça pourrait provenir de la.

Bon courage,
Nallack
Nallack est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/04/2011, 16h47   #8
Membre du Club
 
Homme Olivier
Inscription : avril 2008
Messages : 44
Détails du profil
Informations personnelles :
Nom : Homme Olivier
Localisation : France

Informations forums :
Inscription : avril 2008
Messages : 44
Points : 53
Points : 53
Voici le code pour la C10 pour lister tous les packages du portail :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
/Licensed Material - Property of IBM
//© Copyright IBM Corp. 2003, 2010
 
/*
* QueryObject.java
* 
* 
* Description: Technote 1335662 - SDK sample to extract all the permissions out for each report
* 
* Tested with: IBM Cognos BI 10.1, Java 5.0 	
*/
 
import java.net.MalformedURLException;
 
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
 
import org.apache.axis.client.Stub;
import org.apache.axis.message.SOAPHeaderElement;
 
import com.cognos.developer.schemas.bibus._3.BaseClass;
import com.cognos.developer.schemas.bibus._3.BiBusHeader;
import com.cognos.developer.schemas.bibus._3.ContentManagerService_PortType;
import com.cognos.developer.schemas.bibus._3.ContentManagerService_ServiceLocator;
import com.cognos.developer.schemas.bibus._3.PropEnum;
import com.cognos.developer.schemas.bibus._3.QueryOptions;
import com.cognos.developer.schemas.bibus._3.SearchPathMultipleObject;
import com.cognos.developer.schemas.bibus._3.Sort;
import com.cognos.developer.schemas.bibus._3.XmlEncodedXML;
 
public class QueryObject {
 
	private ContentManagerService_PortType cmService = NULL;
	// DEFAULT URL FOR CRN Content Manager. CHANGE IF NOT USING DEFAULT gateway
	public final String CM_URL = "http://localhost:9300/p2pd/servlet/dispatch"; 
 
	public ContentManagerService_PortType getCrn() {RETURN cmService;}
 
	public static void main(String[] args) {
 
		QueryObject cp = new QueryObject();
		//logon info. Comment next line IF Anonymous IS enabled
		cp.quickLogon("NameSpace", "UserName", "UserPwd");
 
		//SearchPath TO the report
		String searchPath = "/content//package";
 
		//String	searchPath = "~";
		SearchPathMultipleObject spMulti = new SearchPathMultipleObject();
		spMulti.set_value(searchPath);
 
		PropEnum props[] = cp.getAllPropEnum();
 
		try
		{
 
			BaseClass bc[] = cp.getCrn().query(spMulti, props,	new Sort[]{}, new QueryOptions());
			IF (bc != NULL && bc.length > 0) {
				FOR (int i=0; i<bc.length; i++)
				{
					System.out.println(bc[i].getSearchPath().getValue().toString());
				}
			}
 
		}
		catch (Exception e)
		{
			e.printStackTrace() ;
		}
 
}
 
 
	public PropEnum[] getAllPropEnum ()
	  {
	    PropEnum properties[] = new PropEnum[]{
	    		PropEnum.cubeContentName,
	    		PropEnum.dataBlocks,
	    		PropEnum.searchPathForURL,
	    		PropEnum.storeID,
	    		PropEnum.gateway,   		
	    PropEnum.active,
	      PropEnum.actualCompletionTime,
	      PropEnum.actualExecutionTime,
	      PropEnum.advancedSettings,
	      PropEnum.ancestors,
	      PropEnum.asOfTime,
	      PropEnum.base,
	      PropEnum.brsMaximumProcesses,
	      PropEnum.brsNonAffineConnections,
	      PropEnum.burstKey,
	      PropEnum.businessPhone,
	      PropEnum.canBurst,
	      PropEnum.capabilities,
	      PropEnum.capacity,
	      PropEnum.connections,
	      PropEnum.connectionString,
	      PropEnum.consumers,
	      PropEnum.contact,
	      PropEnum.contactEMail,
	      PropEnum.contentLocale,
	      PropEnum.creationTime,
	      PropEnum.credential,
	      PropEnum.credentialNamespaces,
	      PropEnum.credentials,
	      PropEnum.dailyPeriod,
	      PropEnum.DATA,
	      PropEnum.dataSize,
	      PropEnum.dataType,
	      PropEnum.defaultDescription,
	      PropEnum.defaultName,
	      PropEnum.defaultOutputFormat,
	      PropEnum.defaultScreenTip,
	      PropEnum.defaultTriggerDescription,
	      PropEnum.deployedObject,
	      PropEnum.deployedObjectAncestorDefaultNames,
	      PropEnum.deployedObjectClass,
	      PropEnum.deployedObjectDefaultName,
	      PropEnum.deployedObjectStatus,
	      PropEnum.deployedObjectUsage,
	      PropEnum.deploymentOptions,
	      PropEnum.description,
		  PropEnum.detail,
		  PropEnum.detailTime,
	      PropEnum.disabled,
	      PropEnum.dispatcherID,
	      PropEnum.dispatcherPath,
	      PropEnum.displaySequence,
	      PropEnum.email,
	      PropEnum.endDate,
	      PropEnum.endType,
	      PropEnum.eventID,
	      PropEnum.everyNPeriods,
	      PropEnum.executionFormat,
	      PropEnum.executionLocale,
	      PropEnum.executionPageDefinition,
	      PropEnum.executionPageOrientation,
	      PropEnum.executionPrompt,
	      PropEnum.faxPhone,
	      PropEnum.format,
	      PropEnum.givenName,
	      PropEnum.governors,
	      PropEnum.hasChildren,
	      PropEnum.hasMessage,
	      PropEnum.height,
	      PropEnum.homePhone,
	      PropEnum.horizontalElementsRenderingLimit,
	      PropEnum.identity,
	      PropEnum.isolationLevel,
	      PropEnum.msNonPeakDemandBeginHour,
	      PropEnum.msNonPeakDemandMaximumTasks,
	      PropEnum.msPeakDemandBeginHour,
	      PropEnum.msNonPeakDemandBeginHour,
		  PropEnum.msPeakDemandMaximumTasks,
	      PropEnum.lastConfigurationModificationTime,
	      PropEnum.lastPage,
	      PropEnum.loadBalancingMode,
	      PropEnum.locale,
	      PropEnum.location,
	      PropEnum.asAuditLevel,
	      PropEnum.asAuditLevel,
	      PropEnum.members,
	      PropEnum.metadataModel,
	      PropEnum.mobilePhone,
	      PropEnum.model,
	      PropEnum.modelName,
	      PropEnum.modificationTime,
	      PropEnum.monthlyAbsoluteDay,
	      PropEnum.monthlyRelativeDay,
	      PropEnum.monthlyRelativeWeek,
	      PropEnum.name,
	      PropEnum.namespaceFormat,
	      PropEnum.objectClass,
		  PropEnum.options,
	      PropEnum.output,
	      PropEnum.owner,
	      PropEnum.packageBase,
	      PropEnum.page,
	      PropEnum.pageOrientation,
	      PropEnum.pagerPhone,
	      PropEnum.parameters,
	      PropEnum.parent,
	      PropEnum.paths,
	      PropEnum.permissions,
	      PropEnum.policies,
	      PropEnum.portalPage,
	      PropEnum.position,
	      PropEnum.postalAddress,
	      PropEnum.printerAddress,
	      PropEnum.productLocale,
	      PropEnum.qualifier,
	      PropEnum.related,
	      PropEnum.recipientsEMail,
	      PropEnum.recipients,
	      PropEnum.related,
	      PropEnum.replacement,
	      PropEnum.requestedExecutionTime,
	      PropEnum.retentions,
	      PropEnum.rsAffineConnections,
	      PropEnum.rsMaximumProcesses,
	      PropEnum.rsNonAffineConnections,
	      PropEnum.rsQueueLimit,
	      PropEnum.runAsOwner,
	      PropEnum.runningState,
	      PropEnum.runOptions,
	      PropEnum.screenTip,
	      PropEnum.searchPath,
	      PropEnum.searchPathForURL,
	      PropEnum.sequencing,
	      PropEnum.serverGroup,
		  PropEnum.severity,
	      PropEnum.source,
	      PropEnum.specification,
	      PropEnum.startAsActive,
	      PropEnum.startDate,
	      PropEnum.state,
	      PropEnum.STATUS,
	      PropEnum.stepObject,
		  PropEnum.storeID,
	      PropEnum.surname,
	      PropEnum.target,
	      PropEnum.taskID,
	      PropEnum.timeZoneID,
	      PropEnum.triggerDescription,
	      PropEnum.triggerName,
	      PropEnum.type,
	      PropEnum.unit,
	      PropEnum.uri,
	      PropEnum.usage,
	      PropEnum.user,
	      PropEnum.userCapabilities,
	      PropEnum.userCapability,
	      PropEnum.userName,
	      PropEnum.version,
	      PropEnum.verticalElementsRenderingLimit,
	      PropEnum.viewed,
	      PropEnum.weeklyFriday,
	      PropEnum.weeklyMonday,
	      PropEnum.weeklySaturday,
	      PropEnum.weeklySunday,
	      PropEnum.weeklyThursday,
	      PropEnum.weeklyTuesday,
	      PropEnum.weeklyWednesday,
	      PropEnum.yearlyAbsoluteDay,
	      PropEnum.yearlyAbsoluteMonth,
	      PropEnum.yearlyRelativeDay,
	      PropEnum.yearlyRelativeMonth,
	      PropEnum.yearlyRelativeWeek,
	    };
	    RETURN properties;
	  }
 
//	connect TO Cognos8 Content Manager service
	public QueryObject () 
	{
		  ContentManagerService_ServiceLocator cmServiceLocator = new ContentManagerService_ServiceLocator();   		
	      try {
			cmService = cmServiceLocator.getcontentManagerService(new java.net.URL(CM_URL));
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (ServiceException e) {
			e.printStackTrace();
		}
	}
 
//This method loggs the user TO ReportNet
		public String quickLogon(String namespace, String uid, String pwd)
		{
			StringBuffer credentialXML = new StringBuffer();
 
			credentialXML.append("<credential>");
			credentialXML.append("<namespace>").append(namespace).append("</namespace>");
			credentialXML.append("<username>").append(uid).append("</username>");
			credentialXML.append("<password>").append(pwd).append("</password>");
			credentialXML.append("</credential>");
 
			String encodedCredentials = credentialXML.toString();
		    XmlEncodedXML xmlCredentials = new XmlEncodedXML();
		    xmlCredentials.set_value(encodedCredentials);
 
		   //Invoke the ContentManager service logon() method passing the credential string
		   //You will pass an empty string IN the second argument. OPTIONALLY,
		   //you could pass the Role AS an argument but FOR the purpose of this
		   //workshop don’t be concerned WITH Roles.
 
		   try
			{		
				cmService.logon(xmlCredentials,NULL );
 
			//TODO SET the BiBusHeader
		SOAPHeaderElement temp = ((Stub)cmService).getResponseHeader 
			 ("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader");
		BiBusHeader cmBiBusHeader = (BiBusHeader)temp.getValueAsType
			(new QName ("http://developer.cognos.com/schemas/bibus/3/","biBusHeader"));
		((Stub)cmService).setHeader
			("http://developer.cognos.com/schemas/bibus/3/", "biBusHeader", cmBiBusHeader);
 
			}
			catch (Exception e)
			{
				System.out.println(e);
			}
			RETURN ("Logon successful as " + uid);
		}
}
Peux tu tenter le coups et voir ce que ça donne?

Bon courage,
Nallack
Nallack est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/04/2011, 17h00   #9
Membre Expert
 
Avatar de Sunchaser
 
Homme Vincent
OPNI
Inscription : décembre 2004
Messages : 1 668
Détails du profil
Informations personnelles :
Nom : Homme Vincent
Âge : 41
Localisation : France, Manche (Basse Normandie)

Informations professionnelles :
Activité : OPNI
Secteur : Industrie Pharmaceutique

Informations forums :
Inscription : décembre 2004
Messages : 1 668
Points : 2 036
Points : 2 036
En addition a tout cela, voici un lien vers l'exemple Cognos SDK afin de lister le contenu de "My Folders".
A mon avis, ceci doit être adaptable afin de lister le contenu d'un répertoire ou package particulier, ce que je croyais être le but au début.
On ne sait jamais...

++
__________________
Citation:
Aux persévérants aucune route n'est interdite
Question: un ver a pied, c'est un millepatte unijambiste ?

Mon dernier trip musical

Citation:
Quiconque construit un jardin devient un allié de la lumière, aucun jardin n'étant jamais surgi des ténèbres
A priori un proverbe Perse ...
Sunchaser est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 12h38.


 
 
 
 
Partenaires

Hébergement Web