2015년 12월 23일 수요일

[Spotfire Analyst] function test using through TSSS with OpenSource R for Big Data Solution


For Spotfire Analyst .

1. connected to hadoop by RHadoop packages
2. calculated with mapper of hadoop by RHadoop packages.

Conclusion : It is possible and i will test other cases.

2015년 11월 12일 목요일

[Spotfire Developer] Can't not save dxp file with Library Item on Spotfire Client.


Developed CustomTool using Spotfire 7.0 API , the CustomTool acting is clear.
But when the dxp file save as Library item , occured error such as below. 


[ Error Message on Spotfire Client ]
Error message: Could not publish Baseball_test.

SerializationException at Spotfire.Dxp.Framework:
Type 'SpotfireDevTools.TwoWayAnova.CustomNode.TWACustomNode' is not serializable. The type is not marked with a 'System.SerializableAttribute'.
Object reference chain leading to the fault (closest reference first):

    Spotfire.Dxp.Application.CustomNodes.Nodes[0]
    Spotfire.Dxp.Application.Document.CustomNodes
 (HRESULT: 8013150C)

Stack Trace:
   at Spotfire.Dxp.Framework.Persistence.Xml.SerializationFormatter.Serialize(Object graph)
   at Spotfire.Dxp.Framework.Persistence.Xml.XmlFormatter.Serialize(Stream serializationStream, Object graph, StreamingContext context, PrunerBase pruner)
   at Spotfire.Dxp.Framework.Persistence.PersistenceManager.SerializeForPersistence(Stream serializationStream, Object graph, IServiceProvider serviceProvider)
   at Spotfire.Dxp.Framework.Persistence.PersistenceManager.<>c__DisplayClassd.<Save>b__6()
   at Spotfire.Dxp.Framework.ApplicationModel.Progress.ExecuteSubtask(String title, ProgressOperation operation)
   at Spotfire.Dxp.Framework.Persistence.PersistenceManager.Save(DocumentTypes documentType, DocumentNode doc, IDocumentSaveSettings settings, Stream targetStream)
   at Spotfire.Dxp.Framework.Persistence.PersistenceManager.Save(DocumentTypes documentType, DocumentNode doc, IDocumentSaveSettings settings, String fileName)
   at Spotfire.Dxp.Application.AnalysisApplication.SaveAs(LibraryEntry entry, Document document, LibraryItemMetadataSettings metadataSettings, DocumentSaveSettings saveSettings)
   at Spotfire.Dxp.Application.AnalysisApplication.SaveAs(LibraryEntry entry, LibraryItemMetadataSettings metadataSettings, DocumentSaveSettings saveSettings)
   at Spotfire.Dxp.Forms.Application.FileUserActions.<>c__DisplayClassb.<SaveAsLibrary>b__9()
   at Spotfire.Dxp.Forms.Application.FormsProgressService.ProgressThread.DoOperationLoop()

[Solution]
in the Class , write annotation. and rerun. then can see nomal acting. 
============example code=========================
 [Serializable()] 
 [PersistenceVersion(1, 0)]
 public class TWACustomNode{}


2015년 10월 29일 목요일

2015년 9월 14일 월요일

[Spotfire Server 7.0.0] Create BootStrap.xml with MSSQL and Error "cannot connect"


MSSQL 로 BootStrap 생성시 주의 사항

Identifier 입력시 해당 기준 정보는

MSSQL DB 서버에 생성한 DB 이름을 넣어야함.

Oracle 에서와 같이 SID 또는 인스턴스이름을 넣으면 접속 할수 없다는 Error 가 발생함.

해당 Error 는 아래와 같음.


2015년 8월 4일 화요일

[Spotfire Server] UserCreat, GroupExport, GroupImport Command App for Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;


public class Executor {

//configValues
public static String serverPath="C:\\tibco\\tss\\6.5.3";
public static String bootStrapPw= "spotfire";
public static String authentication="Library Administrator,API User,Impersonator";

public static String serverDrive=null;
public static String tomcatBinDirForCmd =null;
public static String tomcatBinPath=null;
public static String groupsDir=null;

public static void main(String[] args) {
// TODO Auto-generated method stub

CreatePath createPath = new CreatePath();
GroupFileEditor editor = new GroupFileEditor();
SpotfireCommands command = new SpotfireCommands();

//사용할 변수들 초기화
tomcatBinPath=createPath.createTomcatBinDir(serverPath);
groupsDir=createPath.CreateGroupsDir(tomcatBinPath);
serverDrive=createPath.ExtractServerDrive(serverPath);
tomcatBinDirForCmd= createPath.CreateTomcatBinDirForCmd(tomcatBinPath);

//baseCommand
String baseCommand=command.CreateBaseCmd(serverDrive, tomcatBinDirForCmd);

// DB Select 로 받을 사용자 정보
List<String> users = new ArrayList<String>();
users.add("guirim3");
users.add("guirim4");

//auth 권한 리스트
String[] auths=authentication.split(",");

//Export 수행 (overwrite)
command.ExportCommand(baseCommand,bootStrapPw);

 Path path =Paths.get(groupsDir);
// 1. Groups.txt 파일존재여부 확인    
if(Files.exists(path)){
    //리스트의 모든사용자
for(String tempUser : users ) {
//신규사용자를 Create 하기
command.CreateUserCmd(baseCommand,bootStrapPw,tempUser,tempUser);
}

//생성된 사용자를 그룹에 추가하기
editor.Writer(groupsDir, users,auths);

//Import 수행
command.ImportCommand(baseCommand,bootStrapPw);
}
}

}
import java.util.ArrayList;
import java.util.List;


public class CreatePath {
public String CreateGroupsDir(String tomcatBinPath){
return tomcatBinPath.concat("\\groups.txt");
}
public String ExtractServerDrive(String serverPath){
return serverPath.substring(0, 2);
}

public String createTomcatBinDir(String serverPath) {
// TODO Auto-generated method stub
return serverPath.concat("\\tomcat\\bin");
}
public String CreateTomcatBinDirForCmd(String tomcatBinPath){
return tomcatBinPath.replace("\\", "/");
}

}
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;


public class GroupFileEditor {

public void Writer(String groupsDir, List<String> users,String[] auths) {
// TODO Auto-generated method stub
try {
FileWriter fileWriter = new FileWriter(groupsDir,true);
BufferedWriter buffWrite = new BufferedWriter(fileWriter);
for(int authIndex=0;authIndex<auths.length;authIndex++){
for(int userIndex=0;userIndex<users.size();userIndex++){
buffWrite.write(TextGenerator(auths[authIndex],users.get(userIndex)));
buffWrite.newLine();
}
}
buffWrite.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private String TextGenerator(String auth, String user) {
// TODO Auto-generated method stub
return auth+" ; SPOTFIRE ;  ;  ; "+user+" ; SPOTFIRE ; user";
}


}