Fórum

Select Document Type

thumbnail
Ramalingaiah. D, modificado 7 Anos atrás.

Select Document Type

Expert Postagens: 486 Data de Entrada: 16/08/14 Postagens Recentes
Hi,

Before reading this once just see all the screenshot that i have posted.firstly i will explain how i got that page is By clicking on edit option for a folder in that if i click on Select Document Type then one open tab will apper then by clicking on Add if we see bottom we will have some fields like (Boolean,Date etc) we can drag and drop those fields...then finally click on save button.
From my knowledge those fields are not saving in database those are saving in XML files in those xml files i got structure in this file (liferay-ddm-structure_6_2_0) but unable to find values that are storing.Now my question is how can i view the storeddata in xml.
thumbnail
Ramalingaiah. D, modificado 7 Anos atrás.

RE: Select Document Type

Expert Postagens: 486 Data de Entrada: 16/08/14 Postagens Recentes
Hi,
i did It Document type fields stored saved by xml in table name ddmstructure
this is coming for metadata ,
i was used URL This (http://localhost:8080/api/axis/Portlet_DL_DLAppService?wsdl)
i was using web-service to Upload Files working fine,

upload Files along with title and description ,


===============================
package com.feray.dms.fileupload;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;

import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.documentlibrary.service.http.DLAppServiceSoap;
import com.liferay.portlet.documentlibrary.service.http.DLAppServiceSoapServiceLocator;

public class LiferayUtil {

public static void uploadFile(File file) throws ServiceException, RemoteException, IOException{
ServiceContext serviceContext=new ServiceContext();
DLAppServiceSoapServiceLocator locator= new DLAppServiceSoapServiceLocator();
DLAppServiceSoap service=locator.getPortlet_DL_DLAppService(getURL("Portlet_DL_DLAppService"));
service.addFileEntry(10661, 10719, file.getName(), "", file.getName(), file.getName(), "", getFileBytes(file), serviceContext);
// service.addFileEntry(repositoryId, folderId, sourceFileName, mimeType, title, description, changeLog, bytes, serviceContext);
UploadFileToPortal uploadfiletoporttal = new UploadFileToPortal();

uploadfiletoporttal.getTitle();
}

private static URL getURL(String serviceName) throws MalformedURLException {
String url = "http://localhost:8080"; // ip address of liferay server ex. = http://45.76.28.19:8181
String screenName = "test";
String password = "test";
int pos = url.indexOf("://");

String protocol = url.substring(0, pos + 3);
String host = url.substring(pos + 3, url.length());
StringBuilder sb = new StringBuilder();
sb.append(protocol);
sb.append(screenName);
sb.append(":");
sb.append(password);
sb.append("@");
sb.append(host);
sb.append("/api/axis/");
sb.append(serviceName);
// System.out.println("url>>>"+sb.toString());
return new URL(sb.toString());
}

private static byte[] getFileBytes(File file) throws IOException{
FileInputStream fileInputStream=null;
byte[] bFile = new byte[(int) file.length()];
//convert file into array of bytes
fileInputStream = new FileInputStream(file);
fileInputStream.read(bFile);
fileInputStream.close();
return bFile;
}




}





Regards
Ram
thumbnail
Ramalingaiah. D, modificado 7 Anos atrás.

RE: Select Document Type

Expert Postagens: 486 Data de Entrada: 16/08/14 Postagens Recentes
Hi,


I was done uploading files through DL_App_Service into dms project successfully.

but i cant uploading files along with the custom metadata and its document type through web services into the dms project.


Rereads
Ram